Subject: adding __libc_read et al?
To: None <tech-userlevel@netbsd.org>
From: Simon J. Gerraty <sjg@quick.com.au>
List: tech-userlevel
Date: 12/31/1999 17:23:29
Does anyone else think having __libc_read, __libc_write etc would be
handy?

Is something like this a "bad idea"[TM]?

--- sys/arch/sparc/include/asm.h.old  Thu Feb 25 03:02:19 1999
+++ sys/arch/sparc/include/asm.h  Fri Dec 31 16:54:07 1999
@@ -96,7 +96,19 @@
 #define _PROF_PROLOGUE
 #endif
 
+#ifdef __STDC__
+# define __CONCAT(x,y) x ## y
+# define __STRING(x)   #x
+#else
+# define __CONCAT(x,y) x/**/y
+# define __STRING(x)   "x"
+#endif
+
+#if defined(_LIBC)
+#define ENTRY(name)            _ENTRY(_C_LABEL(__CONCAT(__libc_,name)));_ENTRY(_C_LABEL(name)); _PROF_PROLOGUE
+#else
 #define ENTRY(name)            _ENTRY(_C_LABEL(name)); _PROF_PROLOGUE
+#endif
 #define        ASENTRY(name)           _ENTRY(_ASM_LABEL(name)); _PROF_PROLOGUE
 #define        FUNC(name)              ASENTRY(name)
 #define RODATA(name)           .align 4; .text; .globl _C_LABEL(name); \


It would be nice to be able to use something like
-D_LIB_ENTRY_LABEL=__libc_ or whatever, but I've not worked out how to
get that to work - I get either "__libc_ read" or "_LIB_ENTRY_LABELread"

--sjg