Module Name: src
Committed By: christos
Date: Fri May 19 19:51:11 UTC 2017
Modified Files:
src/lib/libc/stdlib: jemalloc.c
Log Message:
use strerror_r_ss()
To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/lib/libc/stdlib/jemalloc.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/lib/libc/stdlib/jemalloc.c
diff -u src/lib/libc/stdlib/jemalloc.c:1.40 src/lib/libc/stdlib/jemalloc.c:1.41
--- src/lib/libc/stdlib/jemalloc.c:1.40 Tue Apr 12 14:07:08 2016
+++ src/lib/libc/stdlib/jemalloc.c Fri May 19 15:51:10 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: jemalloc.c,v 1.40 2016/04/12 18:07:08 joerg Exp $ */
+/* $NetBSD: jemalloc.c,v 1.41 2017/05/19 19:51:10 christos Exp $ */
/*-
* Copyright (C) 2006,2007 Jason Evans <[email protected]>.
@@ -118,7 +118,7 @@
#include <sys/cdefs.h>
/* __FBSDID("$FreeBSD: src/lib/libc/stdlib/malloc.c,v 1.147 2007/06/15 22:00:16 jasone Exp $"); */
-__RCSID("$NetBSD: jemalloc.c,v 1.40 2016/04/12 18:07:08 joerg Exp $");
+__RCSID("$NetBSD: jemalloc.c,v 1.41 2017/05/19 19:51:10 christos Exp $");
#ifdef __FreeBSD__
#include "libc_private.h"
@@ -162,28 +162,12 @@ __RCSID("$NetBSD: jemalloc.c,v 1.40 2016
#ifdef __NetBSD__
# include <reentrant.h>
# include "extern.h"
+__strong_alias(__libc_malloc,malloc)
+__strong_alias(__libc_realloc,realloc)
+__strong_alias(__libc_calloc,calloc)
+__strong_alias(__libc_free,free)
-#define STRERROR_R(a, b, c) __strerror_r(a, b, c);
-/*
- * A non localized version of strerror, that avoids bringing in
- * stdio and the locale code. All the malloc messages are in English
- * so why bother?
- */
-static int
-__strerror_r(int e, char *s, size_t l)
-{
- int rval;
- size_t slen;
-
- if (e >= 0 && e < sys_nerr) {
- slen = strlcpy(s, sys_errlist[e], l);
- rval = 0;
- } else {
- slen = snprintf_ss(s, l, "Unknown error %u", e);
- rval = EINVAL;
- }
- return slen >= l ? ERANGE : rval;
-}
+#define STRERROR_R(a, b, c) strerror_r_ss(a, b, c);
#endif
#ifdef __FreeBSD__