Guardian C Library Calls Reference Manual

Reference to Library Calls
Guardian TNS C Library Calls Reference Manual128833 3-139
perror
This function sets the file-position indicator to the start of the file (assuming that the
file is successfully opened).
For more information regarding file extents and pages, refer to the ENSCRIBE
Programmer’s Guide.
This manual does not include a discussion about waited I/O and nowait I/O because
the C programming language does not provide this capability. For waited and nowait
I/O, you must use Guardian system procedures.
Example
This example opens a file named $a.b.c for reading and writing:
#include <fcntlh>
int filedes;
filedes = open("$a.b.c", O_RDWR);
perror
The perror function prints the textual error message corresponding to the current value
of errno, optionally preceded by a specified string, to the standard error file, stderr.
user_text
points to a string or is the pointer value NULL.
Return Value
none.
Usage Guidelines
The form of the error message that perror prints is:
1. The string pointed to by user_text (if user_text is a nonnull pointer).
2. A textual message corresponding to the current value of errno. This message is
the same as the string strerror returns for the given value of errno.
3. A newline character.
#include <stdioh>
void perror(const char *user_text);