Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4F59BD70.9020105@unixsol.org>
Date: Fri, 09 Mar 2012 10:21:04 +0200
From: Georgi Chorbadzhiyski <gf@...xsol.org>
To: musl@...ts.openwall.com
Subject: Re: [PATCH 0/4] Fix function definitions.

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?

-- 
Georgi Chorbadzhiyski
http://georgi.unixsol.org/

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.