Date: Mon, 13 Feb 2017 09:16:20 -0600 From: Eric van Gyzen <eric@vangyzen.net> To: Ed Schouten <ed@nuxi.nl> Cc: Ngie Cooper <ngie@freebsd.org>, src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r313632 - in stable/10/contrib/netbsd-tests/lib/libc/gen: . posix_spawn Message-ID: <be301cb3-a328-441a-63f5-7430ba8832f3@vangyzen.net> In-Reply-To: <CABh_MKmbdvbW3c2w9AJ_S5syieM92oFQy%2BoBvbqCbp6ZkQiT3Q@mail.gmail.com> References: <201702110735.v1B7ZROH028648@repo.freebsd.org> <CABh_MKmYuP-Yb3VLJ3EOb1dODtHmN8uoSuytTrjTQm=C9iwuMw@mail.gmail.com> <65538136-4b19-bc06-f3e0-302ef2fc2359@vangyzen.net> <CABh_MKmbdvbW3c2w9AJ_S5syieM92oFQy%2BoBvbqCbp6ZkQiT3Q@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 02/13/2017 02:22, Ed Schouten wrote: > 2017-02-11 15:28 GMT+01:00 Eric van Gyzen <eric@vangyzen.net>: >> I would be concerned that app developers would read this definition, ignore >> the one in the man page, and use the __-prefixed types in their apps. > > I think that's a concern that's not specific to the change at hand, as > that's simply how BSD header files work. Take a look at the > declaration of kill() in our copy of <signal.h>: > > int kill(__pid_t, int); > > This is simply the construct that the BSDs use to depend on a type > without exposing it. Note that we [usually] expose that type earlier in that same file: #if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE #ifndef _PID_T_DECLARED typedef __pid_t pid_t; #define _PID_T_DECLARED #endif #endif Apparently, signal.h should not expose pid_t in a strict pre-2001 POSIX environment. Without this restriction, the prototype for kill() would probably use pid_t, as is done in several other files, such as spawn.h: #ifndef _PID_T_DECLARED typedef __pid_t pid_t; #define _PID_T_DECLARED #endif int posix_spawn(pid_t * __restrict, const char * __restrict, ... Let me be clear: Your change is useful and good, and I think you should commit it. I would suggest using the above construct for the __-prefixed types, but it's only a suggestion. Cheers, Eric
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?be301cb3-a328-441a-63f5-7430ba8832f3>