Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src Revert namespacing of atoi(3)



details:   https://anonhg.NetBSD.org/src/rev/a90ed2ca6f90
branches:  trunk
changeset: 358551:a90ed2ca6f90
user:      kamil <kamil%NetBSD.org@localhost>
date:      Sun Jan 07 15:28:33 2018 +0000

description:
Revert namespacing of atoi(3)

Sanitizers can handle recursive interceptions in some / most cases, if they
will cause damage the problem will be not workaroundable without libc
changes - I will be back to it.

Keep namespace of asctime() as this can be a cancellation point according
to POSIX. Right now it's not implemented on NetBSD. Defer it for later.

Keep weak symbols and namespace for wait6(2) as this could be a
cancellation point as well. Defer this for later.

Sanitizers's [recursive] interceptors are a hack and moving one way or
another can cause new sets of problems. Recursive ones can be useful and
cause problems (on Linux there are known with with signal handlers).

Sponsored by <The NetBSD Foundation>

diffstat:

 lib/libc/include/namespace.h                                       |   3 +--
 lib/libc/stdlib/atoi.c                                             |  10 ++--------
 sys/external/bsd/compiler_rt/dist/lib/profile/InstrProfilingFile.c |   4 ----
 3 files changed, 3 insertions(+), 14 deletions(-)

diffs (61 lines):

diff -r 1865de32a9ba -r a90ed2ca6f90 lib/libc/include/namespace.h
--- a/lib/libc/include/namespace.h      Sun Jan 07 15:26:43 2018 +0000
+++ b/lib/libc/include/namespace.h      Sun Jan 07 15:28:33 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: namespace.h,v 1.193 2018/01/05 20:30:51 kamil Exp $    */
+/*     $NetBSD: namespace.h,v 1.194 2018/01/07 15:28:33 kamil Exp $    */
 
 /*-
  * Copyright (c) 1997-2004 The NetBSD Foundation, Inc.
@@ -217,7 +217,6 @@
 #define asprintf_l             _asprintf_l
 #define asysctl                        _asysctl
 #define asysctlbyname          _asysctlbyname
-#define atoi                   _atoi
 #define atoll                  _atoll
 #define authnone_create                _authnone_create
 #define authunix_create                _authunix_create
diff -r 1865de32a9ba -r a90ed2ca6f90 lib/libc/stdlib/atoi.c
--- a/lib/libc/stdlib/atoi.c    Sun Jan 07 15:26:43 2018 +0000
+++ b/lib/libc/stdlib/atoi.c    Sun Jan 07 15:28:33 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: atoi.c,v 1.13 2018/01/05 20:30:51 kamil Exp $  */
+/*     $NetBSD: atoi.c,v 1.14 2018/01/07 15:28:33 kamil Exp $  */
 
 /*
  * Copyright (c) 1988, 1993
@@ -34,19 +34,13 @@
 #if 0
 static char sccsid[] = "@(#)atoi.c     8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: atoi.c,v 1.13 2018/01/05 20:30:51 kamil Exp $");
+__RCSID("$NetBSD: atoi.c,v 1.14 2018/01/07 15:28:33 kamil Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
-#include "namespace.h"
-
 #include <assert.h>
 #include <stdlib.h>
 
-#ifdef __weak_alias
-__weak_alias(atoi,_atoi)
-#endif
-
 int
 atoi(const char *str)
 {
diff -r 1865de32a9ba -r a90ed2ca6f90 sys/external/bsd/compiler_rt/dist/lib/profile/InstrProfilingFile.c
--- a/sys/external/bsd/compiler_rt/dist/lib/profile/InstrProfilingFile.c        Sun Jan 07 15:26:43 2018 +0000
+++ b/sys/external/bsd/compiler_rt/dist/lib/profile/InstrProfilingFile.c        Sun Jan 07 15:28:33 2018 +0000
@@ -7,10 +7,6 @@
 |*
 \*===----------------------------------------------------------------------===*/
 
-#ifdef _LIBC
-#include "namespace.h"
-#endif
-
 #include "InstrProfiling.h"
 #include "InstrProfilingInternal.h"
 #include "InstrProfilingUtil.h"



Home | Main Index | Thread Index | Old Index