Main Page | Modules | Data Structures | File List | Data Fields | Globals | Related Pages

Standard system calls wrappers

These are the "normal" system calls for the platform, either standardized through the Single UNIX Specification version 3 or specific to the platform. More...

Functions

unsigned int alarm (unsigned int seconds)
 Sets an alarm clock.

int setitimer (int, const struct itimerval *new, struct itimerval *old)
 Sets an interval timer.

int pthread_kill (pthread_t thread, int signo)
 Sends an asynchronous, thread-directed signal.

int kill (pid_t pid, int signo)
 Sends an asynchronous, process-directed signal.

ssize_t read (int fd, void *buf, size_t nbytes)
 Reads from a file descriptor.

ssize_t write (int fd, const void *buf, size_t nbytes)
 Writes to a file descriptor.


Detailed Description

These are the "normal" system calls for the platform, either standardized through the Single UNIX Specification version 3 or specific to the platform.

The documentation here describes signal behaviors that I've found to be poorly described in the manual pages. It applies to both the libc system call wrappers and the sigsafe ones (where they exist).


Function Documentation

unsigned int alarm unsigned int  seconds  ) 
 

Sets an alarm clock.

Generates an asynchronous, process-directed SIGALRM signal after the specified number of seconds.

int kill pid_t  pid,
int  signo
 

Sends an asynchronous, process-directed signal.

int pthread_kill pthread_t  thread,
int  signo
 

Sends an asynchronous, thread-directed signal.

Note:
This is despite the note in SUSv3 that asynchronous, thread-directed signals do not exist.

ssize_t read int  fd,
void *  buf,
size_t  nbytes
 

Reads from a file descriptor.

A synchronous, thread-directed SIGPIPE is delivered during this system call if the opposite end of the pipe is closed. I recommend ignoring this signal, which is redundant. It was implemented solely to be a more abrupt error to programs that do not check return values carefully. The 0 return says the same thing.

int setitimer int  ,
const struct itimerval *  new,
struct itimerval *  old
 

Sets an interval timer.

Generates asynchronous, process-directed SIGALRM, SIGVTALRM, or SIGPROF signals.

ssize_t write int  fd,
const void *  buf,
size_t  nbytes
 

Writes to a file descriptor.

A synchronous, thread-directed SIGPIPE is delivered during this system call if the opposite end of the pipe is closed. I recommend ignoring this signal, which is redundant. It was implemented solely to be a more abrupt error to programs that do not check return values carefully. The EPIPE error says the same thing.


Generated on Fri Feb 4 11:13:32 2005 for sigsafe by doxygen 1.3.5