posix module reference
Interface to the libc POSIX API.
Data Types
Container for file metadata from stat. |
|
Container for the jump point buffer created by setjmp(). |
|
Container for the jump point buffer (with signals) created by sigsetjmp() |
Functions/Subroutines
Change mode of a file. |
|
Create a file directory. |
|
Get file status. |
|
Create a signal handler |
|
Send signal |
|
Get the ID of the current process. |
|
Get the ID of the parent process of the current process. |
|
Force the process to a sleep state for |
|
Restore program to state saved by |
|
Restore program to state saved by |
|
Placeholder function for a missing or unconfigured setjmp. |
|
Placeholder function for a missing or unconfigured longjmp. |
|
Placeholder function for a missing or unconfigured sigsetjmp. |
|
Placeholder function for a missing or unconfigured siglongjmp. |
Detailed Description
Interface to the libc POSIX API.
Type Documentation
- type posix/stat_buf
Container for file metadata from stat.
- Type fields:
% state ::
character(kind=c_char), dimension(144)Byte array containing file metadata.
- type posix/jmp_buf
Container for the jump point buffer created by setjmp().
- Type fields:
% state ::
character(kind=c_char), dimension(200)Unstructured array of bytes used to store the process state.
Function/Subroutine Documentation
- function posix/chmod(path, mode)
Change mode of a file.
This changes the file permission of file
pathtomodefollowing POSIX conventions. If successful, it returns zero. Otherwise, it returns -1.- Called from:
mom_file_parser_tests::cleanup_open_param_file_ioerr
- function posix/mkdir(path, mode)
Create a file directory.
This creates a new directory named
pathwith permissons set bymode. If successful, it returns zero. Otherwise, it returns -1.- Called from:
- function posix/stat(path, buf)
Get file status.
This obtains information about the named file and writes it to buf. If found, it returns zero. Otherwise, it returns -1.
- Parameters:
path ::
path[in] Pathname of file to be inspectedbuf ::
buf[out] Buffer containing information about the file if it exists
- Return:
undefined :: Function return code
- Called from:
- function posix/signal(sig, func)
Create a signal handler
handleto be called whensigis detected.If successful, the previous handler for
sigis returned. Otherwise, SIG_ERR is returned.
- function posix/kill(pid, sig)
Send signal
sigto processpid.If successful, this function returns 0. Otherwise, it returns -1.
- function posix/sleep(seconds)
Force the process to a sleep state for
secondsseconds.The sleep state may be interrupted by a signal. If it sleeps for the entire duration, then it returns 0. Otherwise, it returns the number of seconds remaining at the point of interruption.
- Called from:
- subroutine posix/longjmp(env, val)
Restore program to state saved by
env, and return the valueval.This “nonlocal goto” alters program execution to the state stored in
envproduced by a prior execution ofsetjmp. Program execution is moved back to thissetjmp, except the function will now returnval.
- subroutine posix/siglongjmp(env, val)
Restore program to state saved by
env, and return the valueval.This “nonlocal goto” alters program execution to the state stored in
envproduced by a prior execution ofsetjmp. Program execution is moved back to thissetjmp, except the function will now returnval.siglongjmpbehaves in the same manner aslongjmp, but also provides predictable handling of the signal state.
- function posix/setjmp_missing(env)
Placeholder function for a missing or unconfigured setjmp.
- Parameters:
env ::
env[in] Current process state (unused)- Return:
undefined :: Function return code (unused)
- subroutine posix/longjmp_missing(env, val)
Placeholder function for a missing or unconfigured longjmp.
- Parameters:
env ::
env[in] Current process state (unused)val ::
val[in] Enable signal state flag (unused)
- function posix/sigsetjmp_missing(env, savesigs)
Placeholder function for a missing or unconfigured sigsetjmp.
- Parameters:
env ::
env[in] Current process state (unused)savesigs ::
savesigs[in] Enable signal state flag (unused)
- Return:
undefined :: Function return code (unused)
- subroutine posix/siglongjmp_missing(env, val)
Placeholder function for a missing or unconfigured siglongjmp.
- Parameters:
env ::
env[in] Current process state (unused)val ::
val[in] Enable signal state flag (unused)