The ChorusOS operating system implements the following POSIX APIs:
The ChorusOS operating system supports POSIX basic signal management system calls. The POSIX signals API is only available to user-mode processes.
The POSIX signals API is summarized in the following table:
|
Function |
Description |
|---|---|
|
kill() |
Send a signal to a process |
|
sigemptyset() |
Set a set of signals to NULL |
|
sigfillset() |
Set all signals in a set |
|
sigaddset() |
Add an individual signal to a set |
|
sigdelset() |
Delete an individual signal from a set |
|
sigismember() |
Test whether a signal is member of a set |
|
sigaction() |
Set/Examine action for a given signal. |
|
pthread_sigmask() |
Set/Examine signal mask for a pthread |
|
sigprocmask() |
Set/Examine signal mask for a process |
|
sigpending() |
Examine pending signals |
|
sigsuspend() |
Wait for a signal |
|
sigwait() |
Accept a signal |
|
pthread_kill() |
Send a signal to a given thread |
|
alarm() |
Schedule delivery of an alarm signal |
|
pause() |
Suspend process execution |
|
sleep() |
Delay process execution |
The real-time extension of POSIX signals (POSIX_REALTIME_SIGNALS) provides functions to send and receive queued signals. In the basic POSIX signals implementation, a particular signal is only received once by a process. Multiple occurrences of a pending signal are ignored. The real-time signals API allows multiple occurences of a signal to remain pending. POSIX real-time signals include a value that is allocated to the receiver of the signal upon reception by sigwaitinfo() or sigtimedwait(). Signals are then handled according to the value allocated to the receiver. As a consequence, the number of signals sent always corresponds to the number of signals received. This behavior is reserved for specific signals included in a special range.
The POSIX real-time signals API is summarized in the following table:
|
Function |
Description |
|---|---|
|
sigqueue() |
Queue a signal to a process |
|
sigwaitinfo() |
Accept a signal and get info |
|
sigtimedwait() |
Accept a signal, wait for bounded time |
The POSIX-THREADS API is a compatible implementation of the POSIX 1003.1 pthread API.
The POSIX threads API is summarized in the following table:
|
Function |
Description |
|---|---|
|
pthread_attr_init() |
Initialize a thread attribute object |
|
pthread_attr_destroy() |
Destroy a thread attribute object |
|
pthread_attr_setstacksize() |
Set the stacksize attribute |
|
pthread_attr_getstacksize() |
Get the stacksize attribute |
|
pthread_attr_setstackaddr() |
Set the stackaddr attribute |
|
pthread_attr_getstackaddr() |
Get the stackaddr attribute |
|
pthread_attr_setdetachstate() |
Set the detachstate attribute |
|
pthread_attr_getdetachstate() |
Get the detachstate attribute |
|
pthread_attr_setscope() |
Set the contention scope attribute |
|
pthread_attr_getscope() |
Get the contention scope attribute |
|
pthread_attr_setinheritsched() |
Set the scheduling inheritance attribute |
|
pthread_attr_getinheritsched() |
Get the scheduling inheritance attribute |
|
pthread_attr_setschedpolicy() |
Set the scheduling policy attribute |
|
pthread_attr_getschedpolicy() |
Get the scheduling policy attribute |
|
pthread_attr_setschedparam() |
Set the scheduling parameter attribute |
|
pthread_attr_getschedparam() |
Get the scheduling parameter attribute |
|
pthread_cancel() |
Cancel execution of a thread |
|
pthread_cleanup_pop() |
Pop a thread cancellation clean-up handler |
|
pthread_cleanup_push() |
Push a thread cancellation clean-up handler |
|
pthread_cond_init() |
Initialize a condition variable |
|
pthread_cond_destroy() |
Destroy a condition variable |
|
pthread_cond_signal() |
Signal a condition variable |
|
pthread_cond_broadcast() |
Broadcast a condition variable |
|
pthread_cond_wait() |
Wait on a condition variable |
|
pthread_cond_timedwait() |
Wait with timeout on a condition variable |
|
pthread_condattr_init() |
Initialize a condition variable attribute object |
|
pthread_condattr_destroy() |
Destroy a condition variable attribute object |
|
pthread_create() |
Create a thread |
|
pthread_equal() |
Compare thread identifiers |
|
pthread_exit() |
Terminate the calling thread |
|
pthread_join() |
Wait for thread termination |
|
pthread_key_create() |
Create a thread-specific data key |
|
pthread_key_delete() |
Delete a thread-specific data key |
|
pthread_kill() |
Send a signal to a thread |
|
pthread_mutex_init() |
Initialize a mutex |
|
pthread_mutex_destroy() |
Delete a mutex |
|
pthread_mutex_lock() |
Lock a mutex |
|
pthread_mutex_trylock() |
Attempt to lock a mutex without waiting |
|
pthread_mutex_unlock() |
Unlock a mutex |
|
pthread_mutexattr_init() |
Initialize a mutex attribute object |
|
pthread_mutexattr_destroy() |
Destroy a mutex attribute object |
|
pthread_once() |
Initialize a library dynamically |
|
pthread_self() |
Get the identifier of the calling thread |
|
pthread_setcancelstate() |
Enable or disable cancellation |
|
pthread_setschedparam() |
Set the current scheduling policy and parameters of a thread |
|
pthread_getschedparam() |
Get the current scheduling policy and parameters of a thread |
|
pthread_setspecific() |
Associate a thread-specific value with a key |
|
pthread_testcancel() |
Create cancellation point in the caller |
|
pthread_getspecific() |
Retrieve the thread-specific value associated with a key |
|
pthread_yield, sched_yield() |
Yield the processor to another thread |
|
sched_get_priority_max() |
Get maximum priority for policy |
|
sched_get_priority_min() |
Get minimum priority for policy |
|
sched_rr_get_interval() |
Get time quantum for SCHED_RR policy |
|
sysconf() |
Get configurable system variables |
The POSIX-TIMERS API is a compatible implementation of the POSIX 1003.1 real-time clock/timer API. This feature is simply a library that might or might not be linked with an application. It is not a feature that can be turned on or off when configuring a system.
The POSIX timers API is summarized in the following table:
|
Function |
Description |
|---|---|
|
clock_settime() |
Set clock to a specified value |
|
clock_gettime() |
Get value of clock |
|
clock_getres() |
Get resolution of clock |
|
nanosleep() |
Delay the current thread with high resolution |
|
timer_create() |
Create a timer |
|
timer_delete() |
Delete a timer |
|
timer_settime() |
Set and arm or disarm a timer |
|
timer_gettime() |
Get remaining interval for an active timer |
|
timer_getoverrun() |
Get current overrun count for a timer |
The POSIX_MQ feature is a compatible implementation of the POSIX 1003.1 real-time message queue API. POSIX message queues can be shared between user and supervisor processes.
The POSIX message queues API is summarized in the following table:
|
Function |
Description |
|---|---|
|
fpathconf() |
Return value of configurable limit (same as for regular files) |
|
mq_close() |
Close a message queue |
|
mq_getattr() |
Retrieve message queue attributes |
|
mq_open() |
Open a message queue |
|
mq_receive() |
Receive a message from a message queue |
|
mq_send() |
Send a message to a message queue |
|
mq_setattr() |
Set message queue attributes |
|
mq_unlink() |
Unlink a message queue |
The POSIX-SEM API is a compatible implementation of the POSIX 1003.1 semaphores API. For general information on this feature, see the POSIX standard (IEEE Std 1003.1 - 1993). This feature is simply a library that might or might not be linked to an application. It is not a feature that can be turned on or off when configuring a system.
The POSIX semaphores API is summarized in the following table. Some of the calls listed are also included in other features:
|
Function |
Comment |
|---|---|
|
sem_open() |
Open/initialize a semaphore |
|
sem_close() |
Close a semaphore |
|
sem_init() |
Initialize a semaphore |
|
sem_destroy() |
Delete a semaphore |
|
sem_wait() |
Wait on a semaphore |
|
sem_trywait() |
Attempt to lock a semaphore |
|
sem_post() |
Signal a semaphore |
|
sem_getvalue() |
Get semaphore counter value |
|
sem_unlink() |
Remove a named semaphore |
The POSIX_SHM feature is a compatible implementation of the POSIX 1003.1 real-time shared memory objects API. For general information on this feature, see the POSIX standard (IEEE Std 1003.1b-1993).
The POSIX shared memory API is summarized in the following table. Some of the calls listed are also included in other features:
|
Function |
Description |
|---|---|
|
close() |
Close a file descriptor |
|
dup() |
Duplicate an open file descriptor |
|
dup2() |
Duplicate an open file descriptor |
|
fchmod() |
Change mode of file |
|
fchown() |
Change owner and group of a file |
|
fcntl() |
File control |
|
fpathconf() |
Get configurable pathname variables |
|
fstat() |
Get file status |
|
ftruncate() |
Set size of a shared memory object |
|
mmap() |
Map actor addresses to memory object. |
|
munmap() |
Unmap previously mapped addresses |
|
shm_open() |
Open a shared memory object |
|
shm_unlink() |
Unlink a shared memory object |
The POSIX_SOCKETS feature provides POSIX-compatible socket system calls. For general information on this feature, see the POSIX draft standard P1003.1g. The POSIX_SOCKETS provides support for the AF_LOCAL, AF_INET, AF_INET6, and AF_ROUTE domains. The AF_UNIX domain is only supported when the AF_LOCAL feature is present. The AF_INET6 domain is only supported when the IPv6 feature is present.
The POSIX_SOCKETS feature API is summarized in the following table. Some of the calls listed are also included in other features:
|
Function |
Description |
|---|---|
|
accept() |
Accept a connection on a socket |
|
bind() |
Bind a name to a socket |
|
close() |
Close a file descriptor |
|
connect() |
Initiate a connection on a socket |
|
dup() |
Duplicate an open file descriptor |
|
dup2() |
Duplicate an open file descriptor |
|
fcntl() |
File control |
|
getpeername() |
Get name of connected peer |
|
getsockname() |
Get socket name |
|
setsockopt() |
Set options on sockets |
|
getsockopt() |
Get options on sockets |
|
ioctl() |
Device control |
|
listen() |
Listen for connections on a socket |
|
read() |
Read from a socket |
|
recv() |
Receive a message from a socket |
|
recvfrom() |
Receive a message from a socket |
|
recvmsg() |
Receive a message from a socket |
|
select() |
Synchronous I/O multiplexing |
|
send() |
Send a message from a socket |
|
sendto() |
Send a message from a socket. |
|
sendmsg() |
Send a message from a socket |
|
shutdown() |
Shut down part of a full-duplex connection |
|
socket() |
Create an endpoint for communication |
|
socketpair() |
Create a pair of connected sockets |
|
write() |
Write on a socket |