gtpc2mizC/C++ Language Support User's Guide

Implementation-Defined Behavior of the TPF C Run-Time Library

Streams and Files

TPF has a hierarchical file system modelled on (but not completely conforming to) POSIX.1. File names are specified as either:

Path name components (names of files, subdirectories, symbolic links) can be up to 256 characters long and can consist of any EBCDIC characters other than / (slash, '\x61'), or NUL ('\0'), although for portability it is recommended that path name components contain only the portable file name character set, which consists of the following:

Path names are C (NUL-terminated) strings consisting of path name components separated by slashes. Path names can be up to 1024 characters long.

From a standard C library perspective, the following are implementation-defined aspects of TPF files and streams:

Does the last line of a text stream require a terminating new-line character?

Do space characters that are written out to a text stream immediately before a new-line character appear when read?

What is the number of NUL characters that can be appended to the end of a binary stream:

Where is the file position indicator of an append-mode stream initially positioned?

Does writing on a text stream cause the associated file to be truncated?

Can a file have a length of zero?

Can the same file be simultaneously opened multiple times?

The effect of the remove() function on an open file:

The effect of the rename function on a file name that exists before to the function call:

Are temporary files (created by the tmpnam function) removed if the program ends abnormally?

The effect of calling the tmpnam function more than TMP_MAX times:

The output by the fprintf function of a %p conversion:

The input by the fscanf function of a %p conversion:

The interpretation of a - (dash) character that is neither the first nor the last in the scan list for the %[ ] conversion by the fscanf function:

The value of errno on failure of the fgetpos and ftell functions:

How does the abort function behave with regard to open and temporary files?

Memory Management

The behavior of the calloc, malloc, and realloc functions if the size requested is zero:

Math

What values do mathematical functions return on domain errors?

Do mathematics functions set errno to ERANGE on underflow range errors?

What is the result of calling the fmod function with the second argument zero?

Signals

TPF does not support asynchronous, or hardware signals. See signal-Install Signal Handler and raise-Raise Condition for information about the types of signals supported, default actions, and other aspects of signal handling.

Error Handling

What message strings does perror print and strerror return?

Miscellaneous Functions and Macros

The definition of the NULL macro:

The format of the diagnostic printed by the assert macro, and its termination behavior:

The sets of characters tested for by the isalnum(), isalpha(), iscntrl(), islower(), isprint(), and isupper() functions:

What status does the exit function return if the value of its argument is other than zero, EXIT_SUCCESS or EXIT_FAILURE?

What are the environment names, and how can the environment list used by the getenv() function be altered?

What are the contents of the system function argument, and how is it executed?

How are the local time zone and Daylight Saving Time determined?

What is the era for the clock function?