This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
[PATCH] Hide sethostname() in unistd.h
- From: Christian Franke <Christian dot Franke at t-online dot de>
- To: cygwin-patches at cygwin dot com
- Date: Tue, 16 Jun 2015 18:27:41 +0200
- Subject: [PATCH] Hide sethostname() in unistd.h
- Authentication-results: sourceware.org; auth=none
Found during an experimental build of busybox:
The sethostname() prototype in /usr/include/sys/unistd.h is enabled also
on Cygwin.
It should be disabled because Cygwin does not provide this function.
Christian
2015-06-16 Christian Franke <franke@computer.org>
* libc/include/sys/unistd.h (sethostname): Hide prototype on Cygwin.
diff --git a/newlib/libc/include/sys/unistd.h b/newlib/libc/include/sys/unistd.h
index eb26921..6131b5c 100644
--- a/newlib/libc/include/sys/unistd.h
+++ b/newlib/libc/include/sys/unistd.h
@@ -169,7 +169,7 @@ int _EXFUN(setgid, (gid_t __gid ));
#if defined(__CYGWIN__)
int _EXFUN(setgroups, (int ngroups, const gid_t *grouplist ));
#endif
-#if __BSD_VISIBLE || (defined(_XOPEN_SOURCE) && __XSI_VISIBLE < 500)
+#if !defined(__CYGWIN__) && (__BSD_VISIBLE || (defined(_XOPEN_SOURCE) && __XSI_VISIBLE < 500))
int _EXFUN(sethostname, (const char *, size_t));
#endif
int _EXFUN(setpgid, (pid_t __pid, pid_t __pgid ));