Scroll to navigation

RT_SIGTIMEDWAIT(2) Linux Programmer's Manual RT_SIGTIMEDWAIT(2)

NAME

rt_sigtimedwait - synchronously wait for queued signals

SYNOPSIS

long rt_sigtimedwait(const sigset_t *uthese, siginfo_t *uinfo, const struct timespec uts, size_t sigsetsize);

DESCRIPTION

rt_sigtimedwait() suspends execution of the calling process until one of the signals in uthese is delivered. (If one of the signals in uthese is already pending for the calling process, rt_sigtimedwait() will return immediately with information about that signal.)

rt_sigtimedwait() removes the delivered signal from the calling process's list of pending signals and returns the signal number as its function result. If the uinfo argument is not NULL, then it returns a structure of type siginfo_t

The argument uts, enables an upper bound to be placed on the time for which the process is suspended. This argument is of the following type:


struct timespec {

long tv_sec; /* seconds */
long tv_nsec; /* nanoseconds */ }

If both fields of this structure are specified as 0, a poll is performed: rt_sigtimedwait() returns immediately, either with information about a signal that was pending for the caller, or with an error if none of the signals in uthese was pending.

RETURN VALUE

On success, rt_sigtimedwait() returns a signal number (i.e., a value greater than zero). On failure, returns one of the values from the ERRORS section below.

ERRORS

No signal in uthese was delivered within the uts period specified to sigtimedwait().
uts or uthese was invalid.
memory error.
The wait was interrupted by a signal handler and the timeout period has expired.
The wait was interrupted by a signal handler. (This handler was for a signal other than one of those in set.)

CONFORMING TO

POSIX 1003.1-2001

SEE ALSO

kill(2), sigaction(2), signal(2), sigpending(2), sigprocmask(2), sigqueue(2), signal(7), sigsetops(3), sigtimedwait(2)

See the file man2/sigtimedwait.2.

2003-04-07 Linux 2.4.19