2000-02-18 03:39:52 +08:00
|
|
|
/* sys/signal.h */
|
|
|
|
|
|
|
|
#ifndef _SYS_SIGNAL_H
|
|
|
|
#define _SYS_SIGNAL_H
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "_ansi.h"
|
2015-06-22 16:49:29 +08:00
|
|
|
#include <sys/cdefs.h>
|
2000-12-11 Joel Sherrill <joel@OARcorp.com>
* Merge RTEMS specific .h files into main libc/include.
* libc/sys/rtems/include/signal.h: Removed.
* libc/sys/rtems/include/time.h: Removed.
* libc/sys/rtems/sys/features.h: Removed.
* libc/sys/rtems/sys/sched.h: Removed.
* libc/sys/rtems/sys/siginfo.h: Removed.
* libc/sys/rtems/sys/signal.h: Removed.
* libc/sys/rtems/sys/time.h: Removed.
* libc/sys/rtems/sys/times.h: Removed.
definitions for time_t and clock_t since these are
no longer in time.h.
* libc/include/pthread.h: New file.
* libc/include/sys/sched.h: New file.
* libc/include/sys/features.h: New file.
* libc/include/time.h: Removed duplicate definition of clock_t
and time_t, get them from <sys/types.h> instead. Add prototypes for POSIX clock and timer functionality.
* libc/sys/linux/sys/types.h: Changed to include
* libc/include/machine/types.h: Add _CLOCKID_T_ and _TIMER_T_.
* libc/include/sys/signal.h: Add more complete set of POSIX
signal functionality including real-time and threaded signals.
* libc/include/sys/types.h: Add clock_t, time_t, struct
timespec, and struct itimerspec. Centralizing these makes
things cleaner. RTEMS uses 64-bit dev_t.
Added numerous primitive definitions
for pthreads including macros, pthread_attr_t,
pthread_mutexattr_t, pthread_condattr_t, pthread_key_t,
pthread_once_t, and pthread_t.
* libc/include/sys/unistd.h: Added getlogin_r() prototype.
If RTEMS follow POSIX on read(), write() and sbrk() prototype.
Feature flags removed and moved to new file <sys/features.h>.
Full set of POSIX sysconf() constants
2000-12-12 09:24:09 +08:00
|
|
|
#include <sys/features.h>
|
2009-10-14 01:31:49 +08:00
|
|
|
#include <sys/types.h>
|
2015-12-14 17:06:18 +08:00
|
|
|
#include <sys/_sigset.h>
|
2015-03-11 22:38:54 +08:00
|
|
|
#include <sys/_timespec.h>
|
2021-07-31 21:22:05 +08:00
|
|
|
#include <stdint.h>
|
2000-12-11 Joel Sherrill <joel@OARcorp.com>
* Merge RTEMS specific .h files into main libc/include.
* libc/sys/rtems/include/signal.h: Removed.
* libc/sys/rtems/include/time.h: Removed.
* libc/sys/rtems/sys/features.h: Removed.
* libc/sys/rtems/sys/sched.h: Removed.
* libc/sys/rtems/sys/siginfo.h: Removed.
* libc/sys/rtems/sys/signal.h: Removed.
* libc/sys/rtems/sys/time.h: Removed.
* libc/sys/rtems/sys/times.h: Removed.
definitions for time_t and clock_t since these are
no longer in time.h.
* libc/include/pthread.h: New file.
* libc/include/sys/sched.h: New file.
* libc/include/sys/features.h: New file.
* libc/include/time.h: Removed duplicate definition of clock_t
and time_t, get them from <sys/types.h> instead. Add prototypes for POSIX clock and timer functionality.
* libc/sys/linux/sys/types.h: Changed to include
* libc/include/machine/types.h: Add _CLOCKID_T_ and _TIMER_T_.
* libc/include/sys/signal.h: Add more complete set of POSIX
signal functionality including real-time and threaded signals.
* libc/include/sys/types.h: Add clock_t, time_t, struct
timespec, and struct itimerspec. Centralizing these makes
things cleaner. RTEMS uses 64-bit dev_t.
Added numerous primitive definitions
for pthreads including macros, pthread_attr_t,
pthread_mutexattr_t, pthread_condattr_t, pthread_key_t,
pthread_once_t, and pthread_t.
* libc/include/sys/unistd.h: Added getlogin_r() prototype.
If RTEMS follow POSIX on read(), write() and sbrk() prototype.
Feature flags removed and moved to new file <sys/features.h>.
Full set of POSIX sysconf() constants
2000-12-12 09:24:09 +08:00
|
|
|
|
2015-12-14 17:06:18 +08:00
|
|
|
#if !defined(_SIGSET_T_DECLARED)
|
|
|
|
#define _SIGSET_T_DECLARED
|
|
|
|
typedef __sigset_t sigset_t;
|
2012-10-26 17:23:46 +08:00
|
|
|
#endif
|
2000-12-11 Joel Sherrill <joel@OARcorp.com>
* Merge RTEMS specific .h files into main libc/include.
* libc/sys/rtems/include/signal.h: Removed.
* libc/sys/rtems/include/time.h: Removed.
* libc/sys/rtems/sys/features.h: Removed.
* libc/sys/rtems/sys/sched.h: Removed.
* libc/sys/rtems/sys/siginfo.h: Removed.
* libc/sys/rtems/sys/signal.h: Removed.
* libc/sys/rtems/sys/time.h: Removed.
* libc/sys/rtems/sys/times.h: Removed.
definitions for time_t and clock_t since these are
no longer in time.h.
* libc/include/pthread.h: New file.
* libc/include/sys/sched.h: New file.
* libc/include/sys/features.h: New file.
* libc/include/time.h: Removed duplicate definition of clock_t
and time_t, get them from <sys/types.h> instead. Add prototypes for POSIX clock and timer functionality.
* libc/sys/linux/sys/types.h: Changed to include
* libc/include/machine/types.h: Add _CLOCKID_T_ and _TIMER_T_.
* libc/include/sys/signal.h: Add more complete set of POSIX
signal functionality including real-time and threaded signals.
* libc/include/sys/types.h: Add clock_t, time_t, struct
timespec, and struct itimerspec. Centralizing these makes
things cleaner. RTEMS uses 64-bit dev_t.
Added numerous primitive definitions
for pthreads including macros, pthread_attr_t,
pthread_mutexattr_t, pthread_condattr_t, pthread_key_t,
pthread_once_t, and pthread_t.
* libc/include/sys/unistd.h: Added getlogin_r() prototype.
If RTEMS follow POSIX on read(), write() and sbrk() prototype.
Feature flags removed and moved to new file <sys/features.h>.
Full set of POSIX sysconf() constants
2000-12-12 09:24:09 +08:00
|
|
|
|
2017-06-15 21:09:39 +08:00
|
|
|
#if defined(__CYGWIN__)
|
|
|
|
#include <cygwin/signal.h>
|
|
|
|
#else
|
2000-12-11 Joel Sherrill <joel@OARcorp.com>
* Merge RTEMS specific .h files into main libc/include.
* libc/sys/rtems/include/signal.h: Removed.
* libc/sys/rtems/include/time.h: Removed.
* libc/sys/rtems/sys/features.h: Removed.
* libc/sys/rtems/sys/sched.h: Removed.
* libc/sys/rtems/sys/siginfo.h: Removed.
* libc/sys/rtems/sys/signal.h: Removed.
* libc/sys/rtems/sys/time.h: Removed.
* libc/sys/rtems/sys/times.h: Removed.
definitions for time_t and clock_t since these are
no longer in time.h.
* libc/include/pthread.h: New file.
* libc/include/sys/sched.h: New file.
* libc/include/sys/features.h: New file.
* libc/include/time.h: Removed duplicate definition of clock_t
and time_t, get them from <sys/types.h> instead. Add prototypes for POSIX clock and timer functionality.
* libc/sys/linux/sys/types.h: Changed to include
* libc/include/machine/types.h: Add _CLOCKID_T_ and _TIMER_T_.
* libc/include/sys/signal.h: Add more complete set of POSIX
signal functionality including real-time and threaded signals.
* libc/include/sys/types.h: Add clock_t, time_t, struct
timespec, and struct itimerspec. Centralizing these makes
things cleaner. RTEMS uses 64-bit dev_t.
Added numerous primitive definitions
for pthreads including macros, pthread_attr_t,
pthread_mutexattr_t, pthread_condattr_t, pthread_key_t,
pthread_once_t, and pthread_t.
* libc/include/sys/unistd.h: Added getlogin_r() prototype.
If RTEMS follow POSIX on read(), write() and sbrk() prototype.
Feature flags removed and moved to new file <sys/features.h>.
Full set of POSIX sysconf() constants
2000-12-12 09:24:09 +08:00
|
|
|
|
2017-06-15 21:09:39 +08:00
|
|
|
#if defined(_POSIX_REALTIME_SIGNALS) || __POSIX_VISIBLE >= 199309
|
2000-12-11 Joel Sherrill <joel@OARcorp.com>
* Merge RTEMS specific .h files into main libc/include.
* libc/sys/rtems/include/signal.h: Removed.
* libc/sys/rtems/include/time.h: Removed.
* libc/sys/rtems/sys/features.h: Removed.
* libc/sys/rtems/sys/sched.h: Removed.
* libc/sys/rtems/sys/siginfo.h: Removed.
* libc/sys/rtems/sys/signal.h: Removed.
* libc/sys/rtems/sys/time.h: Removed.
* libc/sys/rtems/sys/times.h: Removed.
definitions for time_t and clock_t since these are
no longer in time.h.
* libc/include/pthread.h: New file.
* libc/include/sys/sched.h: New file.
* libc/include/sys/features.h: New file.
* libc/include/time.h: Removed duplicate definition of clock_t
and time_t, get them from <sys/types.h> instead. Add prototypes for POSIX clock and timer functionality.
* libc/sys/linux/sys/types.h: Changed to include
* libc/include/machine/types.h: Add _CLOCKID_T_ and _TIMER_T_.
* libc/include/sys/signal.h: Add more complete set of POSIX
signal functionality including real-time and threaded signals.
* libc/include/sys/types.h: Add clock_t, time_t, struct
timespec, and struct itimerspec. Centralizing these makes
things cleaner. RTEMS uses 64-bit dev_t.
Added numerous primitive definitions
for pthreads including macros, pthread_attr_t,
pthread_mutexattr_t, pthread_condattr_t, pthread_key_t,
pthread_once_t, and pthread_t.
* libc/include/sys/unistd.h: Added getlogin_r() prototype.
If RTEMS follow POSIX on read(), write() and sbrk() prototype.
Feature flags removed and moved to new file <sys/features.h>.
Full set of POSIX sysconf() constants
2000-12-12 09:24:09 +08:00
|
|
|
|
|
|
|
/* sigev_notify values
|
|
|
|
NOTE: P1003.1c/D10, p. 34 adds SIGEV_THREAD. */
|
|
|
|
|
|
|
|
#define SIGEV_NONE 1 /* No asynchronous notification shall be delivered */
|
|
|
|
/* when the event of interest occurs. */
|
|
|
|
#define SIGEV_SIGNAL 2 /* A queued signal, with an application defined */
|
|
|
|
/* value, shall be delivered when the event of */
|
|
|
|
/* interest occurs. */
|
|
|
|
#define SIGEV_THREAD 3 /* A notification function shall be called to */
|
|
|
|
/* perform notification. */
|
|
|
|
|
|
|
|
/* Signal Generation and Delivery, P1003.1b-1993, p. 63
|
|
|
|
NOTE: P1003.1c/D10, p. 34 adds sigev_notify_function and
|
|
|
|
sigev_notify_attributes to the sigevent structure. */
|
|
|
|
|
|
|
|
union sigval {
|
|
|
|
int sival_int; /* Integer signal value */
|
|
|
|
void *sival_ptr; /* Pointer signal value */
|
|
|
|
};
|
|
|
|
|
|
|
|
struct sigevent {
|
|
|
|
int sigev_notify; /* Notification type */
|
|
|
|
int sigev_signo; /* Signal number */
|
|
|
|
union sigval sigev_value; /* Signal value */
|
|
|
|
|
|
|
|
#if defined(_POSIX_THREADS)
|
|
|
|
void (*sigev_notify_function)( union sigval );
|
|
|
|
/* Notification function */
|
|
|
|
pthread_attr_t *sigev_notify_attributes; /* Notification Attributes */
|
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Signal Actions, P1003.1b-1993, p. 64 */
|
|
|
|
/* si_code values, p. 66 */
|
|
|
|
|
|
|
|
#define SI_USER 1 /* Sent by a user. kill(), abort(), etc */
|
|
|
|
#define SI_QUEUE 2 /* Sent by sigqueue() */
|
|
|
|
#define SI_TIMER 3 /* Sent by expiration of a timer_settime() timer */
|
|
|
|
#define SI_ASYNCIO 4 /* Indicates completion of asycnhronous IO */
|
|
|
|
#define SI_MESGQ 5 /* Indicates arrival of a message at an empty queue */
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
int si_signo; /* Signal number */
|
|
|
|
int si_code; /* Cause of the signal */
|
|
|
|
union sigval si_value; /* Signal value */
|
|
|
|
} siginfo_t;
|
2017-06-15 21:09:39 +08:00
|
|
|
#endif /* defined(_POSIX_REALTIME_SIGNALS) || __POSIX_VISIBLE >= 199309 */
|
|
|
|
|
|
|
|
#if defined(__rtems__)
|
2000-12-11 Joel Sherrill <joel@OARcorp.com>
* Merge RTEMS specific .h files into main libc/include.
* libc/sys/rtems/include/signal.h: Removed.
* libc/sys/rtems/include/time.h: Removed.
* libc/sys/rtems/sys/features.h: Removed.
* libc/sys/rtems/sys/sched.h: Removed.
* libc/sys/rtems/sys/siginfo.h: Removed.
* libc/sys/rtems/sys/signal.h: Removed.
* libc/sys/rtems/sys/time.h: Removed.
* libc/sys/rtems/sys/times.h: Removed.
definitions for time_t and clock_t since these are
no longer in time.h.
* libc/include/pthread.h: New file.
* libc/include/sys/sched.h: New file.
* libc/include/sys/features.h: New file.
* libc/include/time.h: Removed duplicate definition of clock_t
and time_t, get them from <sys/types.h> instead. Add prototypes for POSIX clock and timer functionality.
* libc/sys/linux/sys/types.h: Changed to include
* libc/include/machine/types.h: Add _CLOCKID_T_ and _TIMER_T_.
* libc/include/sys/signal.h: Add more complete set of POSIX
signal functionality including real-time and threaded signals.
* libc/include/sys/types.h: Add clock_t, time_t, struct
timespec, and struct itimerspec. Centralizing these makes
things cleaner. RTEMS uses 64-bit dev_t.
Added numerous primitive definitions
for pthreads including macros, pthread_attr_t,
pthread_mutexattr_t, pthread_condattr_t, pthread_key_t,
pthread_once_t, and pthread_t.
* libc/include/sys/unistd.h: Added getlogin_r() prototype.
If RTEMS follow POSIX on read(), write() and sbrk() prototype.
Feature flags removed and moved to new file <sys/features.h>.
Full set of POSIX sysconf() constants
2000-12-12 09:24:09 +08:00
|
|
|
|
|
|
|
/* 3.3.8 Synchronously Accept a Signal, P1003.1b-1993, p. 76 */
|
|
|
|
|
2014-08-18 22:03:35 +08:00
|
|
|
#define SA_NOCLDSTOP 0x1 /* Do not generate SIGCHLD when children stop */
|
|
|
|
#define SA_SIGINFO 0x2 /* Invoke the signal catching function with */
|
|
|
|
/* three arguments instead of one. */
|
2016-03-15 05:39:56 +08:00
|
|
|
#if __BSD_VISIBLE || __XSI_VISIBLE >= 4 || __POSIX_VISIBLE >= 200809
|
2014-08-18 22:03:35 +08:00
|
|
|
#define SA_ONSTACK 0x4 /* Signal delivery will be on a separate stack. */
|
|
|
|
#endif
|
2000-12-11 Joel Sherrill <joel@OARcorp.com>
* Merge RTEMS specific .h files into main libc/include.
* libc/sys/rtems/include/signal.h: Removed.
* libc/sys/rtems/include/time.h: Removed.
* libc/sys/rtems/sys/features.h: Removed.
* libc/sys/rtems/sys/sched.h: Removed.
* libc/sys/rtems/sys/siginfo.h: Removed.
* libc/sys/rtems/sys/signal.h: Removed.
* libc/sys/rtems/sys/time.h: Removed.
* libc/sys/rtems/sys/times.h: Removed.
definitions for time_t and clock_t since these are
no longer in time.h.
* libc/include/pthread.h: New file.
* libc/include/sys/sched.h: New file.
* libc/include/sys/features.h: New file.
* libc/include/time.h: Removed duplicate definition of clock_t
and time_t, get them from <sys/types.h> instead. Add prototypes for POSIX clock and timer functionality.
* libc/sys/linux/sys/types.h: Changed to include
* libc/include/machine/types.h: Add _CLOCKID_T_ and _TIMER_T_.
* libc/include/sys/signal.h: Add more complete set of POSIX
signal functionality including real-time and threaded signals.
* libc/include/sys/types.h: Add clock_t, time_t, struct
timespec, and struct itimerspec. Centralizing these makes
things cleaner. RTEMS uses 64-bit dev_t.
Added numerous primitive definitions
for pthreads including macros, pthread_attr_t,
pthread_mutexattr_t, pthread_condattr_t, pthread_key_t,
pthread_once_t, and pthread_t.
* libc/include/sys/unistd.h: Added getlogin_r() prototype.
If RTEMS follow POSIX on read(), write() and sbrk() prototype.
Feature flags removed and moved to new file <sys/features.h>.
Full set of POSIX sysconf() constants
2000-12-12 09:24:09 +08:00
|
|
|
|
|
|
|
/* struct sigaction notes from POSIX:
|
|
|
|
*
|
|
|
|
* (1) Routines stored in sa_handler should take a single int as
|
2003-11-29 05:05:51 +08:00
|
|
|
* their argument although the POSIX standard does not require this.
|
2011-04-19 16:02:59 +08:00
|
|
|
* This is not longer true since at least POSIX.1-2008
|
2000-12-11 Joel Sherrill <joel@OARcorp.com>
* Merge RTEMS specific .h files into main libc/include.
* libc/sys/rtems/include/signal.h: Removed.
* libc/sys/rtems/include/time.h: Removed.
* libc/sys/rtems/sys/features.h: Removed.
* libc/sys/rtems/sys/sched.h: Removed.
* libc/sys/rtems/sys/siginfo.h: Removed.
* libc/sys/rtems/sys/signal.h: Removed.
* libc/sys/rtems/sys/time.h: Removed.
* libc/sys/rtems/sys/times.h: Removed.
definitions for time_t and clock_t since these are
no longer in time.h.
* libc/include/pthread.h: New file.
* libc/include/sys/sched.h: New file.
* libc/include/sys/features.h: New file.
* libc/include/time.h: Removed duplicate definition of clock_t
and time_t, get them from <sys/types.h> instead. Add prototypes for POSIX clock and timer functionality.
* libc/sys/linux/sys/types.h: Changed to include
* libc/include/machine/types.h: Add _CLOCKID_T_ and _TIMER_T_.
* libc/include/sys/signal.h: Add more complete set of POSIX
signal functionality including real-time and threaded signals.
* libc/include/sys/types.h: Add clock_t, time_t, struct
timespec, and struct itimerspec. Centralizing these makes
things cleaner. RTEMS uses 64-bit dev_t.
Added numerous primitive definitions
for pthreads including macros, pthread_attr_t,
pthread_mutexattr_t, pthread_condattr_t, pthread_key_t,
pthread_once_t, and pthread_t.
* libc/include/sys/unistd.h: Added getlogin_r() prototype.
If RTEMS follow POSIX on read(), write() and sbrk() prototype.
Feature flags removed and moved to new file <sys/features.h>.
Full set of POSIX sysconf() constants
2000-12-12 09:24:09 +08:00
|
|
|
* (2) The fields sa_handler and sa_sigaction may overlap, and a conforming
|
|
|
|
* application should not use both simultaneously.
|
|
|
|
*/
|
|
|
|
|
2011-04-19 16:02:59 +08:00
|
|
|
typedef void (*_sig_func_ptr)(int);
|
2002-07-25 02:18:07 +08:00
|
|
|
|
2000-12-11 Joel Sherrill <joel@OARcorp.com>
* Merge RTEMS specific .h files into main libc/include.
* libc/sys/rtems/include/signal.h: Removed.
* libc/sys/rtems/include/time.h: Removed.
* libc/sys/rtems/sys/features.h: Removed.
* libc/sys/rtems/sys/sched.h: Removed.
* libc/sys/rtems/sys/siginfo.h: Removed.
* libc/sys/rtems/sys/signal.h: Removed.
* libc/sys/rtems/sys/time.h: Removed.
* libc/sys/rtems/sys/times.h: Removed.
definitions for time_t and clock_t since these are
no longer in time.h.
* libc/include/pthread.h: New file.
* libc/include/sys/sched.h: New file.
* libc/include/sys/features.h: New file.
* libc/include/time.h: Removed duplicate definition of clock_t
and time_t, get them from <sys/types.h> instead. Add prototypes for POSIX clock and timer functionality.
* libc/sys/linux/sys/types.h: Changed to include
* libc/include/machine/types.h: Add _CLOCKID_T_ and _TIMER_T_.
* libc/include/sys/signal.h: Add more complete set of POSIX
signal functionality including real-time and threaded signals.
* libc/include/sys/types.h: Add clock_t, time_t, struct
timespec, and struct itimerspec. Centralizing these makes
things cleaner. RTEMS uses 64-bit dev_t.
Added numerous primitive definitions
for pthreads including macros, pthread_attr_t,
pthread_mutexattr_t, pthread_condattr_t, pthread_key_t,
pthread_once_t, and pthread_t.
* libc/include/sys/unistd.h: Added getlogin_r() prototype.
If RTEMS follow POSIX on read(), write() and sbrk() prototype.
Feature flags removed and moved to new file <sys/features.h>.
Full set of POSIX sysconf() constants
2000-12-12 09:24:09 +08:00
|
|
|
struct sigaction {
|
|
|
|
int sa_flags; /* Special flags to affect behavior of signal */
|
|
|
|
sigset_t sa_mask; /* Additional set of signals to be blocked */
|
|
|
|
/* during execution of signal-catching */
|
|
|
|
/* function. */
|
|
|
|
union {
|
2002-07-25 02:18:07 +08:00
|
|
|
_sig_func_ptr _handler; /* SIG_DFL, SIG_IGN, or pointer to a function */
|
2000-12-11 Joel Sherrill <joel@OARcorp.com>
* Merge RTEMS specific .h files into main libc/include.
* libc/sys/rtems/include/signal.h: Removed.
* libc/sys/rtems/include/time.h: Removed.
* libc/sys/rtems/sys/features.h: Removed.
* libc/sys/rtems/sys/sched.h: Removed.
* libc/sys/rtems/sys/siginfo.h: Removed.
* libc/sys/rtems/sys/signal.h: Removed.
* libc/sys/rtems/sys/time.h: Removed.
* libc/sys/rtems/sys/times.h: Removed.
definitions for time_t and clock_t since these are
no longer in time.h.
* libc/include/pthread.h: New file.
* libc/include/sys/sched.h: New file.
* libc/include/sys/features.h: New file.
* libc/include/time.h: Removed duplicate definition of clock_t
and time_t, get them from <sys/types.h> instead. Add prototypes for POSIX clock and timer functionality.
* libc/sys/linux/sys/types.h: Changed to include
* libc/include/machine/types.h: Add _CLOCKID_T_ and _TIMER_T_.
* libc/include/sys/signal.h: Add more complete set of POSIX
signal functionality including real-time and threaded signals.
* libc/include/sys/types.h: Add clock_t, time_t, struct
timespec, and struct itimerspec. Centralizing these makes
things cleaner. RTEMS uses 64-bit dev_t.
Added numerous primitive definitions
for pthreads including macros, pthread_attr_t,
pthread_mutexattr_t, pthread_condattr_t, pthread_key_t,
pthread_once_t, and pthread_t.
* libc/include/sys/unistd.h: Added getlogin_r() prototype.
If RTEMS follow POSIX on read(), write() and sbrk() prototype.
Feature flags removed and moved to new file <sys/features.h>.
Full set of POSIX sysconf() constants
2000-12-12 09:24:09 +08:00
|
|
|
#if defined(_POSIX_REALTIME_SIGNALS)
|
|
|
|
void (*_sigaction)( int, siginfo_t *, void * );
|
|
|
|
#endif
|
|
|
|
} _signal_handlers;
|
|
|
|
};
|
|
|
|
|
|
|
|
#define sa_handler _signal_handlers._handler
|
|
|
|
#if defined(_POSIX_REALTIME_SIGNALS)
|
|
|
|
#define sa_sigaction _signal_handlers._sigaction
|
|
|
|
#endif
|
|
|
|
|
2017-06-15 21:09:39 +08:00
|
|
|
#else /* defined(__rtems__) */
|
|
|
|
|
2003-11-29 05:05:51 +08:00
|
|
|
#define SA_NOCLDSTOP 1 /* only value supported now for sa_flags */
|
2000-12-11 Joel Sherrill <joel@OARcorp.com>
* Merge RTEMS specific .h files into main libc/include.
* libc/sys/rtems/include/signal.h: Removed.
* libc/sys/rtems/include/time.h: Removed.
* libc/sys/rtems/sys/features.h: Removed.
* libc/sys/rtems/sys/sched.h: Removed.
* libc/sys/rtems/sys/siginfo.h: Removed.
* libc/sys/rtems/sys/signal.h: Removed.
* libc/sys/rtems/sys/time.h: Removed.
* libc/sys/rtems/sys/times.h: Removed.
definitions for time_t and clock_t since these are
no longer in time.h.
* libc/include/pthread.h: New file.
* libc/include/sys/sched.h: New file.
* libc/include/sys/features.h: New file.
* libc/include/time.h: Removed duplicate definition of clock_t
and time_t, get them from <sys/types.h> instead. Add prototypes for POSIX clock and timer functionality.
* libc/sys/linux/sys/types.h: Changed to include
* libc/include/machine/types.h: Add _CLOCKID_T_ and _TIMER_T_.
* libc/include/sys/signal.h: Add more complete set of POSIX
signal functionality including real-time and threaded signals.
* libc/include/sys/types.h: Add clock_t, time_t, struct
timespec, and struct itimerspec. Centralizing these makes
things cleaner. RTEMS uses 64-bit dev_t.
Added numerous primitive definitions
for pthreads including macros, pthread_attr_t,
pthread_mutexattr_t, pthread_condattr_t, pthread_key_t,
pthread_once_t, and pthread_t.
* libc/include/sys/unistd.h: Added getlogin_r() prototype.
If RTEMS follow POSIX on read(), write() and sbrk() prototype.
Feature flags removed and moved to new file <sys/features.h>.
Full set of POSIX sysconf() constants
2000-12-12 09:24:09 +08:00
|
|
|
|
2002-07-25 02:18:07 +08:00
|
|
|
typedef void (*_sig_func_ptr)(int);
|
|
|
|
|
2000-02-18 03:39:52 +08:00
|
|
|
struct sigaction
|
|
|
|
{
|
2002-07-25 02:18:07 +08:00
|
|
|
_sig_func_ptr sa_handler;
|
2000-02-18 03:39:52 +08:00
|
|
|
sigset_t sa_mask;
|
|
|
|
int sa_flags;
|
|
|
|
};
|
2000-12-11 Joel Sherrill <joel@OARcorp.com>
* Merge RTEMS specific .h files into main libc/include.
* libc/sys/rtems/include/signal.h: Removed.
* libc/sys/rtems/include/time.h: Removed.
* libc/sys/rtems/sys/features.h: Removed.
* libc/sys/rtems/sys/sched.h: Removed.
* libc/sys/rtems/sys/siginfo.h: Removed.
* libc/sys/rtems/sys/signal.h: Removed.
* libc/sys/rtems/sys/time.h: Removed.
* libc/sys/rtems/sys/times.h: Removed.
definitions for time_t and clock_t since these are
no longer in time.h.
* libc/include/pthread.h: New file.
* libc/include/sys/sched.h: New file.
* libc/include/sys/features.h: New file.
* libc/include/time.h: Removed duplicate definition of clock_t
and time_t, get them from <sys/types.h> instead. Add prototypes for POSIX clock and timer functionality.
* libc/sys/linux/sys/types.h: Changed to include
* libc/include/machine/types.h: Add _CLOCKID_T_ and _TIMER_T_.
* libc/include/sys/signal.h: Add more complete set of POSIX
signal functionality including real-time and threaded signals.
* libc/include/sys/types.h: Add clock_t, time_t, struct
timespec, and struct itimerspec. Centralizing these makes
things cleaner. RTEMS uses 64-bit dev_t.
Added numerous primitive definitions
for pthreads including macros, pthread_attr_t,
pthread_mutexattr_t, pthread_condattr_t, pthread_key_t,
pthread_once_t, and pthread_t.
* libc/include/sys/unistd.h: Added getlogin_r() prototype.
If RTEMS follow POSIX on read(), write() and sbrk() prototype.
Feature flags removed and moved to new file <sys/features.h>.
Full set of POSIX sysconf() constants
2000-12-12 09:24:09 +08:00
|
|
|
#endif /* defined(__rtems__) */
|
2017-06-15 21:09:39 +08:00
|
|
|
#endif /* defined(__CYGWIN__) */
|
2000-12-11 Joel Sherrill <joel@OARcorp.com>
* Merge RTEMS specific .h files into main libc/include.
* libc/sys/rtems/include/signal.h: Removed.
* libc/sys/rtems/include/time.h: Removed.
* libc/sys/rtems/sys/features.h: Removed.
* libc/sys/rtems/sys/sched.h: Removed.
* libc/sys/rtems/sys/siginfo.h: Removed.
* libc/sys/rtems/sys/signal.h: Removed.
* libc/sys/rtems/sys/time.h: Removed.
* libc/sys/rtems/sys/times.h: Removed.
definitions for time_t and clock_t since these are
no longer in time.h.
* libc/include/pthread.h: New file.
* libc/include/sys/sched.h: New file.
* libc/include/sys/features.h: New file.
* libc/include/time.h: Removed duplicate definition of clock_t
and time_t, get them from <sys/types.h> instead. Add prototypes for POSIX clock and timer functionality.
* libc/sys/linux/sys/types.h: Changed to include
* libc/include/machine/types.h: Add _CLOCKID_T_ and _TIMER_T_.
* libc/include/sys/signal.h: Add more complete set of POSIX
signal functionality including real-time and threaded signals.
* libc/include/sys/types.h: Add clock_t, time_t, struct
timespec, and struct itimerspec. Centralizing these makes
things cleaner. RTEMS uses 64-bit dev_t.
Added numerous primitive definitions
for pthreads including macros, pthread_attr_t,
pthread_mutexattr_t, pthread_condattr_t, pthread_key_t,
pthread_once_t, and pthread_t.
* libc/include/sys/unistd.h: Added getlogin_r() prototype.
If RTEMS follow POSIX on read(), write() and sbrk() prototype.
Feature flags removed and moved to new file <sys/features.h>.
Full set of POSIX sysconf() constants
2000-12-12 09:24:09 +08:00
|
|
|
|
2016-03-15 05:39:56 +08:00
|
|
|
#if __BSD_VISIBLE || __XSI_VISIBLE >= 4 || __POSIX_VISIBLE >= 200809
|
2015-06-21 01:05:51 +08:00
|
|
|
/*
|
|
|
|
* Minimum and default signal stack constants. Allow for target overrides
|
|
|
|
* from <sys/features.h>.
|
|
|
|
*/
|
|
|
|
#ifndef MINSIGSTKSZ
|
|
|
|
#define MINSIGSTKSZ 2048
|
|
|
|
#endif
|
|
|
|
#ifndef SIGSTKSZ
|
|
|
|
#define SIGSTKSZ 8192
|
|
|
|
#endif
|
|
|
|
|
2015-06-19 21:58:23 +08:00
|
|
|
/*
|
|
|
|
* Possible values for ss_flags in stack_t below.
|
|
|
|
*/
|
|
|
|
#define SS_ONSTACK 0x1
|
|
|
|
#define SS_DISABLE 0x2
|
|
|
|
|
2015-06-21 01:05:51 +08:00
|
|
|
#endif
|
|
|
|
|
2015-04-01 07:12:07 +08:00
|
|
|
/*
|
|
|
|
* Structure used in sigaltstack call.
|
|
|
|
*/
|
|
|
|
typedef struct sigaltstack {
|
|
|
|
void *ss_sp; /* Stack base or pointer. */
|
|
|
|
int ss_flags; /* Flags. */
|
|
|
|
size_t ss_size; /* Stack size. */
|
|
|
|
} stack_t;
|
|
|
|
|
2017-06-14 03:56:02 +08:00
|
|
|
#if __POSIX_VISIBLE
|
2000-02-18 03:39:52 +08:00
|
|
|
#define SIG_SETMASK 0 /* set mask with sigprocmask() */
|
|
|
|
#define SIG_BLOCK 1 /* set of signals to block */
|
|
|
|
#define SIG_UNBLOCK 2 /* set of signals to, well, unblock */
|
|
|
|
|
2018-08-29 22:37:13 +08:00
|
|
|
int sigprocmask (int, const sigset_t *, sigset_t *);
|
2017-06-14 03:56:02 +08:00
|
|
|
#endif
|
2000-12-11 Joel Sherrill <joel@OARcorp.com>
* Merge RTEMS specific .h files into main libc/include.
* libc/sys/rtems/include/signal.h: Removed.
* libc/sys/rtems/include/time.h: Removed.
* libc/sys/rtems/sys/features.h: Removed.
* libc/sys/rtems/sys/sched.h: Removed.
* libc/sys/rtems/sys/siginfo.h: Removed.
* libc/sys/rtems/sys/signal.h: Removed.
* libc/sys/rtems/sys/time.h: Removed.
* libc/sys/rtems/sys/times.h: Removed.
definitions for time_t and clock_t since these are
no longer in time.h.
* libc/include/pthread.h: New file.
* libc/include/sys/sched.h: New file.
* libc/include/sys/features.h: New file.
* libc/include/time.h: Removed duplicate definition of clock_t
and time_t, get them from <sys/types.h> instead. Add prototypes for POSIX clock and timer functionality.
* libc/sys/linux/sys/types.h: Changed to include
* libc/include/machine/types.h: Add _CLOCKID_T_ and _TIMER_T_.
* libc/include/sys/signal.h: Add more complete set of POSIX
signal functionality including real-time and threaded signals.
* libc/include/sys/types.h: Add clock_t, time_t, struct
timespec, and struct itimerspec. Centralizing these makes
things cleaner. RTEMS uses 64-bit dev_t.
Added numerous primitive definitions
for pthreads including macros, pthread_attr_t,
pthread_mutexattr_t, pthread_condattr_t, pthread_key_t,
pthread_once_t, and pthread_t.
* libc/include/sys/unistd.h: Added getlogin_r() prototype.
If RTEMS follow POSIX on read(), write() and sbrk() prototype.
Feature flags removed and moved to new file <sys/features.h>.
Full set of POSIX sysconf() constants
2000-12-12 09:24:09 +08:00
|
|
|
|
2017-06-14 03:56:02 +08:00
|
|
|
#if __POSIX_VISIBLE >= 199506
|
2018-08-29 22:37:13 +08:00
|
|
|
int pthread_sigmask (int, const sigset_t *, sigset_t *);
|
2000-12-11 Joel Sherrill <joel@OARcorp.com>
* Merge RTEMS specific .h files into main libc/include.
* libc/sys/rtems/include/signal.h: Removed.
* libc/sys/rtems/include/time.h: Removed.
* libc/sys/rtems/sys/features.h: Removed.
* libc/sys/rtems/sys/sched.h: Removed.
* libc/sys/rtems/sys/siginfo.h: Removed.
* libc/sys/rtems/sys/signal.h: Removed.
* libc/sys/rtems/sys/time.h: Removed.
* libc/sys/rtems/sys/times.h: Removed.
definitions for time_t and clock_t since these are
no longer in time.h.
* libc/include/pthread.h: New file.
* libc/include/sys/sched.h: New file.
* libc/include/sys/features.h: New file.
* libc/include/time.h: Removed duplicate definition of clock_t
and time_t, get them from <sys/types.h> instead. Add prototypes for POSIX clock and timer functionality.
* libc/sys/linux/sys/types.h: Changed to include
* libc/include/machine/types.h: Add _CLOCKID_T_ and _TIMER_T_.
* libc/include/sys/signal.h: Add more complete set of POSIX
signal functionality including real-time and threaded signals.
* libc/include/sys/types.h: Add clock_t, time_t, struct
timespec, and struct itimerspec. Centralizing these makes
things cleaner. RTEMS uses 64-bit dev_t.
Added numerous primitive definitions
for pthreads including macros, pthread_attr_t,
pthread_mutexattr_t, pthread_condattr_t, pthread_key_t,
pthread_once_t, and pthread_t.
* libc/include/sys/unistd.h: Added getlogin_r() prototype.
If RTEMS follow POSIX on read(), write() and sbrk() prototype.
Feature flags removed and moved to new file <sys/features.h>.
Full set of POSIX sysconf() constants
2000-12-12 09:24:09 +08:00
|
|
|
#endif
|
2000-02-18 03:39:52 +08:00
|
|
|
|
2021-11-09 11:22:27 +08:00
|
|
|
#ifdef _LIBC
|
2017-12-04 13:54:48 +08:00
|
|
|
int _kill (pid_t, int);
|
2021-11-09 11:22:27 +08:00
|
|
|
#endif /* _LIBC */
|
Always declare "kill" in include/sys/signal.h
Hi,
As I mentioned recently [1], newlib is providing a "kill" symbol to link
against, without declaring "kill" in signal.h. This is confusing for the
libgfortran build, which tries to link against kill (which succeeds), then
tries to use it (which triggers -Werror=implicit-function-declaration).
This patch implements my suggestion in that thread - making the declaration
of 'kill' in libc/include/sys/signal.h unconditional.
I've tested this by building a modified libgfortran on AArch64/ARM to see
that the Werror goes away, and the libgfortran build succeeds.
Is something like this OK for newlib? If so, can someone please commit
it on my behalf, as I have no commit access here.
Otherwise, what is your preferred direction for me to take this patch?
Thanks,
James
2015-08-25 21:31:11 +08:00
|
|
|
|
2017-06-14 03:56:02 +08:00
|
|
|
#if __POSIX_VISIBLE
|
2017-12-04 13:54:48 +08:00
|
|
|
int kill (pid_t, int);
|
2017-06-14 03:56:02 +08:00
|
|
|
#endif
|
Always declare "kill" in include/sys/signal.h
Hi,
As I mentioned recently [1], newlib is providing a "kill" symbol to link
against, without declaring "kill" in signal.h. This is confusing for the
libgfortran build, which tries to link against kill (which succeeds), then
tries to use it (which triggers -Werror=implicit-function-declaration).
This patch implements my suggestion in that thread - making the declaration
of 'kill' in libc/include/sys/signal.h unconditional.
I've tested this by building a modified libgfortran on AArch64/ARM to see
that the Werror goes away, and the libgfortran build succeeds.
Is something like this OK for newlib? If so, can someone please commit
it on my behalf, as I have no commit access here.
Otherwise, what is your preferred direction for me to take this patch?
Thanks,
James
2015-08-25 21:31:11 +08:00
|
|
|
|
2016-03-15 05:39:56 +08:00
|
|
|
#if __BSD_VISIBLE || __XSI_VISIBLE >= 4
|
2017-12-04 13:54:48 +08:00
|
|
|
int killpg (pid_t, int);
|
2017-06-14 03:56:02 +08:00
|
|
|
#endif
|
|
|
|
#if __POSIX_VISIBLE
|
2017-12-04 13:54:48 +08:00
|
|
|
int sigaction (int, const struct sigaction *, struct sigaction *);
|
|
|
|
int sigaddset (sigset_t *, const int);
|
|
|
|
int sigdelset (sigset_t *, const int);
|
|
|
|
int sigismember (const sigset_t *, int);
|
|
|
|
int sigfillset (sigset_t *);
|
|
|
|
int sigemptyset (sigset_t *);
|
|
|
|
int sigpending (sigset_t *);
|
|
|
|
int sigsuspend (const sigset_t *);
|
2018-08-29 22:37:13 +08:00
|
|
|
int sigwait (const sigset_t *, int *);
|
2016-03-18 12:21:49 +08:00
|
|
|
|
|
|
|
#if !defined(__CYGWIN__) && !defined(__rtems__)
|
|
|
|
/* These depend upon the type of sigset_t, which right now
|
|
|
|
is always a long.. They're in the POSIX namespace, but
|
|
|
|
are not ANSI. */
|
|
|
|
#define sigaddset(what,sig) (*(what) |= (1<<(sig)), 0)
|
|
|
|
#define sigdelset(what,sig) (*(what) &= ~(1<<(sig)), 0)
|
|
|
|
#define sigemptyset(what) (*(what) = 0, 0)
|
|
|
|
#define sigfillset(what) (*(what) = ~(0), 0)
|
|
|
|
#define sigismember(what,sig) (((*(what)) & (1<<(sig))) != 0)
|
|
|
|
#endif /* !__CYGWIN__ && !__rtems__ */
|
2017-06-14 03:56:02 +08:00
|
|
|
#endif /* __POSIX_VISIBLE */
|
|
|
|
|
2017-06-14 23:20:05 +08:00
|
|
|
/* There are two common sigpause variants, both of which take an int argument.
|
|
|
|
If you request _XOPEN_SOURCE or _GNU_SOURCE, you get the System V version,
|
|
|
|
which removes the given signal from the process's signal mask; otherwise
|
|
|
|
you get the BSD version, which sets the process's signal mask to the given
|
|
|
|
value. */
|
|
|
|
#if __XSI_VISIBLE && !defined(__INSIDE_CYGWIN__)
|
|
|
|
# ifdef __GNUC__
|
2017-12-04 13:54:48 +08:00
|
|
|
int sigpause (int) __asm__ (__ASMNAME ("__xpg_sigpause"));
|
2017-06-14 23:20:05 +08:00
|
|
|
# else
|
2017-12-04 13:54:48 +08:00
|
|
|
int __xpg_sigpause (int);
|
2017-06-14 23:20:05 +08:00
|
|
|
# define sigpause __xpg_sigpause
|
|
|
|
# endif
|
|
|
|
#elif __BSD_VISIBLE
|
2017-12-04 13:54:48 +08:00
|
|
|
int sigpause (int);
|
2017-06-14 03:56:02 +08:00
|
|
|
#endif
|
2000-12-11 Joel Sherrill <joel@OARcorp.com>
* Merge RTEMS specific .h files into main libc/include.
* libc/sys/rtems/include/signal.h: Removed.
* libc/sys/rtems/include/time.h: Removed.
* libc/sys/rtems/sys/features.h: Removed.
* libc/sys/rtems/sys/sched.h: Removed.
* libc/sys/rtems/sys/siginfo.h: Removed.
* libc/sys/rtems/sys/signal.h: Removed.
* libc/sys/rtems/sys/time.h: Removed.
* libc/sys/rtems/sys/times.h: Removed.
definitions for time_t and clock_t since these are
no longer in time.h.
* libc/include/pthread.h: New file.
* libc/include/sys/sched.h: New file.
* libc/include/sys/features.h: New file.
* libc/include/time.h: Removed duplicate definition of clock_t
and time_t, get them from <sys/types.h> instead. Add prototypes for POSIX clock and timer functionality.
* libc/sys/linux/sys/types.h: Changed to include
* libc/include/machine/types.h: Add _CLOCKID_T_ and _TIMER_T_.
* libc/include/sys/signal.h: Add more complete set of POSIX
signal functionality including real-time and threaded signals.
* libc/include/sys/types.h: Add clock_t, time_t, struct
timespec, and struct itimerspec. Centralizing these makes
things cleaner. RTEMS uses 64-bit dev_t.
Added numerous primitive definitions
for pthreads including macros, pthread_attr_t,
pthread_mutexattr_t, pthread_condattr_t, pthread_key_t,
pthread_once_t, and pthread_t.
* libc/include/sys/unistd.h: Added getlogin_r() prototype.
If RTEMS follow POSIX on read(), write() and sbrk() prototype.
Feature flags removed and moved to new file <sys/features.h>.
Full set of POSIX sysconf() constants
2000-12-12 09:24:09 +08:00
|
|
|
|
2016-03-15 05:39:56 +08:00
|
|
|
#if __BSD_VISIBLE || __XSI_VISIBLE >= 4 || __POSIX_VISIBLE >= 200809
|
2017-12-04 13:54:48 +08:00
|
|
|
int sigaltstack (const stack_t *__restrict, stack_t *__restrict);
|
2014-08-18 22:03:35 +08:00
|
|
|
#endif
|
|
|
|
|
2017-06-14 03:56:02 +08:00
|
|
|
#if __POSIX_VISIBLE >= 199506
|
2018-08-29 22:37:13 +08:00
|
|
|
int pthread_kill (pthread_t, int);
|
2000-02-18 03:39:52 +08:00
|
|
|
#endif
|
|
|
|
|
2017-06-14 03:56:02 +08:00
|
|
|
#if __POSIX_VISIBLE >= 199309
|
2000-12-11 Joel Sherrill <joel@OARcorp.com>
* Merge RTEMS specific .h files into main libc/include.
* libc/sys/rtems/include/signal.h: Removed.
* libc/sys/rtems/include/time.h: Removed.
* libc/sys/rtems/sys/features.h: Removed.
* libc/sys/rtems/sys/sched.h: Removed.
* libc/sys/rtems/sys/siginfo.h: Removed.
* libc/sys/rtems/sys/signal.h: Removed.
* libc/sys/rtems/sys/time.h: Removed.
* libc/sys/rtems/sys/times.h: Removed.
definitions for time_t and clock_t since these are
no longer in time.h.
* libc/include/pthread.h: New file.
* libc/include/sys/sched.h: New file.
* libc/include/sys/features.h: New file.
* libc/include/time.h: Removed duplicate definition of clock_t
and time_t, get them from <sys/types.h> instead. Add prototypes for POSIX clock and timer functionality.
* libc/sys/linux/sys/types.h: Changed to include
* libc/include/machine/types.h: Add _CLOCKID_T_ and _TIMER_T_.
* libc/include/sys/signal.h: Add more complete set of POSIX
signal functionality including real-time and threaded signals.
* libc/include/sys/types.h: Add clock_t, time_t, struct
timespec, and struct itimerspec. Centralizing these makes
things cleaner. RTEMS uses 64-bit dev_t.
Added numerous primitive definitions
for pthreads including macros, pthread_attr_t,
pthread_mutexattr_t, pthread_condattr_t, pthread_key_t,
pthread_once_t, and pthread_t.
* libc/include/sys/unistd.h: Added getlogin_r() prototype.
If RTEMS follow POSIX on read(), write() and sbrk() prototype.
Feature flags removed and moved to new file <sys/features.h>.
Full set of POSIX sysconf() constants
2000-12-12 09:24:09 +08:00
|
|
|
|
|
|
|
/* 3.3.8 Synchronously Accept a Signal, P1003.1b-1993, p. 76
|
|
|
|
NOTE: P1003.1c/D10, p. 39 adds sigwait(). */
|
|
|
|
|
2018-08-29 22:37:13 +08:00
|
|
|
int sigwaitinfo (const sigset_t *, siginfo_t *);
|
|
|
|
int sigtimedwait (const sigset_t *, siginfo_t *, const struct timespec *);
|
2000-12-11 Joel Sherrill <joel@OARcorp.com>
* Merge RTEMS specific .h files into main libc/include.
* libc/sys/rtems/include/signal.h: Removed.
* libc/sys/rtems/include/time.h: Removed.
* libc/sys/rtems/sys/features.h: Removed.
* libc/sys/rtems/sys/sched.h: Removed.
* libc/sys/rtems/sys/siginfo.h: Removed.
* libc/sys/rtems/sys/signal.h: Removed.
* libc/sys/rtems/sys/time.h: Removed.
* libc/sys/rtems/sys/times.h: Removed.
definitions for time_t and clock_t since these are
no longer in time.h.
* libc/include/pthread.h: New file.
* libc/include/sys/sched.h: New file.
* libc/include/sys/features.h: New file.
* libc/include/time.h: Removed duplicate definition of clock_t
and time_t, get them from <sys/types.h> instead. Add prototypes for POSIX clock and timer functionality.
* libc/sys/linux/sys/types.h: Changed to include
* libc/include/machine/types.h: Add _CLOCKID_T_ and _TIMER_T_.
* libc/include/sys/signal.h: Add more complete set of POSIX
signal functionality including real-time and threaded signals.
* libc/include/sys/types.h: Add clock_t, time_t, struct
timespec, and struct itimerspec. Centralizing these makes
things cleaner. RTEMS uses 64-bit dev_t.
Added numerous primitive definitions
for pthreads including macros, pthread_attr_t,
pthread_mutexattr_t, pthread_condattr_t, pthread_key_t,
pthread_once_t, and pthread_t.
* libc/include/sys/unistd.h: Added getlogin_r() prototype.
If RTEMS follow POSIX on read(), write() and sbrk() prototype.
Feature flags removed and moved to new file <sys/features.h>.
Full set of POSIX sysconf() constants
2000-12-12 09:24:09 +08:00
|
|
|
/* 3.3.9 Queue a Signal to a Process, P1003.1b-1993, p. 78 */
|
2018-08-29 22:37:13 +08:00
|
|
|
int sigqueue (pid_t, int, const union sigval);
|
2000-12-11 Joel Sherrill <joel@OARcorp.com>
* Merge RTEMS specific .h files into main libc/include.
* libc/sys/rtems/include/signal.h: Removed.
* libc/sys/rtems/include/time.h: Removed.
* libc/sys/rtems/sys/features.h: Removed.
* libc/sys/rtems/sys/sched.h: Removed.
* libc/sys/rtems/sys/siginfo.h: Removed.
* libc/sys/rtems/sys/signal.h: Removed.
* libc/sys/rtems/sys/time.h: Removed.
* libc/sys/rtems/sys/times.h: Removed.
definitions for time_t and clock_t since these are
no longer in time.h.
* libc/include/pthread.h: New file.
* libc/include/sys/sched.h: New file.
* libc/include/sys/features.h: New file.
* libc/include/time.h: Removed duplicate definition of clock_t
and time_t, get them from <sys/types.h> instead. Add prototypes for POSIX clock and timer functionality.
* libc/sys/linux/sys/types.h: Changed to include
* libc/include/machine/types.h: Add _CLOCKID_T_ and _TIMER_T_.
* libc/include/sys/signal.h: Add more complete set of POSIX
signal functionality including real-time and threaded signals.
* libc/include/sys/types.h: Add clock_t, time_t, struct
timespec, and struct itimerspec. Centralizing these makes
things cleaner. RTEMS uses 64-bit dev_t.
Added numerous primitive definitions
for pthreads including macros, pthread_attr_t,
pthread_mutexattr_t, pthread_condattr_t, pthread_key_t,
pthread_once_t, and pthread_t.
* libc/include/sys/unistd.h: Added getlogin_r() prototype.
If RTEMS follow POSIX on read(), write() and sbrk() prototype.
Feature flags removed and moved to new file <sys/features.h>.
Full set of POSIX sysconf() constants
2000-12-12 09:24:09 +08:00
|
|
|
|
2017-06-14 03:56:02 +08:00
|
|
|
#endif /* __POSIX_VISIBLE >= 199309 */
|
2000-12-11 Joel Sherrill <joel@OARcorp.com>
* Merge RTEMS specific .h files into main libc/include.
* libc/sys/rtems/include/signal.h: Removed.
* libc/sys/rtems/include/time.h: Removed.
* libc/sys/rtems/sys/features.h: Removed.
* libc/sys/rtems/sys/sched.h: Removed.
* libc/sys/rtems/sys/siginfo.h: Removed.
* libc/sys/rtems/sys/signal.h: Removed.
* libc/sys/rtems/sys/time.h: Removed.
* libc/sys/rtems/sys/times.h: Removed.
definitions for time_t and clock_t since these are
no longer in time.h.
* libc/include/pthread.h: New file.
* libc/include/sys/sched.h: New file.
* libc/include/sys/features.h: New file.
* libc/include/time.h: Removed duplicate definition of clock_t
and time_t, get them from <sys/types.h> instead. Add prototypes for POSIX clock and timer functionality.
* libc/sys/linux/sys/types.h: Changed to include
* libc/include/machine/types.h: Add _CLOCKID_T_ and _TIMER_T_.
* libc/include/sys/signal.h: Add more complete set of POSIX
signal functionality including real-time and threaded signals.
* libc/include/sys/types.h: Add clock_t, time_t, struct
timespec, and struct itimerspec. Centralizing these makes
things cleaner. RTEMS uses 64-bit dev_t.
Added numerous primitive definitions
for pthreads including macros, pthread_attr_t,
pthread_mutexattr_t, pthread_condattr_t, pthread_key_t,
pthread_once_t, and pthread_t.
* libc/include/sys/unistd.h: Added getlogin_r() prototype.
If RTEMS follow POSIX on read(), write() and sbrk() prototype.
Feature flags removed and moved to new file <sys/features.h>.
Full set of POSIX sysconf() constants
2000-12-12 09:24:09 +08:00
|
|
|
|
2021-07-31 21:22:05 +08:00
|
|
|
/* Using __MISC_VISIBLE until POSIX Issue 8 is officially released */
|
|
|
|
#if __MISC_VISIBLE
|
|
|
|
|
|
|
|
/* POSIX Issue 8 adds sig2str() and str2sig() */
|
|
|
|
|
2021-08-27 21:39:31 +08:00
|
|
|
#if __SIZEOF_INT__ >= 4
|
2021-07-31 21:22:05 +08:00
|
|
|
#define SIG2STR_MAX (sizeof("RTMAX+") + sizeof("4294967295") - 1)
|
|
|
|
#else
|
|
|
|
#define SIG2STR_MAX (sizeof("RTMAX+") + sizeof("65535") - 1)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
int sig2str(int, char *);
|
|
|
|
int str2sig(const char *__restrict, int *__restrict);
|
|
|
|
|
|
|
|
#endif /* __MISC_VISIBLE */
|
|
|
|
|
2000-02-18 03:39:52 +08:00
|
|
|
#if defined(___AM29K__)
|
|
|
|
/* These all need to be defined for ANSI C, but I don't think they are
|
|
|
|
meaningful. */
|
|
|
|
#define SIGABRT 1
|
|
|
|
#define SIGFPE 1
|
|
|
|
#define SIGILL 1
|
|
|
|
#define SIGINT 1
|
|
|
|
#define SIGSEGV 1
|
|
|
|
#define SIGTERM 1
|
|
|
|
/* These need to be defined for POSIX, and some others do too. */
|
|
|
|
#define SIGHUP 1
|
|
|
|
#define SIGQUIT 1
|
|
|
|
#define NSIG 2
|
|
|
|
#elif defined(__GO32__)
|
|
|
|
#define SIGINT 1
|
|
|
|
#define SIGKILL 2
|
|
|
|
#define SIGPIPE 3
|
|
|
|
#define SIGFPE 4
|
|
|
|
#define SIGHUP 5
|
|
|
|
#define SIGTERM 6
|
|
|
|
#define SIGSEGV 7
|
|
|
|
#define SIGTSTP 8
|
|
|
|
#define SIGQUIT 9
|
|
|
|
#define SIGTRAP 10
|
|
|
|
#define SIGILL 11
|
|
|
|
#define SIGEMT 12
|
|
|
|
#define SIGALRM 13
|
|
|
|
#define SIGBUS 14
|
|
|
|
#define SIGLOST 15
|
|
|
|
#define SIGSTOP 16
|
|
|
|
#define SIGABRT 17
|
|
|
|
#define SIGUSR1 18
|
|
|
|
#define SIGUSR2 19
|
|
|
|
#define NSIG 20
|
2003-11-29 05:05:51 +08:00
|
|
|
#elif !defined(SIGTRAP)
|
2000-02-18 03:39:52 +08:00
|
|
|
#define SIGHUP 1 /* hangup */
|
|
|
|
#define SIGINT 2 /* interrupt */
|
|
|
|
#define SIGQUIT 3 /* quit */
|
|
|
|
#define SIGILL 4 /* illegal instruction (not reset when caught) */
|
|
|
|
#define SIGTRAP 5 /* trace trap (not reset when caught) */
|
|
|
|
#define SIGIOT 6 /* IOT instruction */
|
|
|
|
#define SIGABRT 6 /* used by abort, replace SIGIOT in the future */
|
|
|
|
#define SIGEMT 7 /* EMT instruction */
|
|
|
|
#define SIGFPE 8 /* floating point exception */
|
|
|
|
#define SIGKILL 9 /* kill (cannot be caught or ignored) */
|
|
|
|
#define SIGBUS 10 /* bus error */
|
|
|
|
#define SIGSEGV 11 /* segmentation violation */
|
|
|
|
#define SIGSYS 12 /* bad argument to system call */
|
|
|
|
#define SIGPIPE 13 /* write on a pipe with no one to read it */
|
|
|
|
#define SIGALRM 14 /* alarm clock */
|
|
|
|
#define SIGTERM 15 /* software termination signal from kill */
|
|
|
|
|
2000-12-11 Joel Sherrill <joel@OARcorp.com>
* Merge RTEMS specific .h files into main libc/include.
* libc/sys/rtems/include/signal.h: Removed.
* libc/sys/rtems/include/time.h: Removed.
* libc/sys/rtems/sys/features.h: Removed.
* libc/sys/rtems/sys/sched.h: Removed.
* libc/sys/rtems/sys/siginfo.h: Removed.
* libc/sys/rtems/sys/signal.h: Removed.
* libc/sys/rtems/sys/time.h: Removed.
* libc/sys/rtems/sys/times.h: Removed.
definitions for time_t and clock_t since these are
no longer in time.h.
* libc/include/pthread.h: New file.
* libc/include/sys/sched.h: New file.
* libc/include/sys/features.h: New file.
* libc/include/time.h: Removed duplicate definition of clock_t
and time_t, get them from <sys/types.h> instead. Add prototypes for POSIX clock and timer functionality.
* libc/sys/linux/sys/types.h: Changed to include
* libc/include/machine/types.h: Add _CLOCKID_T_ and _TIMER_T_.
* libc/include/sys/signal.h: Add more complete set of POSIX
signal functionality including real-time and threaded signals.
* libc/include/sys/types.h: Add clock_t, time_t, struct
timespec, and struct itimerspec. Centralizing these makes
things cleaner. RTEMS uses 64-bit dev_t.
Added numerous primitive definitions
for pthreads including macros, pthread_attr_t,
pthread_mutexattr_t, pthread_condattr_t, pthread_key_t,
pthread_once_t, and pthread_t.
* libc/include/sys/unistd.h: Added getlogin_r() prototype.
If RTEMS follow POSIX on read(), write() and sbrk() prototype.
Feature flags removed and moved to new file <sys/features.h>.
Full set of POSIX sysconf() constants
2000-12-12 09:24:09 +08:00
|
|
|
#if defined(__rtems__)
|
2004-01-09 03:25:21 +08:00
|
|
|
#define SIGURG 16 /* urgent condition on IO channel */
|
|
|
|
#define SIGSTOP 17 /* sendable stop signal not from tty */
|
|
|
|
#define SIGTSTP 18 /* stop signal from tty */
|
|
|
|
#define SIGCONT 19 /* continue a stopped process */
|
|
|
|
#define SIGCHLD 20 /* to parent on child stop or exit */
|
|
|
|
#define SIGCLD 20 /* System V name for SIGCHLD */
|
|
|
|
#define SIGTTIN 21 /* to readers pgrp upon background tty read */
|
|
|
|
#define SIGTTOU 22 /* like TTIN for output if (tp->t_local<OSTOP) */
|
|
|
|
#define SIGIO 23 /* input/output possible signal */
|
|
|
|
#define SIGPOLL SIGIO /* System V name for SIGIO */
|
|
|
|
#define SIGWINCH 24 /* window changed */
|
|
|
|
#define SIGUSR1 25 /* user defined signal 1 */
|
|
|
|
#define SIGUSR2 26 /* user defined signal 2 */
|
2000-12-11 Joel Sherrill <joel@OARcorp.com>
* Merge RTEMS specific .h files into main libc/include.
* libc/sys/rtems/include/signal.h: Removed.
* libc/sys/rtems/include/time.h: Removed.
* libc/sys/rtems/sys/features.h: Removed.
* libc/sys/rtems/sys/sched.h: Removed.
* libc/sys/rtems/sys/siginfo.h: Removed.
* libc/sys/rtems/sys/signal.h: Removed.
* libc/sys/rtems/sys/time.h: Removed.
* libc/sys/rtems/sys/times.h: Removed.
definitions for time_t and clock_t since these are
no longer in time.h.
* libc/include/pthread.h: New file.
* libc/include/sys/sched.h: New file.
* libc/include/sys/features.h: New file.
* libc/include/time.h: Removed duplicate definition of clock_t
and time_t, get them from <sys/types.h> instead. Add prototypes for POSIX clock and timer functionality.
* libc/sys/linux/sys/types.h: Changed to include
* libc/include/machine/types.h: Add _CLOCKID_T_ and _TIMER_T_.
* libc/include/sys/signal.h: Add more complete set of POSIX
signal functionality including real-time and threaded signals.
* libc/include/sys/types.h: Add clock_t, time_t, struct
timespec, and struct itimerspec. Centralizing these makes
things cleaner. RTEMS uses 64-bit dev_t.
Added numerous primitive definitions
for pthreads including macros, pthread_attr_t,
pthread_mutexattr_t, pthread_condattr_t, pthread_key_t,
pthread_once_t, and pthread_t.
* libc/include/sys/unistd.h: Added getlogin_r() prototype.
If RTEMS follow POSIX on read(), write() and sbrk() prototype.
Feature flags removed and moved to new file <sys/features.h>.
Full set of POSIX sysconf() constants
2000-12-12 09:24:09 +08:00
|
|
|
|
|
|
|
/* Real-Time Signals Range, P1003.1b-1993, p. 61
|
|
|
|
NOTE: By P1003.1b-1993, this should be at least RTSIG_MAX
|
|
|
|
(which is a minimum of 8) signals.
|
|
|
|
*/
|
2004-01-09 03:25:21 +08:00
|
|
|
#define SIGRTMIN 27
|
|
|
|
#define SIGRTMAX 31
|
|
|
|
#define __SIGFIRSTNOTRT SIGHUP
|
|
|
|
#define __SIGLASTNOTRT SIGUSR2
|
2000-12-11 Joel Sherrill <joel@OARcorp.com>
* Merge RTEMS specific .h files into main libc/include.
* libc/sys/rtems/include/signal.h: Removed.
* libc/sys/rtems/include/time.h: Removed.
* libc/sys/rtems/sys/features.h: Removed.
* libc/sys/rtems/sys/sched.h: Removed.
* libc/sys/rtems/sys/siginfo.h: Removed.
* libc/sys/rtems/sys/signal.h: Removed.
* libc/sys/rtems/sys/time.h: Removed.
* libc/sys/rtems/sys/times.h: Removed.
definitions for time_t and clock_t since these are
no longer in time.h.
* libc/include/pthread.h: New file.
* libc/include/sys/sched.h: New file.
* libc/include/sys/features.h: New file.
* libc/include/time.h: Removed duplicate definition of clock_t
and time_t, get them from <sys/types.h> instead. Add prototypes for POSIX clock and timer functionality.
* libc/sys/linux/sys/types.h: Changed to include
* libc/include/machine/types.h: Add _CLOCKID_T_ and _TIMER_T_.
* libc/include/sys/signal.h: Add more complete set of POSIX
signal functionality including real-time and threaded signals.
* libc/include/sys/types.h: Add clock_t, time_t, struct
timespec, and struct itimerspec. Centralizing these makes
things cleaner. RTEMS uses 64-bit dev_t.
Added numerous primitive definitions
for pthreads including macros, pthread_attr_t,
pthread_mutexattr_t, pthread_condattr_t, pthread_key_t,
pthread_once_t, and pthread_t.
* libc/include/sys/unistd.h: Added getlogin_r() prototype.
If RTEMS follow POSIX on read(), write() and sbrk() prototype.
Feature flags removed and moved to new file <sys/features.h>.
Full set of POSIX sysconf() constants
2000-12-12 09:24:09 +08:00
|
|
|
|
2004-01-09 03:25:21 +08:00
|
|
|
#define NSIG 32 /* signal 0 implied */
|
2000-12-11 Joel Sherrill <joel@OARcorp.com>
* Merge RTEMS specific .h files into main libc/include.
* libc/sys/rtems/include/signal.h: Removed.
* libc/sys/rtems/include/time.h: Removed.
* libc/sys/rtems/sys/features.h: Removed.
* libc/sys/rtems/sys/sched.h: Removed.
* libc/sys/rtems/sys/siginfo.h: Removed.
* libc/sys/rtems/sys/signal.h: Removed.
* libc/sys/rtems/sys/time.h: Removed.
* libc/sys/rtems/sys/times.h: Removed.
definitions for time_t and clock_t since these are
no longer in time.h.
* libc/include/pthread.h: New file.
* libc/include/sys/sched.h: New file.
* libc/include/sys/features.h: New file.
* libc/include/time.h: Removed duplicate definition of clock_t
and time_t, get them from <sys/types.h> instead. Add prototypes for POSIX clock and timer functionality.
* libc/sys/linux/sys/types.h: Changed to include
* libc/include/machine/types.h: Add _CLOCKID_T_ and _TIMER_T_.
* libc/include/sys/signal.h: Add more complete set of POSIX
signal functionality including real-time and threaded signals.
* libc/include/sys/types.h: Add clock_t, time_t, struct
timespec, and struct itimerspec. Centralizing these makes
things cleaner. RTEMS uses 64-bit dev_t.
Added numerous primitive definitions
for pthreads including macros, pthread_attr_t,
pthread_mutexattr_t, pthread_condattr_t, pthread_key_t,
pthread_once_t, and pthread_t.
* libc/include/sys/unistd.h: Added getlogin_r() prototype.
If RTEMS follow POSIX on read(), write() and sbrk() prototype.
Feature flags removed and moved to new file <sys/features.h>.
Full set of POSIX sysconf() constants
2000-12-12 09:24:09 +08:00
|
|
|
|
|
|
|
#elif defined(__svr4__)
|
2000-02-18 03:39:52 +08:00
|
|
|
/* svr4 specifics. different signals above 15, and sigaction. */
|
|
|
|
#define SIGUSR1 16
|
|
|
|
#define SIGUSR2 17
|
|
|
|
#define SIGCLD 18
|
|
|
|
#define SIGPWR 19
|
|
|
|
#define SIGWINCH 20
|
|
|
|
#define SIGPOLL 22 /* 20 for x.out binaries!!!! */
|
|
|
|
#define SIGSTOP 23 /* sendable stop signal not from tty */
|
|
|
|
#define SIGTSTP 24 /* stop signal from tty */
|
|
|
|
#define SIGCONT 25 /* continue a stopped process */
|
|
|
|
#define SIGTTIN 26 /* to readers pgrp upon background tty read */
|
|
|
|
#define SIGTTOU 27 /* like TTIN for output if (tp->t_local<OSTOP) */
|
|
|
|
#define NSIG 28
|
|
|
|
#else
|
|
|
|
#define SIGURG 16 /* urgent condition on IO channel */
|
|
|
|
#define SIGSTOP 17 /* sendable stop signal not from tty */
|
|
|
|
#define SIGTSTP 18 /* stop signal from tty */
|
|
|
|
#define SIGCONT 19 /* continue a stopped process */
|
|
|
|
#define SIGCHLD 20 /* to parent on child stop or exit */
|
|
|
|
#define SIGCLD 20 /* System V name for SIGCHLD */
|
|
|
|
#define SIGTTIN 21 /* to readers pgrp upon background tty read */
|
|
|
|
#define SIGTTOU 22 /* like TTIN for output if (tp->t_local<OSTOP) */
|
|
|
|
#define SIGIO 23 /* input/output possible signal */
|
|
|
|
#define SIGPOLL SIGIO /* System V name for SIGIO */
|
|
|
|
#define SIGXCPU 24 /* exceeded CPU time limit */
|
|
|
|
#define SIGXFSZ 25 /* exceeded file size limit */
|
|
|
|
#define SIGVTALRM 26 /* virtual time alarm */
|
|
|
|
#define SIGPROF 27 /* profiling time alarm */
|
|
|
|
#define SIGWINCH 28 /* window changed */
|
|
|
|
#define SIGLOST 29 /* resource lost (eg, record-lock lost) */
|
|
|
|
#define SIGUSR1 30 /* user defined signal 1 */
|
|
|
|
#define SIGUSR2 31 /* user defined signal 2 */
|
|
|
|
#define NSIG 32 /* signal 0 implied */
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
2004-10-28 23:06:47 +08:00
|
|
|
|
2015-08-18 10:46:19 +08:00
|
|
|
#if defined(__CYGWIN__)
|
2016-03-15 05:39:56 +08:00
|
|
|
#if __XSI_VISIBLE >= 4 || __POSIX_VISIBLE >= 200809
|
2015-08-18 10:46:19 +08:00
|
|
|
#include <sys/ucontext.h>
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2004-10-28 23:06:47 +08:00
|
|
|
#ifndef _SIGNAL_H_
|
|
|
|
/* Some applications take advantage of the fact that <sys/signal.h>
|
|
|
|
* and <signal.h> are equivalent in glibc. Allow for that here. */
|
|
|
|
#include <signal.h>
|
|
|
|
#endif
|
2000-02-18 03:39:52 +08:00
|
|
|
#endif /* _SYS_SIGNAL_H */
|