dm_system Module

Abstraction layers over system calls.


Uses

  • module~~dm_system~~UsesGraph module~dm_system dm_system module~dm_error dm_error module~dm_system->module~dm_error module~dm_kind dm_kind module~dm_system->module~dm_kind unix unix module~dm_system->unix module~dm_error->module~dm_kind module~dm_ascii dm_ascii module~dm_error->module~dm_ascii iso_fortran_env iso_fortran_env module~dm_kind->iso_fortran_env

Used by

  • module~~dm_system~~UsedByGraph module~dm_system dm_system module~dmpack dmpack module~dmpack->module~dm_system proc~dm_test_run dm_test_run proc~dm_test_run->module~dm_system

Derived Types

type, public ::  uname_type

Operating system information type.

Components

Type Visibility Attributes Name Initial
character(len=UNAME_LEN), public :: system_name = ' '

OS name.

character(len=UNAME_LEN), public :: node_name = ' '

Host name.

character(len=UNAME_LEN), public :: release = ' '

OS release.

character(len=UNAME_LEN), public :: version = ' '

OS version.

character(len=UNAME_LEN), public :: machine = ' '

Platform.


Functions

public function dm_system_daemonize(command) result(rc)

Turns current running program into a daemon. On FreeBSD, it is probably easier to run the process through daemon(8) instead.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: command

Return Value integer

public function dm_system_error_message(error) result(str)

Returns system error string from strerror(3). If error is not passed, this function used errno(2) as error code.

Arguments

Type IntentOptional Attributes Name
integer, intent(in), optional :: error

System error code.

Return Value character(len=:), allocatable

Error message.

public function dm_system_fork() result(pid)

Forks process and returns PID.

Arguments

None

Return Value integer

public function dm_system_wait(stat) result(pid)

Waits for child process and returns PID.

Arguments

Type IntentOptional Attributes Name
integer, intent(out) :: stat

Returned status (POSIX).

Return Value integer


Subroutines

public subroutine dm_system_path(path)

Returns the relative path of the executable.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(inout) :: path

Returned path.

public subroutine dm_system_uname(uname, error)

Returns uname information (operating system, hostname, …).

Arguments

Type IntentOptional Attributes Name
type(uname_type), intent(out) :: uname

Uname type.

integer, intent(out), optional :: error

Error code.

public subroutine dm_system_uptime(time, error)

Returns system uptime in time [sec]. On error, argument error is E_SYSTEM.

Arguments

Type IntentOptional Attributes Name
integer(kind=i8), intent(out) :: time

Uptime [sec].

integer, intent(out), optional :: error

Error code.