|
||
Although P.I.P.S. provides a wide range of APIs, some of the functionality required in order to complete a porting task might be missing - this could be some APIs from an existing library or an entire library.
Several options are available to the user:
Port the missing APIs using the P.I.P.S. libraries
Implement the missing APIs on top of Symbian OS native C++ APIs
Use a workaround - for example, use popen()
instead of
fork()
.
Note: The following are the limitations associated with porting a UNIX® application:
Limited stack-space: The default stack size per thread
on Unix-like operating systems ranges from 64 kB to 1 MB. Symbian OS, however,
defines a default stack size of 8 kB per thread. P.I.P.S. Pthreads use this by
default. You can use the pthread_attr_setstacksize()
function to
modify this before calling pthread_create()
.
Limited threads per process: Assuming that all threads use the default stack size (8 kB), Symbian specifies a limit of 128 threads per process. The limit changes depending on the stack size you use for individual threads. For example, if you create your threads with a stack size of 16 kB, the OS only supports 64 threads per process.
The implementation of P.I.P.S. APIs follows one of these four patterns:
C APIs with no dependencies - APIs that do not depend
on any other P.I.P.S. or native Symbian OS libraries (i.e., self-contained),
for example, strcmp()
and strlen()
.
C APIs with dependencies:
No handle - C APIs that depend on native Symbian
APIs, for example, the socket()
function that depends on
native Symbian APIs in RSocket
.
Handle with no system call - C APIs that depend on
native APIs that use a handle but not a system call are, as such,
mmap()
s which use RChunk
s and are in
libc
, not the System Call Adaptation Layer (SCAL). Note that these
will be moved to the SCAL, eventually.
Handle with system call - C APIs that use a handle
that is a system call (code in the SCAL), for example, the
open()
function is an example of such an API that uses the
file descriptor table. The descriptor table provides the mapping of C-style
file descriptors to Symbian C++ objects.
The C API wrappers are C functions defined in a .cpp
file
that call Symbian C++ APIs on behalf of the C library. These wrappers may also
map C handles to C++ objects. The C wrappers also provide access functions to
both thread local and process local data, for example, int
__errno()
. These wrappers are contained in their
corresponding C library.
For more information see the P.I.P.S. Architecture section.