public inbox for cygwin-patches@cygwin.com
 help / color / mirror / Atom feed
* [PATCH] Hide sethostname() in unistd.h
@ 2015-06-16 16:27 Christian Franke
  2015-06-16 17:45 ` Corinna Vinschen
  0 siblings, 1 reply; 10+ messages in thread
From: Christian Franke @ 2015-06-16 16:27 UTC (permalink / raw)
  To: cygwin-patches

[-- Attachment #1: Type: text/plain, Size: 214 bytes --]

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


[-- Attachment #2: unistd-sethostname.patch --]
[-- Type: text/x-patch, Size: 750 bytes --]

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 ));

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-06-19  8:20 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-16 16:27 [PATCH] Hide sethostname() in unistd.h Christian Franke
2015-06-16 17:45 ` Corinna Vinschen
2015-06-17  5:39   ` Christian Franke
2015-06-17  8:46     ` Corinna Vinschen
2015-06-17 20:25       ` Christian Franke
2015-06-17 20:57         ` Yaakov Selkowitz
2015-06-17 21:15           ` Eric Blake
2015-06-18  8:26             ` Corinna Vinschen
2015-06-19  5:28               ` Christian Franke
2015-06-19  8:20                 ` Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).