summaryrefslogtreecommitdiff
path: root/lib/libc/include
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2017-10-22 00:20:50 +0000
committerchristos <christos@NetBSD.org>2017-10-22 00:20:50 +0000
commitcf3869d110e8b8eaea3a04c67bfad9bb3c80362a (patch)
treefb24ab29330ca7ab335c5d40ef9aeb70792db15a /lib/libc/include
parentc2b17f052a063862e54d845a277ddbb91aa95527 (diff)
Add an explanation of how namespace.h works.
Diffstat (limited to 'lib/libc/include')
-rw-r--r--lib/libc/include/namespace.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/libc/include/namespace.h b/lib/libc/include/namespace.h
index 1ee3d26ec1e..12e1b3e64df 100644
--- a/lib/libc/include/namespace.h
+++ b/lib/libc/include/namespace.h
@@ -1,4 +1,4 @@
-/* $NetBSD: namespace.h,v 1.186 2017/02/08 17:30:27 maya Exp $ */
+/* $NetBSD: namespace.h,v 1.187 2017/10/22 00:20:50 christos Exp $ */
/*-
* Copyright (c) 1997-2004 The NetBSD Foundation, Inc.
@@ -96,6 +96,16 @@
#define warnc _warnc
#define warnx _warnx
+/*
+ * namespace protection for libc functions that are used internally
+ * in libc and should be not overriden by applications. To do this,
+ * this header renames them to a name that starts with an "_" so that
+ * libc uses the "_" flavor internally (and this name is not part of
+ * the application namespace), and then a weak alias is added to the
+ * "_" name next to the function definition so that the function is
+ * exposed again.
+ */
+
#ifdef __weak_alias
#define MD2Data _MD2Data
#define MD2End _MD2End