13.07.2015 Views

TASKING VX-toolset for ARM User Guide

TASKING VX-toolset for ARM User Guide

TASKING VX-toolset for ARM User Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>TASKING</strong> <strong>VX</strong>-<strong>toolset</strong> <strong>for</strong> <strong>ARM</strong> <strong>User</strong> <strong>Guide</strong>tmpnam() creates a temporary filename and returns a pointer to a local static buffer. This is accordingto the ANSI definition. Changing this function such that it creates the name in a user specified bufferrequires another calling interface. Thus the function would be no longer portable.strtok() scans through a string and remembers that the string and the position in the string <strong>for</strong>subsequent calls. This function is not reentrant by design. Making it reentrant requires support of a kernelto store the in<strong>for</strong>mation on a per process basis.rand() generates a sequence of random numbers. The function uses the value returned by a previouscall to generate the next value in the sequence. This function can be made reentrant by specifying theprevious random value as one of the arguments. However, then it is no longer a standard function.(5) mallocMalloc uses a heap space which is assigned at locate time. Thus this implementation is not reentrant.Making a reentrant malloc requires some sort of system call to obtain free memory space on a per processbasis. This is not easy to solve within the current context of the library. This requires adaptation to akernel.This paragraph on reentrancy applies to multi-process environments only. If reentrancy is required<strong>for</strong> calling library functions from an exception handler, another approach is required. For such asituation it is of no use to allocate e.g. multiple iob[] structures. In such a situation several piecesof code in the library have to be declared 'atomic': this means that interrupts have to be disabledwhile executing an atomic piece of code.784

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!