* [PATCH] Declare sethostname() if __BSD_VISIBLE is defined
@ 2014-10-24 7:57 Sebastian Huber
2014-10-24 9:39 ` Corinna Vinschen
0 siblings, 1 reply; 3+ messages in thread
From: Sebastian Huber @ 2014-10-24 7:57 UTC (permalink / raw)
To: newlib; +Cc: Sebastian Huber
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.
newlib/ChangeLog
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 ));
#endif
+#if defined(__BSD_VISIBLE)
+int _EXFUN(sethostname, (const char *, size_t));
+#endif
int _EXFUN(setpgid, (pid_t __pid, pid_t __pgid ));
int _EXFUN(setpgrp, (void ));
#if defined(__CYGWIN__) && !defined(__INSIDE_CYGWIN__)
--
1.8.4.5
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Declare sethostname() if __BSD_VISIBLE is defined
2014-10-24 7:57 [PATCH] Declare sethostname() if __BSD_VISIBLE is defined Sebastian Huber
@ 2014-10-24 9:39 ` Corinna Vinschen
2014-10-24 9:45 ` Sebastian Huber
0 siblings, 1 reply; 3+ messages in thread
From: Corinna Vinschen @ 2014-10-24 9:39 UTC (permalink / raw)
To: newlib
[-- Attachment #1: Type: text/plain, Size: 574 bytes --]
Hi Sebastian,
On Oct 24 09:57, Sebastian Huber wrote:
> 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.
Testing for defined(__BSD_VISIBLE) seems wrong to me. Per sys/cdefs.h
__BSD_VISIBLE is often define as 0. Taking the Linux man page into
account, shouldn't that be something like
#if __BSD_VISIBLE || (defined (_XOPEN_SOURCE) && __XSI_VISIBLE < 500)
?
Corinna
--
Corinna Vinschen
Cygwin Maintainer
Red Hat
[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Declare sethostname() if __BSD_VISIBLE is defined
2014-10-24 9:39 ` Corinna Vinschen
@ 2014-10-24 9:45 ` Sebastian Huber
0 siblings, 0 replies; 3+ messages in thread
From: Sebastian Huber @ 2014-10-24 9:45 UTC (permalink / raw)
To: newlib
On 24/10/14 11:39, Corinna Vinschen wrote:
> On Oct 24 09:57, Sebastian Huber wrote:
>> >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.
> Testing for defined(__BSD_VISIBLE) seems wrong to me. Per sys/cdefs.h
> __BSD_VISIBLE is often define as 0. Taking the Linux man page into
> account, shouldn't that be something like
>
> #if __BSD_VISIBLE || (defined (_XOPEN_SOURCE) && __XSI_VISIBLE < 500)
>
> ?
Oh, yes, this defined(__BSD_VISIBLE) is nonsense. I send a new patch.
--
Sebastian Huber, embedded brains GmbH
Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone : +49 89 189 47 41-16
Fax : +49 89 189 47 41-09
E-Mail : sebastian.huber@embedded-brains.de
PGP : Public key available on request.
Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-10-24 9:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-24 7:57 [PATCH] Declare sethostname() if __BSD_VISIBLE is defined Sebastian Huber
2014-10-24 9:39 ` Corinna Vinschen
2014-10-24 9:45 ` Sebastian Huber
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).