Chapter Contents

Previous

Next
Introduction to POSIX

The errno Variable

As described in in Chapter 1, "Introduction to the SAS/C Library," in SAS/C Library Reference, Volume 1, the external int variable errno contains the number of the most recent error or warning condition detected by the run-time library. To use this value, include the header file <errno.h> .


POSIX and USS Error Numbers

The <errno.h> header file contains definitions for the macro identifiers that name system error status conditions. When a SAS/C Library function sets an error status by assigning a nonzero valued to errno , the calling program can check for a particular value by using the name defined in <errno.h> .

The following USS related, POSIX defined errno values are defined in <errno.h> :
E2BIG argument list for exec function too large
EAGAIN resource temporarily unavailable
EBUSY resource busy (synonym for EINUSE )
ECHILD child process not found
EDEADLK resource deadlock avoided
EFAULT invalid argument address
EFBIG file too large
EINVAL invalid function argument (synonym for EARE )
EISDIR output file is a directory
ELOOP too many symbolic links in pathname (1003.1a)
EMFILE open file limit exceeded (synonym for ELIMIT )
EMLINK system limit on links exceeded
EMVSEXPIRE expired password (non-POSIX extension)
EMVSINITIAL error in establishing USS process (non-POSIX extension)
EMVSNOTUP USS kernel is not active (non-POSIX extension)
EMVSPASSWORD incorrect password (non-POSIX extension)
ENAMETOOLONG filename too long
ENDENT file or directory not found (synonym for ENFOUND )
ENFILE too many open files in system
ENODEV inappropriate use of device
ENOEXEC attempt to execute non-executable file
ENOLCK no HFS record locks were available
ENOSYS function not implemented by system
ENOTDIR pathname component not a directory
ENOTEMPTY directory not empty
ENOTTY file is not a terminal
ENXIO non-existent or inappropriate device
EPERM operation not permitted
EPIPE write to pipe without headers
EROFS file system mounted read only
ESPIPE seek to unseekable file (synonym for EUNSUPP )
ESRCH process not found
EXDEV link from one file system to another
GIO input/output error (synonym for EDEVICE )

Note:    In addition to the values listed above, common SAS/C errno values are listed in Chapter 1, "Introduction to the SAS/C Library," in SAS/C Library Reference, Volume 1. Also refer to errno.h for socket-related errno values. For a complete listing of all errno values, see the SAS/C Compiler and Library Quick Reference Guide.  [cautionend]

Also note that USS frequently uses a reason code to provide additional information about errors occuring in POSIX functions. See "System Macro Information" in Chapter 1 of SAS/C Library Reference, Volume 1 for information on accessing USS reason codes.


Internal Error Numbers

The following errno values represent USS internal errors. Contact IBM Technical Support if you receive one of these errors. These errno values are described in more detail in the manual, OpenEdition Assembler Callable Services.
EIBMCANCELLED
EIBMCONFLICT
EIBMSOCKINUSE
EIBMSOCKOUTOFRANGE
EMVSCATLG
EMVSCVAF
EMVSDYNALC
EMVSPFSFILE
EMVSPFSPERM
EMVSSAF2ERR
EMVSSAFEXTRERR
EOFFLOADBOXDOWN
EOFFLOADBOXERROR
EOFFLOADBOXRESTART

Consult The POSIX.1 Standard: A Programmer's Guide by Fred Zlotnick (1991, Benjamin/Cummings Publishing) or the POSIX standards for information on the POSIX errno values; consult IBM USS documentation for information on the EMVS- and EIBM- errno values.

Because the errno values resulting from POSIX functions are well organized and well-defined, the SAS/C Library does not diagnose many problems that can occur with these functions, even when it diagnoses similar problems occurring with OS/390 files. This eases porting programs from other open systems, since these systems do not, in general, have library diagnostics. In general, the SAS/C Library will issue diagnostics for failures of USS functionality only when (a) the failure is certainly the result of programmer error, or (b) the error is so esoteric that diagnosis is unlikely without a message.


Chapter Contents

Previous

Next

Top of Page

Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.