C Library Functions - system_perror (3)
NAME
perror(3f) - [M_system:ERROR_PROCESSING] print error message for
last C error on stderr
(LICENSE:PD)
CONTENTS
Synopsis
Description
Examples
SYNOPSIS
subroutine system_perror(prefix)
character(len=*),intent(in) :: prefix
DESCRIPTION
Use system_perror(3f) to print an error message on stderr
corresponding to the current value of the C global variable errno.
Unless you use NULL as the argument prefix, the error message will
begin with the prefix string, followed by a colon and a space
(:). The remainder of the error message produced is one of the
strings described for strerror(3c).
EXAMPLES
Sample program:
program demo_system_perror
use M_system, only : system_perror,system_rmdir
implicit none
character(len=:),allocatable :: DIRNAME
DIRNAME=/NOT/THERE/OR/ANYWHERE
! generate an error with a routine that supports errno and perror(3c)
if(system_rmdir(DIRNAME).ne.0)then
call system_perror(*demo_system_perror*://DIRNAME)
endif
write(*,(a))"Thats all Folks!"
end program demo_system_perror
Expected results:
*demo_system_perror*:/NOT/THERE/OR/ANYWHERE: No such file or directory
Thats all Folks!
| Nemo Release 3.1 | system_perror (3) | June 29, 2025 |
Generated by manServer 1.08 from 730eb720-7050-4a0d-ab51-e5ee091d804d using man macros.