system_errno(3f) - [M_system:ERROR_PROCESSING] C error return value (LICENSE:PD)
Synopsis
Description
Examples
integer(kind=c_int) function system_errno()
Many C routines return an error code which can be queried by errno. The M_system(3fm) is primarily composed of Fortran routines that call C routines. In the cases where an error code is returned vi system_errno(3f) these routines will indicate it.
Sample program:
program demo_system_errno use M_system, only : system_errno, system_unlink, system_perror implicit none integer :: stat stat=system_unlink(not there/OR/anywhere) if(stat.ne.0)then write(*,*)err=,system_errno() call system_perror(*demo_system_errno*) endif end program demo_system_errnoTypical Results:
err= 2 *demo_system_errno*: No such file or directory
Nemo Release 3.1 | system_errno (3) | February 23, 2025 |