Source-Changes-HG archive

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

[src/trunk]: src/lib/libc Register new weak symbol in libc for internal usage...



details:   https://anonhg.NetBSD.org/src/rev/8d3a5a74155e
branches:  trunk
changeset: 358526:8d3a5a74155e
user:      kamil <kamil%NetBSD.org@localhost>
date:      Fri Jan 05 20:01:31 2018 +0000

description:
Register new weak symbol in libc for internal usage: asctime

The NetBSD Standard C Library uses internally some of its functions with
a mangled symbol name, usually "_symbol". The internal functions shall not
use the global (public) symbols.

Add asctime to namespace.h.

Register a new __weak_alias() entry for asctime() in asctime.c.

acstime() is used internally in ctime and __ctime50. This revision switches
the internal usage to the internal symbol.

Sponsored by <The NetBSD Foundation>

diffstat:

 lib/libc/include/namespace.h |  3 ++-
 lib/libc/time/asctime.c      |  5 +++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diffs (43 lines):

diff -r 418278bbbfad -r 8d3a5a74155e lib/libc/include/namespace.h
--- a/lib/libc/include/namespace.h      Fri Jan 05 19:29:44 2018 +0000
+++ b/lib/libc/include/namespace.h      Fri Jan 05 20:01:31 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: namespace.h,v 1.191 2018/01/05 19:29:44 kamil Exp $    */
+/*     $NetBSD: namespace.h,v 1.192 2018/01/05 20:01:31 kamil Exp $    */
 
 /*-
  * Copyright (c) 1997-2004 The NetBSD Foundation, Inc.
@@ -211,6 +211,7 @@
 #define arc4random_buf         _arc4random_buf
 #define arc4random_stir                _arc4random_stir
 #define arc4random_uniform     _arc4random_uniform
+#define asctime                        _asctime
 #define asctime_r              _asctime_r
 #define asprintf               _asprintf
 #define asprintf_l             _asprintf_l
diff -r 418278bbbfad -r 8d3a5a74155e lib/libc/time/asctime.c
--- a/lib/libc/time/asctime.c   Fri Jan 05 19:29:44 2018 +0000
+++ b/lib/libc/time/asctime.c   Fri Jan 05 20:01:31 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: asctime.c,v 1.22 2017/10/24 17:38:17 christos Exp $    */
+/*     $NetBSD: asctime.c,v 1.23 2018/01/05 20:01:31 kamil Exp $       */
 
 /*
 ** This file is in the public domain, so clarified as of
@@ -16,7 +16,7 @@
 #if 0
 static char    elsieid[] = "@(#)asctime.c      8.5";
 #else
-__RCSID("$NetBSD: asctime.c,v 1.22 2017/10/24 17:38:17 christos Exp $");
+__RCSID("$NetBSD: asctime.c,v 1.23 2018/01/05 20:01:31 kamil Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -27,6 +27,7 @@
 #include <stdio.h>
 
 #ifdef __weak_alias
+__weak_alias(asctime,_asctime)
 __weak_alias(asctime_r,_asctime_r)
 #endif
 



Home | Main Index | Thread Index | Old Index