From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/623 Path: news.gmane.org!not-for-mail From: Georgi Chorbadzhiyski Newsgroups: gmane.linux.lib.musl.general Subject: [PATCH 2/4] include/unistd.h: Define sethostname() if _BSD_SOURCE is set. Date: Fri, 9 Mar 2012 10:14:12 +0200 Message-ID: <1331280854-9080-3-git-send-email-gf@unixsol.org> References: <1331280854-9080-1-git-send-email-gf@unixsol.org> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org X-Trace: dough.gmane.org 1331280885 21539 80.91.229.3 (9 Mar 2012 08:14:45 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 9 Mar 2012 08:14:45 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-625-gllmg-musl=m.gmane.org@lists.openwall.com Fri Mar 09 09:14:44 2012 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1S5uyK-0000eI-33 for gllmg-musl@plane.gmane.org; Fri, 09 Mar 2012 09:14:44 +0100 Original-Received: (qmail 22086 invoked by uid 550); 9 Mar 2012 08:14:41 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 22011 invoked from network); 9 Mar 2012 08:14:34 -0000 X-Mailer: git-send-email 1.7.5.1 In-Reply-To: <1331280854-9080-1-git-send-email-gf@unixsol.org> Xref: news.gmane.org gmane.linux.lib.musl.general:623 Archived-At: According to sethostname(2) man page, the function should be defined if _BSD_SOURCE is set. --- include/unistd.h | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/include/unistd.h b/include/unistd.h index 7662e51..3fda5aa 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -144,6 +144,10 @@ void sync(void); int getdtablesize(void); #endif +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) +int sethostname(const char *, size_t); +#endif + #ifdef _GNU_SOURCE int brk(void *); void *sbrk(intptr_t); @@ -152,7 +156,6 @@ pid_t vfork(void); int vhangup(void); int chroot(const char *); int getpagesize(void); -int sethostname(const char *, size_t); int usleep(unsigned); unsigned ualarm(unsigned, unsigned); int setgroups(size_t, const gid_t []); -- 1.7.5.1