Nick Garnett - Red Hat Inc.
Note: This is a draft document that is being distributed to gather public comments. Comments should be sent to the EL/IX discussion list athttp://sourceware.cygnus.com/elix.
This website also provides access to the latest versions of this API specification together with other documents about EL/IX and archives of the mailing lists.
This document describes the proposed API for EL/IX . The goals for this API are:
EL/IX achieves these goals by identifying a subset of the POSIX.1 and ISO C99 standards, together with some extensions gleaned from Linux/GNU, BSD and SYSV, that are applicable to embedded applications. The result is an API that is somewhat smaller than the union of those standards that eliminates unnecessary or duplicated functionality fairly ruthlessly.
The following API levels are defined and each function in the API is assigned to a minimum level. Functions are present in that level and all higher levels.
The following option letters are added to the level numbers for some API functions when the presence of that function is also controlled by some other component (such as the presence of a file system), or is a user-selectable option (such as signal handling).
In some places this option is additionally annotated with sub-options (in square brackets) that indicate the properties that the file system must support for the given function.
In September 1999 the IEEE published standard 1003.13 ``Standardized Application Environment Profile - POSIX Realtime Application Support (AEP)''. This is a collection of four subsets of the POSIX.1 standard aimed at real time systems. This section examines the relationship between EL/IX and POSIX.13.
POSIX.13 presents four real time system profiles. The Minimal Realtime System Profile provides the basic set of functionality for a single process deeply embedded system. The Realtime Controller System Profile extends the minimal profile with support for a file system and asynchronous I/O. The Dedicated Realtime System Profile extends the minimal profile with support for multiple processes, but has more primitive support for file systems than the controller profile. Finally the Multi-Purpose Realtime System Profile is a superset of the other profiles and essentially consists of the entire POSIX.1, POSIX.1b and POSIX.1c standards.
These four profiles are superficially similar to our four levels although the controller and dedicated profiles are mutually exclusive in some areas. To ensure maximum compatibility, the EL/IX levels have been adjusted to allow each of the POSIX.13 profiles to be a complete subset of the closest matching level.
Each of the POSIX.13 profiles may be manufactured out of the matching EL/IX level by enabling certain options:
The base of EL/IX functionality is the POSIX.1 Specification (ISO/IEC 9945-1).
This document follows the sections of the POSIX.1 specification. The reader is referred to that document for details of the syntax and semantics of the functions described here.
| Function | Level | Options | Notes |
| fork() | 3 | ||
| execl() | 3 | ||
| execv() | 3 | ||
| execle() | 3 | ||
| execve() | 3 | ||
| execlp() | 3 | ||
| execvp() | 3 | ||
| pthread_atfork() | 3 |
| Function | Level | Options | Notes |
| wait() | 3 | ||
| waitpid() | 3 | ||
| _exit() | 3 |
These first few entries describe functionality that is orthogonal to the actual functions.
| Function | Level | Options | Notes |
| Signal masks | 1 | s m o | |
| EINTR wakeup | 1 | s m o | |
| Notification mechanisms | 1 | s m o | |
| Real time signals | 1 | s o | |
| Translate exceptions to signals | 1 | s m o | |
| kill() | 1 | s m r | |
| sigemptyset() | 1 | s m r | |
| sigfillset() | 1 | s m r | |
| sigaddset() | 1 | s m r | |
| sigdelset() | 1 | s m r | |
| sigismember() | 1 | s m r | |
| sigaction() | 1 | s m r | |
| pthread_sigmask() | 1 | s m | |
| sigprocmask() | 1 | s m r | |
| sigpending() | 1 | s m r | |
| sigsuspend() | 1 | s m r | |
| sigwait() | 1 | s m | |
| sigwaitinfo() | 1 | s m | |
| sigtimedwait() | 1 | s m | |
| sigqueue() | 1 | s m | |
| pthread_kill() | 1 | s m |
| Function | Level | Options | Notes |
| alarm() | 1 | s m r | |
| pause() | 1 | s m r | |
| sleep() | 1 |
Some of these may be useful to aid porting of existing code, hence they are not all just marked level 3 or 4.
| Function | Level | Options | Notes |
| getpid() | 1 | c | 1 |
| getppid() | 1 | c | 1 |
Note 1: At level 1 these functions simply return a constant value.
| Function | Level | Options | Notes |
| getuid() | 1 | c | 1 |
| geteuid() | 1 | c | 1 |
| getgid() | 1 | c | 1 |
| getegid() | 1 | c | 1 |
| setuid() | 4 | ||
| setgid() | 4 | ||
| getgroups() | 4 | ||
| getlogin() | 4 | ||
| getlogin_r() | 4 |
Note 1: At level 1 these functions simply return a constant value.
| Function | Level | Options | Notes |
| getpgrp() | 4 | ||
| setsid() | 4 | ||
| setpgid() | 4 |
| Function | Level | Options | Notes |
| uname() | 1 |
| Function | Level | Options | Notes |
| time() | 1 | r | |
| times() | 1 | m | 1 |
Note 1: At level 1 only some of the return values in the struct tms buffer will be filled in. At level 2 there will never be any child processes to be reported in the tms_cutime and tms_cstime fields.
Possibly have a configuration-time defined static environment to support this.
| Function | Level | Options | Notes |
| getenv() | 1 |
| Function | Level | Options | Notes |
| ctermid() | 2 | t | |
| ttyname() | 2 | t | |
| ttyname_r() | 2 | t | |
| isatty() | 1 | f t n |
Under an RTOS only some of these variables will be implemented.
| Function | Level | Options | Notes |
| sysconf() | 1 | m r |
| Function | Level | Options | Notes |
| opendir() | 1 | f[d] m | |
| readdir() | 1 | f[d] m | |
| readdir_r() | 1 | f[d] m | |
| rewinddir() | 1 | f[d] m | |
| closedir() | 1 | f[d] m |
| Function | Level | Options | Notes |
| chdir() | 1 | f[d] | |
| getcwd() | 1 | f[d] |
| Function | Level | Options | Notes |
| open() | 1 | f t m | 1 |
| creat() | 1 | f[m] | |
| umask() | 2 | f[mp] | |
| link() | 2 | f[ml] |
Note 1: At level 1 only a subset of the flags may be supported, and then only if the underlying file system or device provides support.
| Function | Level | Options | Notes |
| mkdir() | 1 | f[md] | |
| mkfifo() | 3 | o f[m] |
| Function | Level | Options | Notes |
| unlink() | 1 | f[m] | |
| rmdir() | 1 | f[md] | |
| rename() | 1 | f[m] |
| Function | Level | Options | Notes |
| stat() | 1 | f m | 1 |
| fstat() | 1 | f m | 1 |
| access() | 1 | f | |
| chmod() | 2 | f[mp] | |
| fchmod() | 2 | f[mp] | |
| chown() | 2 | f[mp] | |
| utime() | 2 | f | |
| ftruncate() | 4 | ||
| pathconf() | 2 | m | |
| fpathconf() | 2 | m |
Note 1: At level 1 some fields in the struct stat structure may not be filled in, this may also depend on the supporting file system.
| Function | Level | Options | Notes |
| pipe() | 3 |
| Function | Level | Options | Notes |
| dup() | 1 | f t n | |
| dup2() | 1 | f t n | |
| close() | 1 | f t n |
| Function | Level | Options | Notes |
| read() | 1 | f t n | |
| write() | 1 | f t n |
| Function | Level | Options | Notes |
| fcntl() | 2 | ||
| lseek() | 1 | f |
| Function | Level | Options | Notes |
| fsync() | 1 | f | |
| fdatasync() | 1 | f |
Completion of asynchronous IO operations is notified by invoking a sigevent object. In certain configurations this may be restricted to only specifying SIGEV_THREAD as the notification type.
| Function | Level | Options | Notes |
| aio_read() | 1 | o f t n | |
| aio_write() | 1 | o f t n | |
| lio_listio() | 1 | o f t n | |
| aio_error() | 1 | o f t n | |
| aio_return() | 1 | o f t n | |
| aio_cancel() | 1 | o f t n | |
| aio_suspend() | 1 | o f t n | |
| aio_fsync() | 1 | o f t n |
These are only present if we want to control the behaviour of a serial line. Even then, most of the "translation" stuff will be omitted ( at level 1 at least ) and all job control functionality is bannished to level 4.
| Function | Level | Options | Notes |
| tcgetattr() | 1 | t | |
| tcsetattr() | 1 | t | |
| cfgetospeed() | 1 | t | |
| cfgetispeed() | 1 | t | |
| cfsetospeed() | 1 | t | |
| cfsetispeed() | 1 | t | |
| tcsendbreak() | 1 | t | |
| tcdrain() | 1 | t | |
| tcflush() | 1 | t | |
| tcflow() | 1 | t | |
| tcgetpgrp() | 4 | ||
| tcsetpgrp() | 4 |
Modifications and enhancements to the ISO C API.
| Function | Level | Options | Notes |
| setlocale() | 1 | l | |
| fileno() | 1 | f t n | |
| fdopen() | 1 | f t n | |
| flockfile() | 1 | ||
| ftrylockfile() | 1 | ||
| funlockfile() | 1 | ||
| getc_unlocked() | 1 | ||
| getchar_unlocked() | 1 | ||
| putc_unlocked() | 1 | ||
| putchar_unlocked() | 1 | ||
| sigsetjmp() | 1 | s r | |
| siglongjmp() | 1 | s r | |
| tzset() | 1 | o | 1 |
| strtok_r() | 1 | ||
| asctime_r() | 1 | ||
| ctime_r() | 1 | ||
| gmtime_r() | 1 | ||
| localtime_r() | 1 | ||
| rand_r() | 1 |
Note 1: At level 1, and maybe others, we only provide a very reduced timezone implementation, probably relying on external information (such as user input) to determine the UTC offset, DST change dates and timezone abbreviations.
Access to group and password databases.
| Function | Level | Options | Notes |
| getgrgid() | 4 | ||
| getgrgid_r() | 4 | ||
| getgrnam() | 4 | ||
| getgrnam_r() | 4 | ||
| getpwuid() | 4 | ||
| getpwuid_r() | 4 | ||
| getpwnam() | 4 | ||
| getpwnam_r() | 4 |
This section of POSIX.1 describes the tar and cpio formats for data archives. These are irrelevant for embedded applications.
| Function | Level | Options | Notes |
| sem_init() | 1 | r | |
| sem_destroy() | 1 | r | |
| sem_open() | 4 | ||
| sem_close() | 4 | ||
| sem_unlink() | 4 | ||
| sem_wait() | 1 | r | |
| sem_trywait() | 1 | r | |
| sem_post() | 1 | r | |
| sem_getvalue() | 1 | r |
| Function | Level | Options | Notes |
| pthread_mutexattr_init() | 1 | r | |
| pthread_mutexattr_destroy() | 1 | r | |
| pthread_mutexattr_getpshared() | 1 | r | |
| pthread_mutexattr_setpshared() | 1 | r | |
| pthread_mutex_init() | 1 | r | |
| pthread_mutex_destroy() | 1 | r | |
| pthread_mutex_lock() | 1 | r | |
| pthread_mutex_trylock() | 1 | r | |
| pthread_mutex_unlock() | 1 | r |
| Function | Level | Options | Notes |
| pthread_condattr_init() | 1 | r | |
| pthread_condattr_destroy() | 1 | r | |
| pthread_condattr_getpshared() | 1 | r | |
| pthread_condattr_setpshared() | 1 | r | |
| pthread_cond_init() | 1 | r | |
| pthread_cond_destroy() | 1 | r | |
| pthread_cond_signal() | 1 | r | |
| pthread_cond_broadcast() | 1 | r | |
| pthread_cond_wait() | 1 | r | |
| pthread_cond_timedwait() | 1 | r |
| Function | Level | Options | Notes |
| mlockall() | 1 | M[l] | |
| munlockall() | 1 | M[l] | |
| mlock() | 1 | M[l] | |
| munlock() | 1 | M[l] | |
| mmap() | 1 | M[fo] | |
| munmap() | 1 | M[fo] | |
| mprotect() | 2 | M[p] | |
| msync() | 2 | M[f] |
| Function | Level | Options | Notes |
| shm_open() | 1 | M[op] | |
| shm_unlink() | 1 | M[o] |
At level 1 we define SCHED_OTHER to equal SCHED_RR. This equality is allowed by POSIX.1.
| Function | Level | Options | Notes |
| sched_setparam() | 3 | r | |
| sched_getparam() | 3 | r | |
| sched_setscheduler() | 3 | r | |
| sched_getscheduler() | 3 | r | |
| sched_yield() | 1 | r | |
| sched_get_priority_max() | 1 | r | |
| sched_get_priority_min() | 1 | r | |
| sched_rr_get_interval() | 1 | r |
| Function | Level | Options | Notes |
| pthread_attr_setscope() | 1 | r | |
| pthread_attr_getscope() | 1 | r | |
| pthread_attr_setinheritsched() | 1 | r | |
| pthread_attr_getinheritsched() | 1 | r | |
| pthread_attr_setschedpolicy() | 1 | r | |
| pthread_attr_getschedpolicy() | 1 | r | |
| pthread_attr_setschedparam() | 1 | r | |
| pthread_attr_getschedparam() | 1 | r | |
| pthread_getschedparam() | 1 | r | |
| pthread_setschedparam() | 1 | r |
| Function | Level | Options | Notes |
| pthread_mutexattr_setprotocol() | 1 | r | |
| pthread_mutexattr_getprotocol() | 1 | r | |
| pthread_mutexattr_setprioceiling() | 1 | r | |
| pthread_mutexattr_getprioceiling() | 1 | r | |
| pthread_mutex_setprioceiling() | 1 | r | |
| pthread_mutex_getprioceiling() | 1 | r |
Note that timers indicate that they have expired by raising a signal. This implies that we must have some form of signal support present all the time, or that timers are dependent on the presence of signal handling. Alternatively we must insist that the sigevent structure supplied to timer_create() only specify SIGEV_THREAD as the notification type.
There is also some question over the presence of these functions in current Linux releases.
| Function | Level | Options | Notes |
| clock_settime() | 1 | r | |
| clock_gettime() | 1 | r | |
| clock_getres() | 1 | r | |
| timer_create() | 1 | s r | |
| timer_delete() | 1 | s r | |
| timer_settime() | 1 | s r | |
| timer_gettime() | 1 | s r | |
| timer_getoverrun() | 1 | s r | |
| nanosleep() | 1 | r |
These are more oriented towards inter-process communications rather than intra-process, where the program should be using semaphores, mutexes etc. At level 1 we may need to provide a fake name space for the mq_open(), and mq_unlink() to work within. The same considerations apply to sem_open(), sem_close() and sem_unlink().
| Function | Level | Options | Notes |
| mq_open() | 1 | r | |
| mq_close() | 1 | r | |
| mq_unlink() | 1 | r | |
| mq_send() | 1 | r | |
| mq_receive() | 1 | r | |
| mq_notify() | 1 | r | |
| mq_setattr() | 1 | r | |
| mq_getattr() | 1 | r |
| Function | Level | Options | Notes |
| pthread_attr_init() | 1 | r | |
| pthread_attr_destroy() | 1 | r | |
| pthread_attr_setstacksize() | 1 | r | |
| pthread_attr_getstacksize() | 1 | r | |
| pthread_attr_setstackaddr() | 1 | r | |
| pthread_attr_getstackaddr() | 1 | r | |
| pthread_attr_setdetachstate() | 1 | r | |
| pthread_attr_getdetachstate() | 1 | r | |
| pthread_create() | 1 | r | |
| pthread_join() | 1 | r | |
| pthread_detach() | 1 | r | |
| pthread_exit() | 1 | r | |
| pthread_self() | 1 | r | |
| pthread_equal() | 1 | r | |
| pthread_once() | 1 | r |
| Function | Level | Options | Notes |
| pthread_key_create() | 1 | r | |
| pthread_setspecific() | 1 | r | |
| pthread_getspecific() | 1 | r | |
| pthread_key_delete() | 1 | r |
| Function | Level | Options | Notes |
| pthread_cancel() | 1 | o r | |
| pthread_setcancelstate() | 1 | o r | |
| pthread_setcanceltype() | 1 | o r | |
| pthread_testcancel() | 1 | o r | |
| pthread_cleanup_push() | 1 | o r | |
| pthread_cleanup_pop() | 1 | o r |
The list of functions here is based the documentation for Glibc V2.1, cross checked with the headers and the ISO C 1999 standard. Some things may have been missed, and there is obviously a lot more here and in Glibc than just ISO C.
A slight difficulty with non-ISO C-standard functionality here is that while on Linux we can use glibc, we may not be able to use it on an RTOS due to the viral nature of GPL. Not all the glibc functionality will be available in existing RTOS libraries and would have to be implemented from scratch. The distribution of functionality between levels 1 and 2 takes this into account.
Note: ISO C should usually be read as ISO C99 plus any POSIX defined extensions such as the reentrant variants of some functions.
Conversion of error codes to strings: strerror() and perror(). strerror_r() is a GNU extension.
The main problem with these functions is the memory needed to store the array of strings, hence these must be optional.
| Function | Level | Options | Notes |
| strerror() | 1 | o l | |
| strerror_r() | 1 | o l | |
| perror() | 1 | o l |
Only the first four of these are ISO C, the rest are GNU extensions.
| Function | Level | Options | Notes |
| malloc() | 1 | ||
| free() | 1 | ||
| realloc() | 1 | ||
| calloc() | 1 | ||
| memalign() | 2 | ||
| valloc() | 2 | ||
| pvalloc() | 2 | ||
| mallopt() | 2 | ||
| mcheck() | 2 | ||
| mprobe() | 2 | ||
| mallinfo() | 1 |
ISO C character classification functions, plus GNU extension isblank() and BSD/SVID extension isascii().
| Function | Level | Options | Notes |
| ISO C functions | 1 | l | |
| Extensions | 2 | l |
ISO C case conversion functions plus BSD/SVID toascii() and SVID _tolower() and _toupper().
| Function | Level | Options | Notes |
| ISO C functions | 1 | l | |
| Extensions | 2 | l |
ISO C wide character classification functions, plus some GNU extensions.
| Function | Level | Options | Notes |
| ISO C functions | 1 | l | |
| Extensions | 2 | l |
ISO C wide character case conversion functions.
| Function | Level | Options | Notes |
| ISO C functions | 1 | l | |
| Extensions | 2 | l |
ISO C strlen() plus GNU strnlen() extension.
| Function | Level | Options | Notes |
| strlen() | 1 | l | |
| strnlen() | 1 | l |
ISO C mem* and str* copy functions plus some GNU extensions and some BSD compatibility functions such as bcopy().
| Function | Level | Options | Notes |
| ISO C functions | 1 | l | |
| Extensions | 2 | l |
ISO C mem* and str* copy functions plus some GNU extensions and some BSD compatibility functions.
| Function | Level | Options | Notes |
| ISO C functions | 1 | l | |
| Extensions | 2 | l |
ISO C collation functions strcoll() and strxfrm().
| Function | Level | Options | Notes |
| strcoll() | 1 | l | |
| strxfrm() | 1 | l |
ISO C mem* and str* search functions together with some GNU extensions and BSD compatibility functions.
| Function | Level | Options | Notes |
| ISO C functions | 1 | l | |
| Extensions | 2 | l |
ISO C strtok(), POSIX extension strtok_r() and BSD extension strsep().
Level 1l.
Level 2l.
Various functions for manipulating argv[][] style arrays and derived environment string arrays. These will presumably be needed if we want to support getenv() and especially putenv().
Level 2l.
Various ISO C and other mechanisms for handling multibyte character sets and other stuff.
Level 1l.
ISO C and X/Open functions for setting and querying the locale.
We will only support the "C" locale, and maybe the "POSIX" one, if that ever differs from "C".
Level 1l.
X/Open and GNU gettext() and related facilities for translating messages into different languages.
Level 1l.
ISO C bsearch() and qsort() functions plus GNU extensions for hash and tree sort/search.
| Function | Level | Options | Notes |
| ISO C functions | 1 | l | |
| Extensions | 2 | l |
Various GNU-only extensions for wildcards, globbing and regular expression matching.
Level 2l.
These are mostly the ISO C set plus some GNU, BSD and SYSV extensions. None of these are necessary if we don't have any devices, file systems or network stacks to use them with.
| Function | Level | Options | Notes |
| fopen() | 1 | ||
| fopen64() | 1 | ||
| freopen() | 1 | ||
| freopen64() | 1 | ||
| fclose() | 1 | ||
| fcloseall() | 1 |
| Function | Level | Options | Notes |
| fputc() | 1 | ||
| putc() | 1 | ||
| putchar() | 1 | ||
| fputs() | 1 | ||
| puts() | 1 | ||
| putw() | 1 | ||
| fgetc() | 1 | ||
| getc() | 1 | ||
| getchar() | 1 | ||
| getw() | 1 | ||
| getline() | 1 | ||
| getdelim() | 1 | ||
| fgets() | 1 | ||
| gets() | 1 | ||
| ungetc() | 1 |
| Function | Level | Options | Notes |
| fread() | 1 | ||
| fwrite() | 1 |
The main option on all of these would be to drop the floating point formats to produce an integer only implementation.
| Function | Level | Options | Notes |
| printf() | 1 | m | |
| fprintf() | 1 | m | |
| sprintf() | 1 | m | |
| snprintf() | 1 | m | |
| asprintf() | 1 | m | |
| obstack_printf() | 4 | m | |
| vprintf() | 1 | m | |
| vfprintf() | 1 | m | |
| vsprintf() | 1 | m | |
| vsnprintf() | 1 | m | |
| vasprintf() | 1 | m | |
| obstack_vprintf() | 4 | ||
| parse_printf_format() | 4 |
As with the output functions, we can drop the floating point formats in these functions.
| Function | Level | Options | Notes |
| scanf() | 1 | m | |
| fscanf() | 1 | m | |
| sscanf() | 1 | m | |
| vscanf() | 1 | m | |
| vfscanf() | 1 | m | |
| vsscanf() | 1 | m |
| Function | Level | Options | Notes |
| clearerr() | 1 | ||
| feof() | 1 | ||
| ferror() | 1 |
| Function | Level | Options | Notes |
| ftell() | 1 | ||
| ftello() | 1 | ||
| ftello64() | 1 | ||
| fseek() | 1 | ||
| fseeko() | 1 | ||
| fseeko64() | 1 | ||
| rewind() | 1 | ||
| fgetpos() | 1 | ||
| fgetpos64() | 1 | ||
| fsetpos() | 1 | ||
| fsetpos64() | 1 |
| Function | Level | Options | Notes |
| fflush() | 1 | ||
| setvbuf() | 1 | ||
| setbuf() | 1 | ||
| setbuffer() | 1 | ||
| setlinebuf() | 1 |
| Function | Level | Options | Notes |
| fmemopen() | 4 | ||
| open_memstream() | 4 | ||
| open_obstack_stream() | 4 | ||
| fopencookie() | 4 | ||
| fmtmsg() | 4 | ||
| addseverity() | 4 |
Most of these functions are also covered by POSIX. Listed here are just those that are extensions to POSIX.
| Function | Level | Options | Notes |
| open64() | 1 | ||
| truncate() | 4 | ||
| truncate64() | 4 | ||
| ftruncate64() | 4 | ||
| pread() | 1 | ||
| pread64() | 1 | ||
| pwrite() | 1 | ||
| pwrite64() | 1 | ||
| lseek64() | 1 | ||
| fclean() | 1 | ||
| readv() | 2 | ||
| writev() | 2 | ||
| mremap() | 2 | ||
| select() | 1 | ||
| poll() | 1 | ||
| sync() | 1 | ||
| ioctl() | 4 |
| Function | Level | Options | Notes |
| aio_read64() | 1 | ||
| aio_write64() | 1 | ||
| lio_listio64() | 1 | ||
| aio_error64() | 1 | ||
| aio_return64() | 1 | ||
| aio_fsync64() | 1 | ||
| aio_suspend64() | 1 | ||
| aio_cancel64() | 1 | ||
| aio_init() | 4 |
Again, some of these are already defined by POSIX.
| Function | Level | Options | Notes |
| getwd() | 1 | f[d] | |
| telldir() | 1 | f[d] | |
| seekdir() | 1 | f[d] | |
| scandir() | 1 | f[d] | |
| alphasort() | 1 | f[d] | |
| versionsort() | 1 | f[d] | |
| scandir64() | 1 | f[d] | |
| alphasort64() | 1 | f[d] | |
| versionsort64() | 1 | f[d] | |
| ftw() | 1 | f[d] | |
| ftw64() | 1 | f[d] | |
| nftw() | 1 | f[d] | |
| nftw64() | 1 | f[d] |
| Function | Level | Options | Notes |
| symlink() | 2 | f[ml] | |
| readlink() | 2 | f[l] | |
| remove() | 1 | f[m] | |
| mknod() | 4 | f[m] |
| Function | Level | Options | Notes |
| stat64() | 1 | f | |
| fstat64() | 1 | f | |
| lstat() | 2 | f[l] | |
| lstat64() | 2 | f[l] | |
| fchown() | 2 | f[mp] | |
| getumask() | 2 | f[p] | |
| utimes() | 2 | f |
| Function | Level | Options | Notes |
| tmpfile() | 1 | f[m] | |
| tmpfile64() | 1 | f[m] | |
| tmpnam() | 1 | f[m] | |
| tmpnam_r() | 1 | f[m] | |
| tempnam() | 1 | f[m] | |
| mktemp() | 1 | f[m] | |
| mkstemp() | 1 | f[m] |
| Function | Level | Options | Notes |
| popen() | 4 | ||
| pclose() | 4 |
The database access functions here should probably have configurations that allow them to work from memory based tables or "string files" rather than real files.
| Function | Level | Options | Notes |
| socket() | 1 | n | |
| bind() | 1 | n | |
| getsockname() | 1 | n | |
| shutdown() | 1 | n | |
| socketpair() | 1 | n | |
| connect() | 1 | n | |
| listen() | 1 | n | |
| accept() | 1 | n | |
| getpeername() | 1 | n | |
| send() | 1 | n | |
| recv() | 1 | n | |
| sendto() | 1 | n | |
| recvfrom() | 1 | n | |
| getsockopt() | 1 | n | |
| setsockopt() | 1 | n |
| Function | Level | Options | Notes |
| inet_aton() | 1 | n | |
| inet_addr() | 1 | n | |
| inet_network() | 1 | n | |
| inet_ntoa() | 1 | n | |
| inet_makeaddr() | 1 | n | |
| inet_lnaof() | 1 | n | |
| inet_netof() | 1 | n | |
| inet_pton() | 1 | n | |
| inet_ntop() | 1 | n |
| Function | Level | Options | Notes |
| gethostbyname() | 1 | n | |
| gethostbyname2() | 1 | n | |
| gethostbyaddr() | 1 | n | |
| sethostent() | 1 | n | |
| gethostent() | 1 | n | |
| endhostent() | 1 | n |
| Function | Level | Options | Notes |
| getprotobyname() | 1 | n | |
| getprotobynumber() | 1 | n | |
| setprotoent() | 1 | n | |
| getprotoent() | 1 | n | |
| endprotoent() | 1 | n |
| Function | Level | Options | Notes |
| getservbyname() | 1 | n | |
| getservbyport() | 1 | n | |
| setservent() | 1 | n | |
| getservent() | 1 | n | |
| endservent() | 1 | n |
| Function | Level | Options | Notes |
| getnetbyname() | 1 | n | |
| getnetbyaddr() | 1 | n | |
| setnetent() | 1 | n | |
| getnetent() | 1 | n | |
| endnetent() | 1 | n |
| Function | Level | Options | Notes |
| htons() | 1 | n | |
| ntohs() | 1 | n | |
| htonl() | 1 | n | |
| ntohl() | 1 | n |
| Function | Level | Options | Notes |
| if_nametoindex() | 4 | ||
| if_indextoname() | 4 | ||
| if_nameindex() | 4 | ||
| if_freenameindex() | 4 |
| Function | Level | Options | Notes |
| cfmakeraw() | 4 | ||
| pseudo-terminal functions | 4 |
The usual collection of trig, exponent, hyperbolic and random number functions, too many to list here, look at the ISO C standard for a full list.
| Function | Level | Options | Notes |
| ISO C functions | 1 | l | |
| GNU extensions | 1 | o |
ISO C floating point arithmetic and FPU control functions plus some extensions.
| Function | Level | Options | Notes |
| ISO C functions | 1 | l | |
| GNU extensions | 2 |
Full timezone support can be very large in code and data sizes. At levels 1 and 2 we may provide a considerably reduced implementation.
| Function | Level | Options | Notes |
| clock() | 1 | ||
| difftime() | 1 | ||
| gettimeofday() | 1 | ||
| settimeofday() | 1 | ||
| adjtime() | 4 | ||
| localtime() | 1 | ||
| gmtime() | 1 | ||
| mktime() | 1 | ||
| asctime() | 1 | ||
| ctime() | 1 | ||
| strftime() | 1 | ||
| strptime() | 1 | ||
| getdate() | 1 | ||
| getdate_r() | 1 | ||
| ntp_gettime() | 1 | n | |
| ntp_adjtime() | 1 | n | |
| setitimer() | 1 | m o | |
| getitimer() | 1 | m o |
| Function | Level | Options | Notes |
| getrusage() | 1 | m | |
| getrlimit() | 1 | m | |
| getrlimit64() | 1 | m | |
| setrlimit() | 2 | m | |
| setrlimit64() | 2 | m |
| Function | Level | Options | Notes |
| setjmp() | 1 | ||
| longjmp() | 1 |
Many of these are obsolete or alternative interfaces to the basic POSIX signal functionality. Use of these should be replaced where necessary by the POSIX functions.
strsignal() and psignal() share the same problems as strerror() and perror() in needing RAM to store the strings table.
| Function | Level | Options | Notes |
| strsignal() | 1 | o m | |
| psignal() | 1 | o m | |
| signal() | 1 | c | 1 |
| raise() | 1 | c | 2 |
| sysv_signal() | 4 | ||
| ssignal() | 4 | ||
| gsignal() | 4 | ||
| killpg() | 4 | ||
| sigaltstack() | 4 | ||
| sigstack() | 4 | ||
| sigvec() | 4 | ||
| siginterrupt() | 4 | ||
| sigblock() | 4 | ||
| sigsetmask() | 4 | ||
| sigpause() | 4 |
Note 1: This is merely a wrapper for sigaction().
Note 2: This is merely a wrapper for kill().
| Function | Level | Options | Notes |
| getopt() | 2 | l | |
| getopt_long() | 2 | l | |
| argp_parse() | 2 | l | |
| argp_help() | 2 | l | |
| getsubopt() | 2 | l |
The only real use for changing the environment is to prepare it for passing on to a sub-process. Hence these functions are only necessary at level 3.
| Function | Level | Options | Notes |
| putenv() | 3 | ||
| setenv() | 3 |
| Function | Level | Options | Notes |
| exit() | 1 | ||
| atexit() | 1 | ||
| on_exit() | 1 | ||
| abort() | 1 | ||
| _Exit() | 1 |
| Function | Level | Options | Notes |
| system() | 4 | ||
| vfork() | 4 | ||
| wait3() | 4 | ||
| wait4() | 4 | ||
| getpriority() | 4 | ||
| setpriority() | 4 | ||
| nice() | 4 |
| Function | Level | Options | Notes |
| setreuid() | 4 | ||
| setregid() | 4 | ||
| setgroups() | 4 | ||
| initgroups() | 4 | ||
| cuserid() | 4 |
Also functions from GNU, BSD and X/Open for accessing the user, group, utmp and wtmp databases. All level 4.
| Function | Level | Options | Notes |
| gethostname() | 1 | n | |
| sethostname() | 1 | n | |
| gethostid() | 1 | n | |
| sethostid() | 1 | n | |
| uname() | 1 | n | |
| fstab access functions | 2 | f | |
| mtab access functions | 2 | f |
| Function | Level | Options | Notes |
| confstr() | 1 | o |
Some embedded applications will need cryptographic security. However the DES based encryption provided by these functions is probably inadequate and has various legal problems. Those applications that need it will probably pick up a stronger, legal, encryption package elsewhere. Hence these functions are entirely optional.
| Function | Level | Options | Notes |
| getpass() | 4 | ||
| crypt() | 1 | l o | |
| crypt_r() | 1 | l o | |
| setkey() | 1 | l o | |
| encrypt() | 1 | l o | |
| setkey_r() | 1 | l o | |
| encrypt_r() | 1 | l o | |
| ecb_crypt() | 1 | l o | |
| cbc_crypt() | 1 | l o | |
| des_setparity() | 1 | l o |
The following are LinuxThreads extensions.
| Function | Level | Options | Notes |
| pthread_cleanup_push_defer_np() | 2 | ||
| pthread_cleanup_pop_restore_np() | 2 | ||
| pthread_mutexattr_setkind_np() | 2 | ||
| pthread_mutexattr_getkind_np() | 2 | ||
| pthread_kill_other_threads_np() | 2 |