summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/unistd.h7
-rw-r--r--libc/sysdeps/linux/common/getdomainname.c10
2 files changed, 10 insertions, 7 deletions
diff --git a/include/unistd.h b/include/unistd.h
index e6154d24c..30621634a 100644
--- a/include/unistd.h
+++ b/include/unistd.h
@@ -908,16 +908,15 @@ extern int sethostname (__const char *__name, size_t __len)
This call is restricted to the super-user. */
extern int sethostid (long int __id) __THROW __wur;
-#if defined __UCLIBC_BSD_SPECIFIC__
-# if defined UCLIBC_INTERNAL
-/* separate preprocessor test for unifdef */
+#if defined __UCLIBC_BSD_SPECIFIC__ || defined UCLIBC_INTERNAL
/* Get and set the NIS (aka YP) domain name, if any.
Called just like `gethostname' and `sethostname'.
The NIS domain name is usually the empty string when not using NIS. */
extern int getdomainname (char *__name, size_t __len)
__THROW __nonnull ((1)) __wur;
-# endif
libc_hidden_proto(getdomainname)
+#endif
+#if defined __UCLIBC_BSD_SPECIFIC__
extern int setdomainname (__const char *__name, size_t __len)
__THROW __nonnull ((1)) __wur;
#endif
diff --git a/libc/sysdeps/linux/common/getdomainname.c b/libc/sysdeps/linux/common/getdomainname.c
index 5cf8baa6b..cdea2172a 100644
--- a/libc/sysdeps/linux/common/getdomainname.c
+++ b/libc/sysdeps/linux/common/getdomainname.c
@@ -16,7 +16,11 @@
/* Experimentally off - libc_hidden_proto(strcpy) */
/* libc_hidden_proto(uname) */
-int getdomainname(char *name, size_t len)
+int
+#ifndef __UCLIBC_BSD_SPECIFIC__
+attribute_hidden
+#endif
+getdomainname(char *name, size_t len)
{
struct utsname uts;
@@ -42,7 +46,7 @@ int getdomainname(char *name, size_t len)
#endif
return 0;
}
-#ifdef __UCLIBC_BSD_SPECIFIC__
+# ifdef __UCLIBC_BSD_SPECIFIC__
libc_hidden_def(getdomainname)
-#endif
+# endif
#endif