ChorusOS 5.0 Application Developer's Guide

Chapter 16 Compatibility With POSIX Standards

Compatibility for the sake of application source code portability is important for highly scalable applications. This chapter discusses compatibility of ChorusOS tools, devices, APIs and protocols with those described in the POSIX standards. This chapter provides a study of what is compatible, organized for reference, rather than an exhaustive demonstration of how to port applications. After reading this chapter, you will be aware of differences in tools, devices, APIs and protocols that require your attention as you create portable, scalable applications.

Divergence From POSIX Standards

The ChorusOS operating system provides an almost complete POSIX API, compliant with the IEEE Standard 1003.1b-1993. There are however, some functions that have not been implemented in this version of the ChorusOS operating system and some functions whose implementation is different in some way. This section highlights the system and library calls in which the implementation or semantics differ from the POSIX standard. You are advised to consult the relevant ChorusOS man page for information on how these calls on implemented.

For ease of use, this section is divided into the same categories as are found in the POSIX IEEE Standard documentation.

Process Management

The posix_spawn() call has been added to the ChorusOS operating system. The implementation of this call differs to some extent from the POSIX standard. See the posix_spawn(2POSIX) man page for a complete description of the ChorusOS implementation.

The implementation of the setsid() call differs from the POSIX standard. Refer to the setsid(2POSIX) man page for a complete description of the ChorusOS implementation.

Signals

ChorusOS 5.0 provides the POSIX signal APIs, enabling applications to post and catch signals. Signals may be either synchronous or asynchronous. Signals may also be posted between applications or by the system to applications.

There are, however, limitations on the ChorusOS signal API. The ChorusOS operating system does not support the complete range of signals, as defined by POSIX.

There are also limitations in APIs such as sigaction() with respect to the POSIX specification. For example, SA_ONSTACK is not supported as a part of the sigaction() API. Refer to the following man pages for more information:

Input and Output

There is no support for asynchronous I/O in the ChorusOS operating system.

The fdatasync() call is not implemented in the ChorusOS operating system:

System Databases

The following system database calls are not implemented in the ChorusOS operating system:

Synchronization

Synchronization in the ChorusOS operating system has the following limitations with regard to the POSIX standard:

Memory Management

The implementation of the following memory management calls is substantially different in the ChorusOS operating system:

mmap()

See the mmap(2POSIX) man page for more information.

munmap()

There is a limitation in the implementation of this call. See the munmap(2POSIX) man page for more information.

The following memory management calls are not implemented in the ChorusOS operating system:

Threads

Creation and cancellation of threads in the ChorusOS operating system are compatible with the POSIX standard. There are two restrictions regarding the implementation of threads:

Realtime Files and System Calls

The ChorusOS operating system does not provide support for the POSIX realtime files and system calls.

ChorusOS Services Derived From FreeBSD

The majority of the process management, fies and directoy, and I/O calls are derived from FreeBSD version 4.1. Calls in these sections have been implemented in the same way as the corresponding FreeBSD calls.

The ChorusOS implementatino of a few calls is very different to the FreeBSD implementation. The following list highlights thse differences.

fork()

Refer to the fork(2POSIX) man page for more information.

kill()

Refer to the sigaction(2POSIX) man page for more information.

The way in which signals have been implemented also differs substantially from the FreeBSD implementation. Pay particular attention to the following calls:

sigaction()

Refer to the sigaction(2POSIX) man page for more information.

sigprocmask()

Refer to the sigprocmask(2POSIX) man page for more information.

sigqueue()

Refer to the sigqueue(2POSIX) man page for more information.

sigtimedwait()

Refer to the sigtimedwait(2POSIX) man page for more information.

sigwaitinfo()

Refer to the sigwaitinfo(2POSIX) man page for more information.