tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: The <signal.h> header shall define the timespec structure as described in <time.h>



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On 12.07.2015 05:16, David Holland wrote:
> On Sat, Jul 11, 2015 at 02:58:16PM +0200, Kamil Rytarowski wrote:
>>> Thanks, I request to commit it for -current. I've run into a 
>>> situation when a piece of software requires this POSIX
>>> behavior.
>> 
>> I'm going to commit this change after 24h. In case of comments
>> please let me know.
> 
> Is it really ok to expose the rest of sys/time.h in signal.h? That 
> doesn't entirely sound like a good idea...
> 

What's your alternative? The change is inspired by OpenBSD.

FreeBSD doesn't seem to expose definition of struct timespec, but I
might be wrong.

GLIBC has the following lines in signal.h:

  72 #ifdef __USE_POSIX199309
  73 /* We need `struct timespec' later on.  */
  74 # define __need_timespec
  75 # include <time.h>
  76 #endif

https://sourceware.org/git/?p=glibc.git;a=blob;f=signal/signal.h;h=712cd
95c7695c83d3a3e33a85397a20cf4002e6e;hb=HEAD

MUSL defines it:

#define __NEED_size_t
#define __NEED_pid_t
#define __NEED_uid_t
#define __NEED_struct_timespec
#define __NEED_pthread_t
#define __NEED_pthread_attr_t
#define __NEED_time_t
#define __NEED_clock_t
#define __NEED_sigset_t

#include <bits/alltypes.h>

http://git.musl-libc.org/cgit/musl/tree/include/signal.h

ULIBC defines it:

#if defined __USE_POSIX199309 && defined __UCLIBC_HAS_REALTIME__
/* We need `struct timespec' later on.  */
# define __need_timespec
# include <time.h>
#endif

http://git.uclibc.org/uClibc/tree/include/signal.h
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJVokBMAAoJEEuzCOmwLnZsUTwQAMax0nfhcS2fsE2VFEfK0f4y
x7uBzPlibdFC4J7NMwIOUofDV2BgP6pKnaA0n4o95ZMMaWHExOlXaHFQyWnmTFNW
UlpXTtDQj7DNmkICo9EQY6OZSyA6BPC7MH/5j6DnTH9Mqgs484McppIbbG4LTg6Y
yYNLgFRW6kCqWTk6s3ZZXlZFjYtOxJDHMz0hpRd9TJotr4nhbcA/FyEeO4/4Tizx
5reCdHb+7/8LzLPMygHhOukHkcAA3mGJMWtPwHBO5+n/4OggLOFBPzoQGHdCoeEL
dfU6XQi2mIUiLmm3uLG+iKLywbOK1BSezIjSpledmLZJOY3afxAtf5EqCzojXCXV
hoY6FH7wAJnE4QceWWVNkqcM3x1CmYO9i/GP8tAklw2/SPnKNunRC1G60OZY4T/D
cGqNnPM8cVx1PI62WD7BrvL8ulWO/sDOtno7PkT4CHDMroeKzS5Pg0tzAz3CDvk5
YXQysrb1zpJakfkiwYISJRPesk7QadyI+9Tui/J1SAwB76jYgSuAYEsYlnegQfXK
ztbE8YqMYU1NRqj+p2QgzylDZC5aj331JaxU7OFESpqcQ5WDoqFyMlCXzOgKynH+
0/cvH8JLA9sMj4llG73axVjfT5xVRwhMab0ZazGJFoVqcwABvmzqYWoaxyx9E7Wl
WsoWNRXS75yzomvOFcw8
=GMgs
-----END PGP SIGNATURE-----


Home | Main Index | Thread Index | Old Index