posix module reference

Interface to the libc POSIX API.

More…

Data Types

stat_buf

Container for file metadata from stat.

jmp_buf

Container for the jump point buffer created by setjmp().

sigjmp_buf

Container for the jump point buffer (with signals) created by sigsetjmp()

Functions/Subroutines

chmod()

Change mode of a file.

mkdir()

Create a file directory.

stat()

Get file status.

signal()

Create a signal handler handle to be called when sig is detected.

kill()

Send signal sig to process pid.

getpid()

Get the ID of the current process.

getppid()

Get the ID of the parent process of the current process.

sleep()

Force the process to a sleep state for seconds seconds.

longjmp()

Restore program to state saved by env, and return the value val.

siglongjmp()

Restore program to state saved by env, and return the value val.

setjmp_missing()

Placeholder function for a missing or unconfigured setjmp.

longjmp_missing()

Placeholder function for a missing or unconfigured longjmp.

sigsetjmp_missing()

Placeholder function for a missing or unconfigured sigsetjmp.

siglongjmp_missing()

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.

[source]

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.

[source]

type  posix/sigjmp_buf

Container for the jump point buffer (with signals) created by sigsetjmp()

Type fields:
  • % state :: character(kind=c_char), dimension( 200) Unstructured array of bytes used to store the process state.

[source]

Function/Subroutine Documentation

function  posix/chmod(path, mode)

Change mode of a file.

This changes the file permission of file path to mode following POSIX conventions. If successful, it returns zero. Otherwise, it returns -1.

Called from:

mom_file_parser_tests::cleanup_open_param_file_ioerr

[source]

function  posix/mkdir(path, mode)

Create a file directory.

This creates a new directory named path with permissons set by mode. If successful, it returns zero. Otherwise, it returns -1.

Called from:

mom_get_input::get_mom_input

[source]

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 inspected

  • buf :: buf [out] Buffer containing information about the file if it exists

Return:

undefined :: Function return code

Called from:

mom_get_input::get_mom_input

[source]

function  posix/signal(sig, func)

Create a signal handler handle to be called when sig is detected.

If successful, the previous handler for sig is returned. Otherwise, SIG_ERR is returned.

[source]

function  posix/kill(pid, sig)

Send signal sig to process pid.

If successful, this function returns 0. Otherwise, it returns -1.

[source]

function  posix/getpid()

Get the ID of the current process.

[source]

function  posix/getppid()

Get the ID of the parent process of the current process.

[source]

function  posix/sleep(seconds)

Force the process to a sleep state for seconds seconds.

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:

mom_error_handler::mom_error

[source]

subroutine posix/longjmp(env, val)

Restore program to state saved by env, and return the value val.

This “nonlocal goto” alters program execution to the state stored in env produced by a prior execution of setjmp. Program execution is moved back to this setjmp, except the function will now return val.

[source]

subroutine posix/siglongjmp(env, val)

Restore program to state saved by env, and return the value val.

This “nonlocal goto” alters program execution to the state stored in env produced by a prior execution of setjmp. Program execution is moved back to this setjmp, except the function will now return val. siglongjmp behaves in the same manner as longjmp, but also provides predictable handling of the signal state.

[source]

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)

[source]

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)

[source]

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)

[source]

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)

[source]

[source]