[PATCH] Declare sethostname() if __BSD_VISIBLE is defined

Sebastian Huber sebastian.huber@embedded-brains.de
Fri Oct 24 07:57:00 GMT 2014

Prototype is according to glibc and not FreeBSD which uses int for the
second parameter.  I am not sure how to do the alternative feature test
described in the Linux manpage.

2014-10-24  Sebastian Huber  <sebastian.huber@embedded-brains.de>

	* libc/include/sys/unistd.h (sethostname): Declare if
	__BSD_VISIBLE is defined.
 newlib/libc/include/sys/unistd.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/newlib/libc/include/sys/unistd.h b/newlib/libc/include/sys/unistd.h
index 2c3afc9..0d6dd92 100644
--- a/newlib/libc/include/sys/unistd.h
+++ b/newlib/libc/include/sys/unistd.h
@@ -166,6 +166,9 @@ int     _EXFUN(setgid, (gid_t __gid ));
 #if defined(__CYGWIN__)
 int	_EXFUN(setgroups, (int ngroups, const gid_t *grouplist ));
+#if defined(__BSD_VISIBLE)
+int     _EXFUN(sethostname, (const char *, size_t));
 int     _EXFUN(setpgid, (pid_t __pid, pid_t __pgid ));
 int     _EXFUN(setpgrp, (void ));
 #if defined(__CYGWIN__) && !defined(__INSIDE_CYGWIN__)

More information about the Newlib mailing list