Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 6 Apr 2012 10:48:29 -0400
From: Rich Felker <dalias@...ifal.cx>
To: musl@...ts.openwall.com
Subject: Re: [PATCH] _BSD_SOURCE for unistd.h, take 2

On Thu, Apr 05, 2012 at 06:45:34PM -0700, Isaac Dunham wrote:
> +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
> +pid_t vfork(void);
> +int vhangup(void);
> +int chroot(const char *);
> +int usleep(unsigned);
> +unsigned ualarm(unsigned, unsigned);
> +#endif
> +
>  #ifdef _GNU_SOURCE
>  int brk(void *);
>  void *sbrk(intptr_t);
>  pid_t forkall(void);
> -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 []);
>  int setresuid(uid_t, uid_t, uid_t);
>  int setresgid(gid_t, gid_t, gid_t);

Looking at this again, it looks to me like almost all of the functions
under _GNU_SOURCE are also present on BSD. That is to say, just
replacing #ifdef _GNU_SOURCE with

#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)

would give a closer approximation to what _BSD_SOURCE is supposed to
do. I'm not saying this is the best solution, but before I go
committing patches to support _BSD_SOURCE, I'd at least like it to be
reasonably complete and not just a few functions to make Toybox
happy...

Rich

Powered by blists - more mailing lists

Your e-mail address:

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