Open System Services System Calls Reference Manual (G06.25+, H06.03+)

fork(2) OSS System Calls Reference Manual
Floating-Point Data
If the parent process uses IEEE oating-point data, the child process inherits all of the oating-
point register contents of the parent process and any computation started before the fork() func-
tion call completes in the child process. The contents of the status and control register are also
inherited.
RETURN VALUES
Upon successful completion, the fork() function returns the value 0 (zero) to the child process
and returns the PID of the child process to the parent process. If the fork( ) function fails, the
value -1 is returned to the parent process, no child process is created, and errno is set to indicate
the error.
ERRORS
If any of the following conditions occurs, the fork() function sets errno to the corresponding
value:
[EACCES] Open for execute access on the code le or any library le was denied.
[EAGAIN] System resources such as disk space, process control block (PCB) space, MAP-
POOL space, stack space, or PFS space are temporarily inadequate.
[EIO] Some physical input or output error has occurred. Either a le cannot be opened
because of an input or output error or data has been lost during an input or output
transfer. This value is used only for errors on the object le of a loaded program
or library, or during data transfer with a Guardian environment home terminal.
[ENOMEM] Required resources are not available. Subsequent calls to the same function will
not succeed for the same reason.
Possible causes of this error include insufcient primary memory (stack, globals,
or heap) for the new process.
[ENOTOSS] The calling process is not an OSS process. The fork() function cannot be called
from the Guardian environment.
[EUNKNOWN]
Unknown error. An unrecognized or very obscure error occurred. If this error
occurs, follow site-dened procedures for reporting software problems to
HP.
RELATED INFORMATION
Functions: exec(2), _exit(2), exit(3), raise(3), semop(2), shmat(2), sigaction(2),
tdm_execve(2), tdm_execvep(2), tdm_fork(2), tdm_spawn(2), tdm_spawnp(2), times(3),
ulimit(3), umask(2), wait(2).
STANDARDS CONFORMANCE
The POSIX standards leave some features to the implementing vendor to dene. The following
features are affected in the HP implementation:
The child process shares directory streams with the parent. They share the same block of
directory entries, but each stream can be used by only one of the processes.
Guardian attributes are associated with the new OSS process. See Guardian Attributes
under DESCRIPTION.
312 Hewlett-Packard Company 527186-003