From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/627 Path: news.gmane.org!not-for-mail From: Georgi Chorbadzhiyski Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH 0/4] Fix function definitions. Date: Fri, 09 Mar 2012 10:22:18 +0200 Message-ID: <4F59BDBA.70206@unixsol.org> References: <1331280854-9080-1-git-send-email-gf@unixsol.org> <4F59BD70.9020105@unixsol.org> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1331281354 24835 80.91.229.3 (9 Mar 2012 08:22:34 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 9 Mar 2012 08:22:34 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-628-gllmg-musl=m.gmane.org@lists.openwall.com Fri Mar 09 09:22:34 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 1S5v5q-00083T-Nn for gllmg-musl@plane.gmane.org; Fri, 09 Mar 2012 09:22:30 +0100 Original-Received: (qmail 30106 invoked by uid 550); 9 Mar 2012 08:22:30 -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 30095 invoked from network); 9 Mar 2012 08:22:30 -0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 In-Reply-To: <4F59BD70.9020105@unixsol.org> Xref: news.gmane.org gmane.linux.lib.musl.general:627 Archived-At: On 3/9/12 10:21 AM, Georgi Chorbadzhiyski wrote: > On 3/9/12 10:14 AM, Georgi Chorbadzhiyski wrote: >> Define several functions if _BSD_SOURCE is set. _XOPEN_SOURCE >> should also be checked but I can't be bothered, because _BSD_SOURCE >> works. >> >> Background for these patches: >> http://lists.landley.net/pipermail/toybox-landley.net/2012-March/000309.html >> >> Georgi Chorbadzhiyski (4): >> include/stdlib.h: Define clearenv() if (_SVID_SOURCE || _BSD_SOURCE) >> is set. >> include/unistd.h: Define sethostname() if _BSD_SOURCE is set. >> include/unistd.h: Define vfork() if _BSD_SOURCE is set. >> include/sys/types.h: major(), minor() and makedev() should be defined >> if _BSD_SOURCE is set. >> >> include/stdlib.h | 5 ++++- >> include/sys/types.h | 5 ++++- >> include/unistd.h | 10 ++++++++-- >> 3 files changed, 16 insertions(+), 4 deletions(-) >> > > Hmm...it seems this is not enough. See include/unistd.h > > #ifdef _GNU_SOURCE > int brk(void *); > void *sbrk(intptr_t); > pid_t forkall(void); > int vhangup(void); > int getpagesize(void); > int usleep(unsigned); > unsigned ualarm(unsigned, unsigned); > int setgroups(size_t, const gid_t []); > int setresuid(uid_t, uid_t, uid_t); > int setresgid(gid_t, gid_t, gid_t); > char *get_current_dir_name(void); > #endif > > Most of the above according to their man pages should be defined if > _BSD_SOURCE is set. > > Should the headers be filled with feature checks (that would make them > quite ugly) or assume we have _GNU_SOURCE defined and remove any _GNU_SOURCE > checks? ...for functions that are not pure GNU extensions like strndupa. -- Georgi Chorbadzhiyski http://georgi.unixsol.org/