diff options
Diffstat (limited to 'libc/sysdeps/linux/common')
| -rw-r--r-- | libc/sysdeps/linux/common/bits/errno.h | 2 | ||||
| -rw-r--r-- | libc/sysdeps/linux/common/bits/sched.h | 35 | ||||
| -rw-r--r-- | libc/sysdeps/linux/common/bits/siginfo.h | 33 |
3 files changed, 56 insertions, 14 deletions
diff --git a/libc/sysdeps/linux/common/bits/errno.h b/libc/sysdeps/linux/common/bits/errno.h index cb9c2ee43..d31dca8aa 100644 --- a/libc/sysdeps/linux/common/bits/errno.h +++ b/libc/sysdeps/linux/common/bits/errno.h @@ -37,7 +37,7 @@ extern int errno; /* Function to get address of global `errno' variable. */ extern int *__errno_location (void) __THROW __attribute__ ((__const__)); -# if defined _LIBC +# if defined _LIBC && !defined(__set_errno) /* We wouldn't need a special macro anymore but it is history. */ # define __set_errno(val) ((errno) = (val)) # endif /* _LIBC */ diff --git a/libc/sysdeps/linux/common/bits/sched.h b/libc/sysdeps/linux/common/bits/sched.h index 5c10d85d4..baf5b5a2b 100644 --- a/libc/sysdeps/linux/common/bits/sched.h +++ b/libc/sysdeps/linux/common/bits/sched.h @@ -71,3 +71,38 @@ struct __sched_param }; # undef __need_schedparam #endif + +#if defined _SCHED_H && !defined __cpu_set_t_defined +# define __cpu_set_t_defined +/* Size definition for CPU sets. */ +# define __CPU_SETSIZE 1024 +# define __NCPUBITS (8 * sizeof (__cpu_mask)) + +/* Type for array elements in 'cpu_set'. */ +typedef unsigned long int __cpu_mask; + +/* Basic access functions. */ +# define __CPUELT(cpu) ((cpu) / __NCPUBITS) +# define __CPUMASK(cpu) ((__cpu_mask) 1 << ((cpu) % __NCPUBITS)) + +/* Data structure to describe CPU mask. */ +typedef struct +{ + __cpu_mask __bits[__CPU_SETSIZE / __NCPUBITS]; +} cpu_set_t; + +/* Access functions for CPU masks. */ +# define __CPU_ZERO(cpusetp) \ + do { \ + unsigned int __i; \ + cpu_set *__arr = (cpusetp); \ + for (__i = 0; __i < sizeof (cpu_set) / sizeof (__cpu_mask); ++__i) \ + __arr->__bits[__i] = 0; \ + } while (0) +# define __CPU_SET(cpu, cpusetp) \ + ((cpusetp)->__bits[__CPUELT (cpu)] |= __CPUMASK (cpu)) +# define __CPU_CLR(cpu, cpusetp) \ + ((cpusetp)->__bits[__CPUELT (cpu)] &= ~__CPUMASK (cpu)) +# define __CPU_ISSET(cpu, cpusetp) \ + (((cpusetp)->__bits[__CPUELT (cpu)] & __CPUMASK (cpu)) != 0) +#endif diff --git a/libc/sysdeps/linux/common/bits/siginfo.h b/libc/sysdeps/linux/common/bits/siginfo.h index 70a8c217e..4ce319dc9 100644 --- a/libc/sysdeps/linux/common/bits/siginfo.h +++ b/libc/sysdeps/linux/common/bits/siginfo.h @@ -1,5 +1,5 @@ -/* siginfo_t, sigevent and constants. Linux/SPARC version. - Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. +/* siginfo_t, sigevent and constants. Linux version. + Copyright (C) 1997-2002, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -69,8 +69,9 @@ typedef struct siginfo /* POSIX.1b timers. */ struct { - unsigned int _timer1; - unsigned int _timer2; + int si_tid; /* Timer ID. */ + int si_overrun; /* Overrun count. */ + sigval_t si_sigval; /* Signal value. */ } _timer; /* POSIX.1b signals. */ @@ -110,8 +111,8 @@ typedef struct siginfo /* X/Open requires some more fields with fixed names. */ # define si_pid _sifields._kill.si_pid # define si_uid _sifields._kill.si_uid -# define si_timer1 _sifields._timer._timer1 -# define si_timer2 _sifields._timer._timer2 +# define si_timerid _sifields._timer.si_tid +# define si_overrun _sifields._timer.si_overrun # define si_status _sifields._sigchld.si_status # define si_utime _sifields._sigchld.si_utime # define si_stime _sifields._sigchld.si_stime @@ -127,8 +128,10 @@ typedef struct siginfo signals. */ enum { - SI_ASYNCNL = -6, /* Sent by asynch name lookup completion. */ + SI_ASYNCNL = -60, /* Sent by asynch name lookup completion. */ # define SI_ASYNCNL SI_ASYNCNL + SI_TKILL = -6, /* Sent by tkill. */ +# define SI_TKILL SI_TKILL SI_SIGIO, /* Sent by queued SIGIO. */ # define SI_SIGIO SI_SIGIO SI_ASYNCIO, /* Sent by AIO completion. */ @@ -267,9 +270,6 @@ enum # define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 3) # endif -/* Forward declaration of the `pthread_attr_t' type. */ -struct __pthread_attr_s; - typedef struct sigevent { sigval_t sigev_value; @@ -280,10 +280,14 @@ typedef struct sigevent { int _pad[__SIGEV_PAD_SIZE]; + /* When SIGEV_SIGNAL and SIGEV_THREAD_ID set, LWP ID of the + thread to receive the signal. */ + __pid_t _tid; + struct { - void (*_function) (sigval_t); /* Function to start. */ - struct __pthread_attr_s *_attribute; /* Really pthread_attr_t. */ + void (*_function) (sigval_t); /* Function to start. */ + void *_attribute; /* Really pthread_attr_t. */ } _sigev_thread; } _sigev_un; } sigevent_t; @@ -299,8 +303,11 @@ enum # define SIGEV_SIGNAL SIGEV_SIGNAL SIGEV_NONE, /* Other notification: meaningless. */ # define SIGEV_NONE SIGEV_NONE - SIGEV_THREAD /* Deliver via thread creation. */ + SIGEV_THREAD, /* Deliver via thread creation. */ # define SIGEV_THREAD SIGEV_THREAD + + SIGEV_THREAD_ID = 4 /* Send signal to specific thread. */ +#define SIGEV_THREAD_ID SIGEV_THREAD_ID }; #endif /* have _SIGNAL_H. */ |
