This chapter includes the following:
Here are the categories:
We've organized the functions in the C library into the following categories:
- Asynchronous I/O functions
- Asynchronous read, write, and other I/O operations.
- Atomic functions
- Thread-safe integer manipulation functions.
- Character manipulation functions
- Single-character functions for upper/lowercase conversions.
- Conversion functions
- Convert values from one representation to another (e.g. numeric values to strings).
- Directory functions
- Directory services (change, open, close, etc.).
- Dispatch interface functions
- Handle different event types, including messages, pulse codes, and signals.
- File manipulation functions
- File operations (change permissions, delete, rename, etc.)
- IPC functions
- Traditional InterProcess Communication functions.
- Hardware functions
- These functions work with PCI and other devices.
- Math functions
- Perform computations such as the common trigonometric calculations.
These functions operate with floating-point values.
- Memory allocation functions
- Allocate and deallocate memory.
- Memory manipulation functions
- Manipulate blocks of memory.
- Message-queue functions
- Nonblocking message-passing facilities.
- Multibyte character functions
- ANSI C functions for processing multibyte and wide characters.
- QNX Neutrino-specific IPC functions
- Native message-passing and related functions.
- Operating system I/O functions
- POSIX functions for performing
I/O at a lower level than the C Language stream I/O functions (e.g.
fopen(),
fread(),
fwrite(),
and
fclose()
).
- PC Card functions
- Native PC Card functions.
- Platform-specific functions
- Invoke Intel 80x86 and other processor-related functions directly from a program.
- Process environment functions
- For process identification,
user identification, process groups, system identification,
system time and process time, environment variables,
terminal identification,
and configurable system variables.
- Process manipulation functions
- For process creation, execution, and
termination; signal handling; and timer operations.
- Realtime timer functions
- Rich set of "inexpensive" timer functions that are quick to create and manipulate.
- Resource manager functions
- These functions help you create resource managers.
- Searching and sorting functions
- Perform various search and sort operations (do a binary
search on a sorted array, find one string inside another, etc.).
- Shared-memory functions
- Create and manipulate shared-memory regions.
- Signal functions
- Rich set of functions for handling and sending signals.
- Stream I/O functions
- The "standard" functions to read and
write files. Data can be transmitted under format control or
as characters, strings, or blocks of memory.
- String manipulation functions
- Manipulate a character string, i.e. an array of zero or more adjacent characters
followed by a NUL character (\0) that marks the end
of the string.
- System database functions
- Allow an application to access group and user database
information.
- System message log functions
- This set of functions controls the system log.
- TCP/IP functions
- Handle TCP/IP network communications and the TCP/IP database files.
- Terminal control functions
- Set and control terminal attributes (baud rate, flow control, etc.).
- Thread functions
- Operate on threads and the objects used to synchronize threads.
- Time functions
- Obtain and manipulate times and dates.
- Variable-length argument
list functions
- Process a variable number of arguments to a function.
- Wide-character functions
- Wide-character versions of functions from other function summary categories.
The following subsections describe these function categories
in more detail. Each function is noted with a brief
description of its purpose.
These functions perform asynchronous read, write,
and other I/O operations.
 |
Asynchronous I/O operations aren't currently supported. |
The following functions are defined:
- aio_cancel()
- Cancel an asynchronous I/O operation
- aio_error()
- Get the error status for an asynchronous I/O operation
- aio_fsync()
- Asynchronously synchronize a file
- aio_read()
- Asynchronously read from a file
- aio_return()
- Get the return status for an asynchronous I/O operation
- aio_suspend()
- Wait for asynchronous I/O operations to complete
- aio_write()
- Asynchronously write to a file
These functions manipulate an integer in a thread-safe way. On a
multiprocessor system, even a simple:
/*
Assuming x is an unsigned variable shared between two
or more threads or a thread and an interrupt handler.
*/
x ^= 0xdeadbeef;
may cause x to be in an undefined state if multiple threads running
simultaneously on multiple processors execute this code at the same time.
Use the atomic*() functions to ensure that your integer
operations are carried out properly:
atomic_toggle( &x, 0xdeadbeef );
- atomic_add()
- Safely add to a variable
- atomic_add_value()
- Safely add to a variable, returning the previous value
- atomic_clr()
- Safely clear a variable
- atomic_clr_value()
- Safely clear a variable, returning the previous value
- atomic_set()
- Safely set bits in a variable
- atomic_set_value()
- Safely set bits in a variable, returning the previous value
- atomic_sub()
- Safely subtract from a variable
- atomic_sub_value()
- Safely subtract from a variable, returning the previous value
- atomic_toggle()
- Safely toggle a variable
- atomic_toggle_value()
- Safely toggle a variable, returning the previous value
These functions operate on single characters of type char.
The functions test characters in various ways and convert them between
upper and lowercase. (Some of these functions have wide-character versions in the
"Wide-character functions"
section of the function summary.)
- isalnum()
- Test a character to see if it's alphanumeric
- isalpha()
- Test to see if a character is a letter
- isascii()
- Test for a character in the range 0 to 127
- iscntrl()
- Test a character to see if it's a control character
- isdigit()
- Test for any decimal digit
- isgraph()
- Test for any printable character except space
- islower()
- Test for any lowercase letter
- isprint()
- Test for any printable character, including space
- ispunct()
- Test for any punctuation character
- isspace()
- Test for a whitespace character
- isupper()
- Test for any uppercase letter
- isxdigit()
- Test for any hexadecimal digit
- tolower()
- Convert a character to lowercase
- toupper()
- Convert a character to uppercase
These functions perform conversions between objects of various types
and strings:
- atof()
- Convert a string into a double
- atoh()
- Convert a string containing a hexadecimal number into an unsigned number
- atoi()
- Convert a string into an integer
- atol(), atoll()
- Convert a string into a long integer
- ENDIAN_BE16()
- Return a big-endian 16-bit value in native format
- ENDIAN_BE32()
- Return a big-endian 32-bit value in native format
- ENDIAN_BE64()
- Return a big-endian 64-bit value in native format
- ENDIAN_LE16()
- Return a little-endian 16-bit value in native format
- ENDIAN_LE32()
- Return a little-endian 32-bit value in native format
- ENDIAN_LE64()
- Return a little-endian 64-bit value in native format
- ENDIAN_RET16()
- Return an endian-swapped 16-bit value
- ENDIAN_RET32()
- Return an endian-swapped 32-bit value
- ENDIAN_RET64()
- Return an endian-swapped 64-bit value
- ENDIAN_SWAP16()
- Endian-swap a 16-bit value in place
- ENDIAN_SWAP32()
- Endian-swap a 32-bit value in place
- ENDIAN_SWAP64()
- Endian-swap a 64-bit value in place
- htonl()
- Convert a 32-bit value from host-byte order to network-byte order
- htons()
- Convert a 16-bit value from host-byte order to network-byte order
- itoa()
- Convert an integer into a string, using a given base
- ltoa(), lltoa()
- Convert a long integer value into a string, using a given base
- nsec2timespec()
- Convert nanoseconds to a timespec structure
- ntohl()
- Convert network-byte order value
- ntohs()
- Convert network-byte order value
- strtod()
- Convert a string into a double
- strtoimax(), strtoumax()
- Convert a string into an integer
- strtol(), strtoll()
- Convert a string into a long integer
- strtoul(), strtoull()
- Convert a string into an unsigned long integer
- timespec
- Time-specification structure
- timespec2nsec()
- Convert a timespec structure to nanoseconds
- ultoa(), ulltoa()
- Convert an unsigned long integer into a string, using a given base
- UNALIGNED_PUT16()
- Write a misaligned 16-bit value safely
- UNALIGNED_PUT32()
- Write a misaligned 32-bit value safely
- UNALIGNED_PUT64()
- Write a misaligned 64-bit value safely
- UNALIGNED_RET16()
- Access a misaligned 16-bit value safely
- UNALIGNED_RET32()
- Access a misaligned 32-bit value safely
- UNALIGNED_RET64()
- Access a misaligned 64-bit value safely
- utoa()
- Convert an unsigned integer into a string, using a given base
- wordexp()
- Perform word expansions
- wordfree()
- Free a word expansion buffer
See also the following functions, which convert the cases of characters and
strings:
These functions pertain to directory manipulation:
- alphasort()
- Compare two directory entries
- chdir()
- Change the current working directory
- chroot()
- Change the root directory
- closedir()
- Close a directory
- dircntl()
- Control an open directory
- dirname()
- Report the parent directory name of a file pathname
- getcwd()
- Get the name of the current working directory
- getwd()
- Get current working directory pathname
- glob()
- Find paths matching a pattern
- globfree()
- Free storage allocated by a call to glob()
- mkdir()
- Create a subdirectory
- mount()
- Mount a filesystem
- mount_parse_generic_args()
- Strip off common mount arguments
- opendir()
- Open a directory file
- pathfind(), pathfind_r()
- Search for a file in a list of directories
- readdir()
- Get information about the next matching filename
- readdir_r()
- Get information about the next matching filename
- realpath()
- Resolve a pathname
- rewinddir()
- Reset the position of a directory stream to the start of the
directory
- rmdir()
- Delete an empty directory
- scandir()
- Scan a directory
- seekdir()
- Set the position for the next read of the directory stream
- telldir()
- Get the location associated with the directory stream
- umount()
- Unmount a filesystem
These functions make up the dispatch interface where you can
handle different event types including messages, pulse codes, and signals.
The functions cover dispatch contexts, attaching events, attaching pathnames
and file descriptors to dispatch contexts, thread pools, etc.
For an overview of these functions, see
"Components of a resource manager"
in the Writing a Resource Manager chapter of the
QNX Neutrino Programmer's Guide.
- dispatch_block()
- Block while waiting for an event
- dispatch_context_alloc()
- Return a dispatch context
- dispatch_context_free()
- Free a dispatch context
- dispatch_create()
- Allocate a dispatch handle
- dispatch_destroy()
- Destroy a dispatch handle
- dispatch_handler()
- Handle events received by dispatch_block()
- dispatch_timeout()
- Set a timeout
- dispatch_unblock()
- Unblock all of the threads that are blocked on a dispatch handle
- message_attach()
- Attach a message range
- message_connect()
- Create a connection to a channel
- message_detach()
- Detach a message range
- name_attach()
- Register a name in the namespace and create a channel
- name_detach()
- Remove a name from the namespace and destroy the channel
- _pulse
- Structure that describes a pulse
- pulse_attach()
- Attach a handler function to a pulse code
- pulse_detach()
- Detach a handler function from a pulse code
- resmgr_attach()
- Attach a path to a pathname space
- resmgr_block()
- Block while waiting for a message
- resmgr_connect_funcs_t
- Table of POSIX-level connect functions
- resmgr_context_alloc()
- Allocate a resource-manager context
- resmgr_context_free()
- Free a resource-manager context
- resmgr_context_t
- Context information that's passed between resource-manager functions
- resmgr_detach()
- Remove a pathname from the pathname space
- resmgr_devino()
- Get the device and inode number
- _resmgr_handle_grow()
- Expand the capacity of the device manager database
- resmgr_handle_tune()
- Tune aspects of client fd-to-OCB mapping
- resmgr_handler()
- Handle resource manager messages
- _resmgr_io_func()
- Retrieve an I/O function from an I/O function table
- resmgr_io_funcs_t
- Table of POSIX-level I/O functions
- resmgr_iofuncs()
- Extract the I/O function pointers associated with client connections
- resmgr_msgread()
- Read a message from a client
- resmgr_msgreadv()
- Read a message from a client
- resmgr_msgwrite()
- Write a message to a client
- resmgr_msgwritev()
- Write a message to a client
- _RESMGR_NPARTS()
- Get a given number of parts from the ctp->iov structure
- _resmgr_ocb()
- Retrieve an Open Control Block
- resmgr_open_bind()
- Associate an OCB with an open request
- resmgr_pathname()
- Return the pathname associated with an ID
- _RESMGR_PTR()
- Get one part from the ctp->iov structure and fill in its fields
- _RESMGR_STATUS()
- Set the status member of a resource-manager context
- resmgr_unbind()
- Remove an OCB
- select_attach()
- Attach a file descriptor to a dispatch handle
- select_detach()
- Detach a file descriptor from a dispatch handle
- select_query()
- Decode the last select event
- thread_pool_create()
- Create a thread pool handle
- thread_pool_control()
- Control the thread pool behavior
- thread_pool_destroy()
- Free the memory allocated to a thread pool
- thread_pool_limits()
- Wrapper function for thread_pool_control()
- thread_pool_start()
- Start a thread pool
These functions operate directly with files. The following functions are defined:
- access()
- Check to see if a file or directory can be accessed
- chmod()
- Change the permissions for a file
- chown()
- Change the user ID and group ID of a file
- eaccess()
- Check to see if a file or directory can be accessed (extended version)
- glob()
- Find paths matching a pattern
- globfree()
- Free storage allocated by a call to glob()
- fchmod()
- Change the permissions for a file
- fchown()
- Change the user ID and group ID of a file
- fpathconf()
- Return the value of a configurable limit associated with a file or directory
- ftruncate(), ftruncate64()
- Truncate a file
- futime()
- Record the modification time for a file
- lchown()
- Change the user ID and group ID of a file or symbolic link
- lstat(), lstat64()
- Get information about a file or directory
- ltrunc()
- Truncate a file at a given position
- mkfifo()
- Create a FIFO special file
- mkstemp()
- Make a unique temporary filename, and open the file
- mktemp()
- Make a unique temporary filename
- nftw(), nftw64()
- Walk a file tree
- pathconf()
- Return the value of a configurable limit
- pclose()
- Close a pipe
- pwrite(), pwrite64()
- Write into a file without changing the file pointer
- remove()
- Remove a link to a file
- rename()
- Rename a file
- stat(), stat64()
- Get information about a file or directory, given a path
- statvfs(), statvfs64()
- Get filesystem information, given a path
- sync()
- Synchronize filesystem updates
- tempnam()
- Create a name for a temporary file
- truncate()
- Truncate a file to a specified length
- tmpnam()
- Generate a unique string for use as a filename
- unlink()
- Remove a link to a file
- utime()
- Record the modification time for a file or directory
- utimes()
- Set a file's access and modification times
These functions deal with InterProcess Communications.
- flock()
- Apply or remove an advisory lock on an open file
- lockf()
- Record locking on files
- mlock()
- Lock a buffer in physical memory
- mlockall()
- Lock a process's address space
- mmap(), mmap64()
- Map a memory region into a process address space
- mprotect()
- Change memory protection
- msync()
- Synchronize memory with physical storage
- munlock()
- Unlock a buffer
- munlockall()
- Unlock a process's address space
- munmap()
- Unmap previously mapped addresses
- pthread_barrier_destroy()
- Destroy a barrier object
- pthread_barrier_init()
- Initialize a barrier object
- pthread_barrier_wait()
- Synchronize at a barrier
- pthread_barrierattr_destroy()
- Destroy a barrier attributes object
- pthread_barrierattr_getpshared()
- Get the process-shared attribute of a barrier attributes object
- pthread_barrierattr_init()
- Initialize a barrier attributes object
- pthread_barrierattr_setpshared()
- Set the process-shared attribute of a barrier attributes object
- pthread_cond_broadcast()
- Unblock threads waiting on a condition
- pthread_cond_destroy()
- Destroy a condition variable
- pthread_cond_init()
- Initialize a condition variable
- pthread_cond_signal()
- Unblock the thread waiting on a condition variable
- pthread_cond_timedwait()
- Wait on a condition variable, with a time limit
- pthread_cond_wait()
- Wait on a condition variable
- pthread_condattr_destroy()
- Destroy a condition variable attribute object
- pthread_condattr_getclock()
- Get the clock attribute from a condition-variable attribute object
- pthread_condattr_getpshared()
- Get the process-shared attribute from a condition variable
attribute object
- pthread_condattr_init()
- Initialize a condition variable attribute object
- pthread_condattr_setclock()
- Set the clock attribute in a condition-variable attribute object
- pthread_condattr_setpshared()
- Set the process-shared attribute in a condition-variable
attribute object
- pthread_mutex_destroy()
- Destroy a mutex
- pthread_mutex_getprioceiling()
- Get a mutex's priority ceiling
- pthread_mutex_init()
- Initialize a mutex
- pthread_mutex_lock()
- Lock a mutex
- pthread_mutex_setprioceiling()
- Set a mutex's priority ceiling
- pthread_mutex_timedlock()
- Lock a mutex
- pthread_mutex_trylock()
- Attempt to lock a mutex
- pthread_mutex_unlock()
- Unlock a mutex
- pthread_mutexattr_destroy()
- Destroy a mutex attribute object
- pthread_mutexattr_getprioceiling()
- Get the priority ceiling of a mutex attribute object
- pthread_mutexattr_getprotocol()
- Get a mutex's scheduling protocol
- pthread_mutexattr_getpshared()
- Get the process-shared attribute from a mutex attribute object
- pthread_mutexattr_getrecursive()
- Get the recursive attribute from a mutex attribute object
- pthread_mutexattr_gettype()
- Get a mutex type
- pthread_mutexattr_init()
- Initialize the mutex attribute object
- pthread_mutexattr_setprioceiling()
- Set the priority ceiling of a mutex attribute object
- pthread_mutexattr_setprotocol()
- Set a mutex's scheduling protocol
- pthread_mutexattr_setpshared()
- Set the process-shared attribute in mutex attribute object
- pthread_mutexattr_setrecursive()
- Set the recursive attribute in mutex attribute object
- pthread_mutexattr_settype()
- Set a mutex type
- pthread_once()
- Dynamic package initialization
- pthread_rwlock_destroy()
- Destroy a read/write lock
- pthread_rwlock_init()
- Initialize a read/write lock
- pthread_rwlock_rdlock()
- Acquire a shared read lock on a read/write lock
- pthread_rwlock_timedrdlock()
- Lock a read-write lock for writing
- pthread_rwlock_timedwrlock()
- Attempt to acquire an exclusive write lock on a read/write lock
- pthread_rwlock_tryrdlock()
- Attempt to acquire a shared read lock on a read/write lock
- pthread_rwlock_trywrlock()
- Attempt to acquire an exclusive write lock on a read/write lock
- pthread_rwlock_unlock()
- Unlock a read/write lock
- pthread_rwlock_wrlock()
- Acquire an exclusive write lock on a read/write lock
- pthread_rwlockattr_destroy()
- Destroy a read-write lock attribute object
- pthread_rwlockattr_getpshared()
- Get the process-shared attribute of a read-write lock attribute object
- pthread_rwlockattr_init()
- Create a read-write lock attribute object
- pthread_rwlockattr_setpshared()
- Set the process-shared attribute of a read-write lock attribute object
- pthread_spin_destroy()
- Destroy a thread spinlock
- pthread_spin_init()
- Initialize a thread spinlock
- pthread_spin_lock()
- Lock a thread spinlock
- pthread_spin_trylock()
- Try locking a thread spinlock
- pthread_spin_unlock()
- Unlock a thread spinlock
- readcond()
- Read data from a terminal device
- sem_close()
- Close a named semaphore
- sem_destroy()
- Destroy a semaphore
- sem_getvalue()
- Get the value of a semaphore (named or unnamed)
- sem_init()
- Initialize a semaphore
- sem_open()
- Create or access a named semaphore
- sem_post()
- Increment a semaphore
- sem_timedwait()
- Wait on a semaphore, with a timeout
- sem_trywait()
- Wait on a semaphore, but don't block
- sem_unlink()
- Destroy a named semaphore
- sem_wait()
- Wait on a semaphore
- sync()
- Synchronize filesystem updates
These functions work with PCI and other devices for
operations such as determining whether or not a PCI BIOS is
present, attaching a driver to a PCI device, and so on.
The following functions are defined:
- pci_attach()
- Connect to the PCI server
- pci_attach_device()
- Attach a driver to a PCI device
- pci_detach()
- Disconnect from the PCI server
- pci_detach_device()
- Detach a driver from a PCI device
- pci_find_class()
- Find devices that have a specific Class Code
- pci_find_device()
- Find the PCI device with a given device ID and vendor ID
- pci_irq_routing_options()
- Retrieve PCI IRQ routing information
- pci_map_irq()
- Map an interrupt pin to an IRQ
- pci_present()
- Determine whether or not PCI BIOS is present
- pci_read_config()
- Read from the configuration space of a PCI device
- pci_read_config8()
- Read a byte from the configuration space of a device
- pci_read_config16()
- Read 16-bit values from the configuration space of a device
- pci_read_config32()
- Read 32-bit values from the configuration space of a device
- pci_rescan_bus()
- Rescan the PCI bus for added or removed devices
- pci_write_config()
- Write to the configuration space of a PCI device
- pci_write_config8()
- Write bytes to the configuration space of a PCI device
- pci_write_config16()
- Write 16-bit values to the configuration space of a device
- pci_write_config32()
- Write 32-bit values to the configuration space of a device
- hwi_find_item()
- Find an item in the hwi_item structure
- hwi_find_tag()
- Find a tag in the hwi_item structure
- hwi_off2tag()
- Return a pointer to the start of a tag in the hwinfo area of the system page
- hwi_tag2off()
- Return the offset from the start of the hwinfo area of the system page
The math functions are arranged in the following categories:
- abs()
- Return the absolute value of an integer
- cabs(), cabsf()
- Compute the absolute value of a complex number
- fabs(), fabsf()
- Compute the absolute value of a double number
- labs()
- Calculate the absolute value of a long integer
- j0(), j0f()
- Compute a Bessel function of the first kind
- j1(), j1f()
- Compute a Bessel function of the first kind
- jn(), jnf()
- Compute a Bessel function of the first kind
- y0(), y0f()
- Compute a Bessel function of the second kind
- y1(), y1f()
- Compute a Bessel function of the second kind
- yn(), ynf()
- Compute a Bessel function of the second kind
- div()
- Calculate the quotient and remainder of a division operation
- drem(), dremf()
- Compute the remainder of two numbers
- fmod(), fmodf()
- Compute a residue, using floating-point modular arithmetic
- ldiv()
- Perform division on long integers
- modf(), modff()
- Break a number into integral and fractional parts
- remainder(), remainderf()
- Compute the floating point remainder
These functions set or get attributes of floating-point operations:
- fp_exception_mask()
- Get or set the current exception mask
- fp_exception_value()
- Get the value of the current exception registers
- fp_precision()
- Set or get the current precision
- fp_rounding()
- Set or get the current rounding
- gamma(), gamma_r(), gammaf(), gammaf_r()
- Log gamma function
- lgamma(), lgamma_r(), lgammaf(), lgammaf_r()
- Log gamma function
The following routines calculate logarithms and exponentials:
- exp(), expf()
- Compute the exponential function of a number
- expm1(), expm1f()
- Compute the exponential of a number, then subtract 1
- frexp(), frexpf()
- Break a floating-point number into a normalized fraction and an
integral power of 2
- ilogb(), ilogbf()
- Compute the integral part of a logarithm
- ldexp(), ldexpf()
- Multiply a floating-point number by an integral power of 2
- log(), logf()
- Compute the natural logarithm of a number
- log10(), log10f()
- Compute the logarithm (base 10) of a number
- log1p(), log1pf()
- Compute log(1+x)
- logb(), logbf()
- Compute the radix-independent exponent
- scalb(), scalbf()
- Load the exponent of a radix-independent floating-point number
- scalbn(), scalbnf()
- Compute the exponent of a radix-independent floating-point number
- significand(), significandf()
- Compute the "significant bits" of a floating-point number
- copysign(), copysignf()
- Copy the sign bit from one number to another
- erf(), erff()
- Compute the error function of a number
- erfc(), erfcf()
- Complementary error function
- finite(), finitef()
- Determine if a number is finite
- hypot(), hypotf()
- Calculate the length of the hypotenuse for a right-angled triangle
- isinf(), isinff()
- Test for infinity
- isnan(), isnanf()
- Test for not-a-number (NAN)
- max()
- Return the greater of two numbers
- min()
- Return the lesser of two numbers
- nextafter(), nextafterf()
- Compute the next representable double-precision floating-point number
The math library includes several sets of functions that you can use to
generate pseudo-random numbers.
The simplest family consists of:
- rand()
- Compute a sequence of pseudo-random integers
- rand_r()
- Compute a sequence of pseudo-random integers in a thread-safe manner
- srand()
- Start a new sequence of pseudo-random integers for rand()
This set of functions uses a nonlinear additive feedback random-number
generator, using a state array:
- initstate()
- Initialize a pseudo-random number generator
- random()
- Generate a pseudo-random number from the default state
- setstate()
- Reset the state of a pseudo-random number generator
- srandom()
- Set the seed for a pseudo-random number generator
This set of functions uses 48-bit arithmetic to produce pseudo-random numbers
of various types:
- drand48()
- Generate a pseudo-random double
- erand48()
- Generate a pseudo-random double in a thread-safe manner
- jrand48()
- Generate a pseudo-random signed long integer in a thread-safe manner
- lcong48()
- Initialize a sequence of pseudo-random numbers
- lrand48()
- Generate a pseudo-random nonnegative long integer
- mrand48()
- Generate a pseudo-random signed long integer
- nrand48()
- Generate a pseudo-random nonnegative long integer in a thread-safe manner
- seed48()
- Initialize a sequence of pseudo-random numbers
- srand48()
- Initialize a sequence of pseudo-random numbers
- cbrt(), cbrtf()
- Compute the cube root of a number
- pow(), powf()
- Raise a number to a given power
- sqrt(), sqrtf()
- Calculate the nonnegative square root of a number
- ceil(), ceilf()
- Round up a value to the next integer
- floor(), floorf()
- Round down a value to the next integer
- rint(), rintf()
- Round to the nearest integral value
- acos(), acosf()
- Compute the arccosine of an angle
- acosh(), acoshf()
- Compute the inverse hyperbolic cosine
- asin(), asinf()
- Compute the arcsine of an angle
- asinh(), asinhf()
- Compute the inverse hyperbolic sine
- atan(), atanf()
- Compute the arctangent of an angle
- atanh(), atanhf()
- Compute the inverse hyperbolic tangent
- atan2(), atan2f()
- Compute the arctangent, determining the quadrant
- cos(), cosf()
- Compute the cosine of an angle
- cosh(), coshf()
- Compute the hyperbolic cosine
- sin(), sinf()
- Calculate the sine of an angle
- sinh(), sinhf()
- Compute the hyperbolic sine
- tan(), tanf()
- Calculate the tangent of an angle
- tanh(), tanhf()
- Calculate the hyperbolic tangent
These functions allocate and deallocate blocks of memory:
- alloca()
- Allocate automatic space from the stack
- _amblksiz
- The increment for the break pointer
- _btext
- The beginning of the text segment
- calloc()
- Allocate space for an array
- cfree()
- Free allocated memory
- _edata
- The end of the data segment, excluding BSS data
- _end
- The end of the data segment, including BSS data
- _etext
- The end of the text segment
- free()
- Deallocate a block of memory
- ftw()
- Walk a file tree
- longjmp()
- Restore the environment saved by setjmp()
- mallinfo()
- Get memory allocation information
- malloc()
- Allocate memory
- mallopt()
- Control the memory allocation
- mcheck()
- Enable memory allocation routine consistency checks
- memalign()
- Allocate aligned memory
- mprobe()
- Perform consistency check on memory
- posix_memalign()
- Allocate aligned memory
- realloc()
- Allocate, reallocate or free a block of memory
- sbrk()
- Set the allocation break value for a program
- _scalloc()
- Allocate space for an array
- setjmp()
- Save the calling environment, for use by longjmp()
- siglongjmp()
- Restore the signal mask for a process, if one was saved
- sigsetjmp()
- Save the environment, including the signal mask
- _sfree()
- Deallocate a block of memory
- _smalloc()
- Allocate memory in blocks
- _srealloc()
- Allocate, reallocate or free a block of memory
- valloc()
- Allocate a heap block aligned on a page boundary
These functions manipulate blocks of memory.
In each case, the address of the memory block and its size is passed
to the function.(Some of these functions have wide-character versions in the
"Wide-character functions"
section of the function summary.)
- brk()
- Change the amount of space allocated for the calling process's data segment
- bzero()
- Set the first part of an object to null bytes
- ffs()
- Find the first bit set in a bit string
- index()
- Find a character in a string
- memccpy()
- Copy bytes until a given character is found
- memchr()
- Find the first occurrence of a character in a buffer
- memcmp()
- Compare a given number of characters in two objects
- memcpy()
- Copy a number of characters from one buffer to another
- memcpyv()
- Copy a given number of structures
- memicmp()
- Compare a given number of characters of two objects, without case
sensitivity
- mem_offset(), mem_offset64()
- Find offset of a mapped typed memory block
- memmove()
- Copy bytes from one buffer to another, handling overlapping memory correctly
- memset()
- Set the first part of an object to a given value
- mlock()
- Lock a buffer in physical memory
- mlockall()
- Lock a process's address space
- mmap(), mmap64()
- Map a memory region into a process address space
- mmap_device_io()
- Gain access to a device's registers
- mmap_device_memory()
- Map a device's physical memory into a process's address space
- msync()
- Synchronize memory with physical storage
- munlock()
- Unlock a buffer
- munlockall()
- Unlock a process's address space
- munmap_device_io()
- Free access to a device's registers
- munmap_device_memory()
- Unmap previously mapped addresses
- posix_mem_offset(), posix_mem_offset64()
- Find offset and length of a mapped typed memory block
- rindex()
- Find the last occurrence of a character in a string
- shm_ctl()
- Give special attributes to a shared memory object
- shm_ctl_special()
- Give special attributes to a shared memory object
- swab()
- Endian-swap a given number of bytes
See the section
"String manipulation functions"
for descriptions of functions that manipulate strings of data.
These functions deal with message queues:
- mq_close()
- Close a message queue
- mq_getattr()
- Get a message queue's attributes
- mq_notify()
- Ask to be notified when there's a message in the queue
- mq_open()
- Open a message queue
- mq_receive()
- Receive a message from a queue
- mq_send()
- Send a message to a queue
- mq_setattr()
- Set a message queue's attributes
- mq_timedreceive()
- Receive a message from a message queue
- mq_timedsend()
- Send a message to a message queue
- mq_unlink()
- Remove a message queue
These ANSI C functions provide capabilities for processing multibyte characters.
(Some of these functions have wide-character versions in the
"Wide-character functions"
section of the function summary.)
- mblen()
- Count the bytes in a multibyte character
- mbrlen()
- Count the bytes in a multibyte character (restartable)
- mbrtowc()
- Convert a multibyte character into a wide character (restartable)
- mbsinit()
- Determine the status of the conversion object used for restartable mb*() functions
- mbsrtowcs()
- Convert a multibyte-character string into a wide-character string (restartable)
- mbstowcs()
- Convert a multibyte-character string into a wide-character string
- mbtowc()
- Convert a multibyte character into a wide character
The following functions are defined:
- ChannelCreate(), ChannelCreate_r()
- Create a communications channel
- ChannelDestroy(), ChannelDestroy_r()
- Destroy a communications channel
- _msg_info
- Information about a message
- MsgDeliverEvent(), MsgDeliverEvent_r()
- Deliver an event through a channel
- MsgError(), MsgError_r()
- Unblock a client and set its errno
- MsgInfo(), MsgInfo_r()
- Get additional information about a message
- MsgKeyData(), MsgKeyData_r()
- Pass data through a common client
- MsgRead(), MsgRead_r()
- Read data from a message
- MsgReadv(), MsgReadv_r()
- Read data from a message
- MsgReceive(), MsgReceive_r()
- Wait for a message or pulse on a channel
- MsgReceivePulse(), MsgReceivePulse_r()
- Receive a pulse on a channel
- MsgReceivePulsev(), MsgReceivePulsev_r()
- Receive a pulse on a channel
- MsgReceivev(), MsgReceivev_r()
- Wait for a message or pulse on a channel
- MsgReply(), MsgReply_r()
- Reply with a message
- MsgReplyv(), MsgReplyv_r()
- Reply with a message
- MsgSend(), MsgSend_r()
- Send a message to a channel
- MsgSendnc(), MsgSendnc_r()
- Send a message to a channel (non-cancellation point)
- MsgSendPulse(), MsgSendPulse_r()
- Send a pulse to a channel
- MsgSendsv(), MsgSendsv_r()
- Send a message to a channel
- MsgSendsvnc(), MsgSendsvnc_r()
- Send a message to a channel (non-cancellation point)
- MsgSendv(), MsgSendv_r()
- Send a message to a channel
- MsgSendvnc(), MsgSendvnc_r()
- Send a message to a channel (non-cancellation point)
- MsgSendvs(), MsgSendvs_r()
- Send a message to a channel
- MsgSendvsnc(), MsgSendvsnc_r()
- Send a message to a channel (non-cancellation point)
- MsgVerifyEvent(), MsgVerifyEvent_r()
- Check the validity of a receive ID and an event configuration
- MsgWrite(), MsgWrite_r()
- Write a reply
- MsgWritev(), MsgWritev_r()
- Write a reply
- name_close()
- Close the file descriptor returned by name_open()
- name_open()
- Open a name for a server connection
- sigevent
- Structure that describes an event
- SyncTypeCreate(), SyncTypeCreate_r()
- Create a synchronization object
These functions operate at the operating-system level, and
are included for compatibility with other C implementations.
For new programs, we recommended that you use the functions in the section
"File manipulation functions",
functions are defined portably and are part of the ANSI standard for the C language.
The functions in this section reference opened files and devices using a
file descriptor that's returned when the file is opened.
The file descriptor is passed to the other functions.
The following functions are defined:
- chsize()
- Change the size of a file
- cfgopen()
- Open a configuration file
- close()
- Close a file at the operating system level
- _cmdfd()
- Return a file descriptor for the executable file
- _cmdname()
- Find the path used to invoke the current process
- creat(), creat64()
- Create and open a file at the operating system level
- devctl()
- Control a device
- dup()
- Duplicate a file descriptor
- dup2()
- Duplicate a file descriptor, specifying the new descriptor
- eof()
- Determine if the end-of-file has been reached
- fcfgopen()
- Open a configuration file
- fcntl()
- Provide control over an open file
- fdatasync()
- Write queued file data to disk
- fileno()
- Return the number of the file descriptor for a stream
- flink()
- Assign a pathname to a file descriptor
- flockfile()
- Acquire ownership of a file
- fstat(), fstat64()
- Obtain information about an open file, given a file descriptor
- fstatvfs(), fstatvfs64()
- Get filesystem information, given a file descriptor
- fsync()
- Write queued file and filesystem data to disk
- ftrylockfile()
- Acquire ownership of a file, without blocking
- funlockfile()
- Release ownership of a file
- GETIOVBASE()
- Get the base member of an iov_t structure
- GETIOVLEN()
- Get the length member of an iov_t structure
- getdtablesize()
- Get the size of the file descriptor table
- getrusage()
- Get information about resource utilization
- in8()
- Read an 8-bit value from a port
- in8s()
- Read 8-bit values from a port
- in16(), inbe16(), inle16()
- Read a 16-bit value from a port
- in16s()
- Read 16-bit values from a port
- in32(), inbe32(), inle32()
- Read a 32-bit value from a port
- in32s()
- Read 32-bit values from a port
- ioctl()
- Control device
- link()
- Create a link to an existing file
- lseek(), lseek64()
- Set the current file position at the OS level
- lio_listio()
- Initiate a list of I/O requests
- mknod()
- Make a new filesystem entry point
- modem_open()
- Open a serial port
- modem_read()
- Read bytes from a file descriptor
- modem_script()
- Run a script on a device
- modem_write()
- Write a string to a device
- name_close()
- Close the file descriptor obtained with name_open()
- name_open()
- Open a name for a server connection
- open(), open64()
- Open a file
- openfd()
- Open for private access a file associated with a given descriptor
- out8()
- Write an 8-bit value to a port
- out8s()
- Write 8-bit values to a port
- out16(), outbe16(), outle16()
- Write a 16-bit value to a port
- out16s()
- Write 16-bit values to a port
- out32(), outbe32(), outle32()
- Write a 32-bit value to a port
- out32s()
- Write 32-bit values to a port
- pathmgr_symlink()
- Create a symlink in the process manager
- pathmgr_unlink()
- Remove the link created by pathmgr_symlink()
- pipe()
- Create a pipe
- poll()
- Multiplex input/output over a set of file descriptors
- popen()
- Execute a command, creating a pipe to it
- pread(), pread64()
- Read from a file without moving the file pointer
- rdchk()
- Check to see if a read is likely to succeed
- read()
- Read bytes from a file
- readblock()
- Read blocks of data from a file
- readcond()
- Read data from a terminal device
- readlink()
- Place the contents of a symbolic link into a buffer
- readv()
- Read bytes from a file
- select()
- Check for files that are ready for reading or writing
- SETIOV()
- Fill in the fields of an iov_t structure
- sopen()
- Open a file for shared access
- sopenfd()
- Open for shared access a file associated with a given descriptor
- symlink()
- Create a symbolic link to a path
- tcischars()
- Determine the number of characters waiting to be read
- tell(), tell64()
- Determine the current file position
- umask()
- Set the file mode creation mask for the process
- uname()
- Get information about the operating system
- unlink()
- Delete a file
- write()
- Write bytes to a file
- writeblock()
- Write blocks of data to a file
- writev()
- Write bytes to a file
The following functions are defined:
- pccard_arm()
- Arm the devp-pccard server
- pccard_attach()
- Attach to the devp-pccard server
- pccard_detach()
- Detach from the devp-pccard server
- pccard_info()
- Obtain socket information from the devp-pccard server
- pccard_lock()
- Lock the window of the card in the selected socket
- pccard_raw_read()
- Read the raw CIS data from the PC Card
- pccard_unlock()
- Unlock the window of the card in the selected socket
These functions are for invoking Intel 80x86 and other
processor-related functions directly from a program.
Functions that apply to the Intel 8086 CPU apply to that
family including the 80286, 80386, 80486 and Pentium processors.
You'll also find endian-related functions listed here.
The following functions are defined:
- ENDIAN_BE16()
- Return a big-endian 16-bit value in native format
- ENDIAN_BE32()
- Return a big-endian 32-bit value in native format
- ENDIAN_BE64()
- Return a big-endian 64-bit value in native format
- ENDIAN_LE16()
- Return a little-endian 16-bit value in native format
- ENDIAN_LE32()
- Return a little-endian 32-bit value in native format
- ENDIAN_LE64()
- Return a little-endian 64-bit value in native format
- ENDIAN_RET16()
- Return an endian-swapped 16-bit value
- ENDIAN_RET32()
- Return an endian-swapped 32-bit value
- ENDIAN_RET64()
- Return an endian-swapped 64-bit value
- ENDIAN_SWAP16()
- Endian-swap a 16-bit value in place
- ENDIAN_SWAP32()
- Endian-swap a 32-bit value in place
- ENDIAN_SWAP64()
- Endian-swap a 64-bit value in place
- _intr_v86()
- Execute a real-mode software interrupt
- offsetof()
- Return the offset of an element within a structure
- sysmgr_reboot()
- Reboot a QNX Neutrino system
These functions deal with process identification, user identification,
process groups, system identification, system time and process time,
environment variables, terminal identification, and configurable
system variables:
- _argc
- The number of arguments passed to main()
- _argv
- A pointer to the vector of arguments passed to main()
- _auxv
- A pointer to a vector of auxiliary arguments to main()
- clearenv()
- Clear the process environment area
- confstr()
- Get configuration-defined string values
- ctermid()
- Generate the pathname of the current controlling terminal
- endutent()
- Close the current user-information file
- environ
- Pointer to the process's environment variables
- err(), errx()
- Display a formatted error message, and then exit
- errno
- Global error variable
- getegid()
- Get the effective group ID
- getenv()
- Get the value of an environment variable
- geteuid()
- Get the effective user ID
- getgid()
- Get the group ID
- getgrouplist()
- Determine the group access list for a user
- getgroups()
- Get the supplementary group IDs of the calling process
- getlogin()
- Get the user name associated with the calling process
- getlogin_r()
- Get the user name associated with the calling process
- getopt()
- Parse options from a command line
- getpgid()
- Get a process's group ID
- getpgrp()
- Get the process group
- getpid()
- Get the process ID
- getppid()
- Get the parent process ID
- getsid()
- Get the session ID of a process
- getuid()
- Get the user ID
- getutent()
- Read the next entry from the user-information file
- getutid()
- Search for an entry in the user-information file
- getutline()
- Get an entry from the user-information file
- initgroups()
- Initialize the supplementary group access list
- isatty()
- Test to see if a file descriptor is associated with a terminal
- login_tty()
- Prepare for a login in a tty
- main()
- The function where program execution begins
- ND_NODE_CMP()
- Compare two node descriptor IDs
- netmgr_ndtostr()
- Convert a node descriptor into a string
- netmgr_remote_nd()
- Get a node descriptor that's relative to a remote node
- netmgr_strtond()
- Convert a string into a node descriptor
- __progname
- The basename of the program being executed
- putenv()
- Add, change, or delete an environment variable
- pututline()
- Write an entry in the user-information file
- searchenv()
- Search the directories listed in an environment variable
- setegid()
- Set the effective group ID for a process
- setenv()
- Set one or more environment variables
- seteuid()
- Set the effective user ID
- setgid()
- Set the real, effective and saved group IDs
- setgroups()
- Set supplementary group IDs
- setlocale()
- Set a program's locale.
- setpgid()
- Join or create a process group
- setpgrp()
- Set the process group
- setregid()
- Set real and effective group IDs
- setreuid()
- Set real and effect user IDs
- setsid()
- Create a new session
- setuid()
- Set the real, effective and saved user IDs
- setutent()
- Return to the beginning of the user-information file
- strerror()
- Convert an error number into an error message
- sysconf()
- Return the value of a configurable system limit
- ttyname()
- Get a fully qualified pathname for a file
- ttyname_r()
- Get a fully qualified pathname for a file
- unsetenv()
- Remove an environment variable
- utmp
- Entry in a user-information file
- utmpname()
- Change the name of the user-information file
- verr(), verrx()
- Display a formatted error message, and then exit (varargs)
- vwarn(), vwarnx()
- Formatted error message (varargs)
- warn(), warnx()
- Formatted error message
These functions deal with: process creation, execution, and termination;
signal handling; and timer operations.
When you start a new process, it replaces the existing process if:
- You specify P_OVERLAY when calling one of the
spawn* functions.
- You call one of the exec* routines.
The existing process may be suspended while the new process
executes (control continues at the point following the place where the
new process was started) in the following situations:
- You specify P_WAIT when calling one of the
spawn* functions.
- You call system().
The following functions are defined:
- abort()
- Raise the SIGABRT signal to terminate program execution
- alarm()
- Schedule an alarm
- assert()
- Print a diagnostic message and optionally terminate the
program
- atexit()
- Register functions to be called when the program terminates
normally
- ConnectAttach(), ConnectAttach_r()
- Establish a connection between a process and a channel
- ConnectClientInfo(), ConnectClientInfo_r()
- Store information about a client connection
- ConnectDetach(), ConnectDetach_r()
- Break a connection between a process and a channel
- ConnectFlags(), ConnectFlags_r()
- Modify the flags associated with a connection
- ConnectServerInfo(), ConnectServerInfo_r()
- Store information about a connection
- daemon()
- Run a program in the background
- DebugBreak()
- Enter the process debugger
- DebugKDBreak()
- Enter the kernel debugger
- DebugKDOutput()
- Print text with the kernel debugger
- delay()
- Suspend a process for a given length of time
- dladdr()
- Translate an address to symbolic information
- dlclose()
- Close a shared object
- dlerror()
- Get dynamic loading diagnostic information
- dlopen()
- Gain access to an executable object file
- dlsym()
- Get the address of a symbol in a shared object
- execl()
- Execute a file
- execle()
- Execute a file
- execlp()
- Execute a file
- execlpe()
- Execute a file
- execv()
- Execute a file
- execve()
- Execute a file
- execvp()
- Execute a file
- execvpe()
- Execute a file
- _exit()
- Terminate the program
- exit()
- Terminate the program
- fork()
- Create a new process
- forkpty()
- Create a new process operating in a pseudo-tty
- getrlimit(), getrlimit64()
- Get the limit on a system resource
- getprio()
- Get the priority of a given process
- InterruptAttach(), InterruptAttach_r()
- Attach an interrupt handler to an interrupt source
- InterruptAttachEvent(), InterruptAttachEvent_r()
- Attach an event to an interrupt source
- InterruptDetach(), InterruptDetach_r()
- Detach an interrupt handler by ID
- InterruptDisable()
- Disable hardware interrupts
- InterruptEnable()
- Enable hardware interrupts
- InterruptHookIdle()
- Attach an "idle" interrupt handler
- InterruptHookTrace()
- Attach the pseudo interrupt handler that the instrumented module uses
- InterruptLock()
- Protect critical sections of an interrupt handler
- InterruptMask()
- Disable a hardware interrupt
- InterruptUnlock()
- Release a critical section locked with InterruptLock()
- InterruptUnmask()
- Enable a hardware interrupt
- InterruptWait(), InterruptWait_r()
- Wait for a hardware interrupt
- _intr_v86()
- Execute a real-mode software interrupt
- kill()
- Send a signal to a process or a group of processes
- killpg()
- Send a signal to a process group
- nap()
- Sleep for a given number of milliseconds
- napms()
- Sleep for a given number of milliseconds
- nice()
- Change the priority of a process
- openpty()
- Find an available pseudo-tty
- procmgr_daemon()
- Run a process in the background
- procmgr_event_notify()
- Ask to be notified of system-wide events
- procmgr_event_trigger()
- Trigger a global system event
- procmgr_guardian()
- Let a daemon process takeover as parent = guardian
- procmgr_session()
- Provide process manager session support
- raise()
- Signal an exceptional condition
- SchedCtl()
- Control the adaptive partitioning scheduler
- SchedGet(), SchedGet_r()
- Get the scheduling policy for a thread
- SchedInfo(), SchedInfo_r()
- Get scheduler information
- SchedSet(), SchedSet_r()
- Set the scheduling policy for a thread
- SchedYield(), SchedYield_r()
- Yield to other threads
- setitimer()
- Set the value of an interval timer
- setprio()
- Set the priority of a process
- setrlimit(), setrlimit64()
- Set the limit on a system resource
- sigaction()
- Examine or specify the action associated with a signal
- sigaddset()
- Add a signal to a set
- sigblock()
- Add to the mask of signals to block
- sigdelset()
- Delete a signal from a set
- sigemptyset()
- Initialize a set to contain no signals
- sigfillset()
- Initialize a set to contain all signals
- sigismember()
- See if a given signal is in a given set
- sigmask()
- Construct a mask for a signal number
- signal()
- Set handling for exceptional conditions
- SignalAction(), SignalAction_r()
- Examine and/or specify actions for signals
- SignalKill(), SignalKill_r()
- Send a signal to a process group, process or thread
- SignalProcmask(), SignalProcmask_r()
- Modify or examine the signal blocked mask of a thread
- SignalSuspend(), SignalSuspend_r()
- Suspend a process until a signal is received
- SignalWaitinfo(), SignalWaitinfo_r()
- Select a pending signal
- sigpause()
- Wait for a signal
- sigpending()
- Examine the set of pending, masked signals for a process
- sigprocmask()
- Examine or change the signal mask for a process
- sigqueue()
- Queue a signal to a process
- sigsetmask()
- Set the mask of signals to block
- sigsuspend()
- Replace the signal mask, and then suspend the process
- sigtimedwait()
- Wait for a signal or a timeout
- sigunblock()
- Unblock signals
- sigwait()
- Wait for a pending signal
- sigwaitinfo()
- Wait for a pending signal and get its information
- sleep()
- Suspend a process for a given length of time
- spawn()
- Create and execute a new child process
- spawnl()
- Create and execute a new child process
- spawnle()
- Create and execute a new child process
- spawnlp()
- Create and execute a new child process
- spawnlpe()
- Create and execute a new child process
- spawnp()
- Create and execute a new child process
- spawnv()
- Create and execute a new child process
- spawnve()
- Create and execute a new child process
- spawnvp()
- Create and execute a new child process
- spawnvpe()
- Create and execute a new child process
- SyncCondvarSignal(), SyncCondvarSignal_r()
- Wake up any threads that are blocked on a synchronization object
- SyncCondvarWait(), SyncCondvarWait_r()
- Block a thread on a synchronization object
- SyncCtl(), SyncCtl_r()
- Perform an operation on a synchronization object
- SyncDestroy(), SyncDestroy_r()
- Destroy a synchronization object
- SyncMutexEvent(), SyncMutexEvent_r()
- Attach an event to a mutex
- SyncMutexLock(), SyncMutexLock_r()
- Lock a mutex synchronization object
- SyncMutexUnlock(), SyncMutexUnlock_r()
- Unlock a mutex synchronization object
- SyncMutexRevive(), SyncMutexRevive_r()
- Revive a mutex that's in the DEAD state
- SyncSemPost(), SyncSemPost_r()
- Increment a semaphore
- SyncSemWait(), SyncSemWait_r()
- Wait on a semaphore
- system()
- Execute a system command
- SYSPAGE_CPU_ENTRY()
- Return a CPU-specific entry from the system page
- SYSPAGE_ENTRY()
- Return an entry from the system page
- _syspage_ptr
- A pointer to the system page
- ThreadCancel(), ThreadCancel_r()
- Cancel a thread
- ThreadCreate(), ThreadCreate_r()
- Create a new thread
- ThreadCtl(), ThreadCtl_r()
- Control a thread
- ThreadDestroy(), ThreadDestroy_r()
- Destroy a thread immediately
- ThreadDetach(), ThreadDetach_r()
- Detach a thread from a process
- ThreadJoin(), ThreadJoin_r()
- Block until a thread terminates
- TraceEvent()
- Trace kernel events
- ualarm()
- Schedule an alarm
- usleep()
- Suspend a thread for a given number of microseconds
- vfork()
- Spawn a new process and block the parent
- wait()
- Wait for the status of a terminated child process
- wait3()
- Wait for a child process to change state
- wait4()
- Wait for a child process to terminate or stop
- waitid()
- Wait for a child process to change state
- waitpid()
- Suspend the calling process
There are eight spawn*() and exec*()
functions each. The * is one to three letters, where:
- l or v (one is required) indicates the way the process parameters are passed
- p (optional) indicates that the PATH environment variable is searched to locate the program for the process
- e (optional) indicates that the environment variables are being passed
These functions provide realtime timer capabilities:
- clock_getres()
- Get the resolution of the clock
- clock_gettime()
- Get the current time of a clock
- clock_nanosleep()
- High resolution sleep with specifiable clock
- clock_settime()
- Set a clock
- getitimer()
- Get the value of an interval timer
- nanosleep()
- Suspend process until a timeout or signal occurs
- nanospin()
- Busy-wait without thread blocking for a period of time
- nanospin_calibrate()
- Calibrate before calling nanospin*()
- nanospin_count()
- Busy-wait without blocking for a number of iterations
- nanospin_ns()
- Busy-wait without blocking for a period of time
- nanospin_ns_to_count()
- Convert a time in nanoseconds into a number of iterations
- sched_getparam()
- Get the current priority of a process
- sched_get_priority_adjust()
- Calculate the allowable priority for the scheduling policy
- sched_get_priority_max()
- Get the maximum value for the scheduling policy
- sched_get_priority_min()
- Get the minimum value for the scheduling policy
- sched_getscheduler()
- Get the current scheduling policy for a process
- sched_param
- Structure that describes scheduling parameters
- sched_rr_get_interval()
- Get the execution time limit of a process
- sched_setparam()
- Change the priority of a process
- sched_setscheduler()
- Change the priority and scheduling policy of a process
- sched_yield()
- Yield to other READY processes at the same priority
- timer_create()
- Create a timer
- timer_delete()
- Delete a timer
- timer_getexpstatus()
- Get the expiry status of a timer
- timer_getoverrun()
- Return the number of timer overruns
- timer_gettime()
- Get the amount of time left on a timer
- timer_settime()
- Set the expiration time for a timer
These functions help you create resource managers.
For an overview of these functions, see
"Components of a resource manager"
in the Writing a Resource Manager chapter of the
QNX Neutrino Programmer's Guide.
- _io_connect
- Structure of a resource manager's connect message
- _io_connect_ftype_reply
- Structure of a connect message giving a status and a file type
- _io_connect_link_reply
- Structure of a connect message that redirects a client to another resource
- iofdinfo()
- Retrieve server attributes
- iofunc_attr_init()
- Initialize the default attribute structure
- iofunc_attr_lock()
- Lock the attribute structure
- iofunc_attr_t
- Attribute structure
- iofunc_attr_trylock()
- Try to lock the attribute structure
- iofunc_attr_unlock()
- Unlock the attribute structure
- iofunc_check_access()
- Check access permissions
- iofunc_chmod()
- Handle an _IO_CHMOD message
- iofunc_chmod_default()
- Default handler for _IO_CHMOD messages
- iofunc_chown()
- Handle an _IO_CHOWN message
- iofunc_chown_default()
- Default handler for _IO_CHOWN messages
- iofunc_client_info()
- Return information about a client connection
- iofunc_close_dup()
- Frees all locks allocated for the client process
- iofunc_close_dup_default()
- Default handler for _IO_CLOSE messages
- iofunc_close_ocb()
- Return the memory allocated for an OCB
- iofunc_close_ocb_default()
- Return the memory allocated for an OCB
- iofunc_devctl()
- Handle an _IO_DEVCTL message
- iofunc_devctl_default()
- Default handler for _IO_DEVCTL messages
- iofunc_fdinfo()
- Handle an _IO_FDINFO message
- iofunc_fdinfo_default()
- Default handler for _IO_FDINFO messages
- iofunc_func_init()
- Initialize the default POSIX-layer function tables
- iofunc_link()
- Link two directories
- iofunc_lock()
- Lock a resource
- iofunc_lock_calloc()
- Allocate memory to lock structures
- iofunc_lock_default()
- Default handler for _IO_LOCK messages
- iofunc_lock_free()
- Return memory allocated for lock structures
- iofunc_lock_ocb_default()
- Default handler for the lock_ocb callout
- iofunc_lseek()
- Handle an _IO_LSEEK message
- iofunc_lseek_default()
- Default handler for _IO_LSEEK message
- iofunc_mknod()
- Verify a client's ability to make a new filesystem entry point
- iofunc_mmap()
- Handle an IO_MMAP message
- iofunc_mmap_default()
- Default handler for IO_MMAP messages
- iofunc_notify()
- Install, poll, or remove a notification handler
- iofunc_notify_remove()
- Remove notification entries from list
- iofunc_notify_trigger()
- Send notifications to queued clients
- iofunc_ocb_attach()
- Initialize an Open Control Block
- iofunc_ocb_calloc()
- Allocate an iofunc OCB
- iofunc_ocb_detach()
- Release OCB resources
- iofunc_ocb_free()
- Deallocate an iofunc OCBs memory
- iofunc_ocb