Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

perror(3)

errno(2)  —  System Calls

Digital

NAME

errno − introduction error numbers

SYNOPSIS

#include <errno.h>

DESCRIPTION

The errno external variable is set when an error occurs in a system call. You can use the value stored in errno to obtain a more detailed description of the error than is given in the system call’s return value.  The errno variable is not cleared on successful system calls, so you should check its value only when an error is reported. 

For more information, see the <errno.h> header file and the reference page for the system call that set errno. For example, for an explanation of error number 25 [ENOTTY] returned from a call to ioctl, see the ERRORS section of the ioctl(2) reference page. 

RETURN VALUES

Most system calls have one or more return values.  An error condition is indicated by an otherwise impossible return value. This value is almost always −1. All return codes and values from system call are of type int, unless otherwise noted. 

When an error occurs, most calls store one of the following values, as defined in <errno.h>, in the errno variable:

0  ESUCCESS "Successful"

1  EPERM "Not owner"

2  ENOENT "No such file or directory"

3  ESRCH "No such process"

4  EINTR "Interrupted system call"

5  EIO "I/O error"

6  ENXIO "No such device or address"

7  E2BIG "Arg list too long"

8  ENOEXEC "Exec format error"

9  EBADF "Bad file number"

10 ECHILD "No children"

11 EDEADLK "Operation would cause deadlock"

12 ENOMEM "Not enough core"

13 EACCES "Permission denied"

14 EFAULT "Bad address"

15 ENOTBLK "Block device required"

16 EBUSY "Mount device busy"

17 EEXIST "File exists"

18 EXDEV "Cross-device link"

19 ENODEV "No such device"

20 ENOTDIR "Not a directory"

21 EISDIR "Is a directory"

22 EINVAL "Invalid argument"

23 ENFILE "File table overflow"

24 EMFILE "Too many open files"

25 ENOTTY "Not a typewriter"

26 ETXTBSY "Text file busy"

27 EFBIG "File too large"

28 ENOSPC "No space left on device"

29 ESPIPE "Illegal seek"

30 EROFS "Restricted operation on a file system"

31 EMLINK "Too many links"

32 EPIPE "Broken pipe"

33 EDOM "Argument too large"

34 ERANGE "Result too large"

35 EWOULDBLOCK "Operation would block"

35 EAGAIN (EWOULDBLOCK) "Operation would block"

36 EINPROGRESS "Operation now in progress"

37 EALREADY "Operation already in progress"

38 ENOTSOCK "Socket operation on non-socket"

39 EDESTADDRREQ "Destination address required"

40 EMSGSIZE "Message too long"

41 EPROTOTYPE "Protocol wrong type for socket"

42 ENOPROTOOPT "Protocol not available"

43 EPROTONOSUPPORT "Protocol not supported"

44 ESOCKTNOSUPPORT "Socket type not supported"

45 EOPNOTSUPP "Error−operation not supported"

46 EPFNOSUPPORT "Protocol family not supported"

47 EAFNOSUPPORT "Address family not supported by protocol family"

48 EADDRINUSE "Address already in use"

49 EADDRNOTAVAIL "Cannot assign requested address"

50 ENETDOWN "Network is down"

51 ENETUNREACH "Network is unreachable"

52 ENETRESET "Network dropped connection on reset"

53 ECONNABORTED "Software caused connection abort"

54 ECONNRESET "Connection reset by peer"

55 ENOBUFS "No buffer space available"

56 EISCONN "Socket is already connected"

57 ENOTCONN "Socket is not connected"

58 ESHUTDOWN "Cannot send after socket shutdown"

59 ETOOMANYREFS "Too many references: cannot splice"

60 ETIMEDOUT "Connection timed out"

61 ECONNREFUSED "Connection refused"

62 ELOOP "Too many levels of symbolic links"

63 ENAMETOOLONG "File name too long"

64 EHOSTDOWN "Host is down"

65 EHOSTUNREACH "No route to host"

66 ENOTEMPTY "Directory not empty"

67 EPROCLIM "Too many processes"

68 EUSERS "Too many users"

69 EDQUOT "Disk quota exceeded"

70 ESTALE "Stale NFS file handle"

71 EREMOTE "Too many levels of remote in path"

72 EBADRPC "RPC struct is bad"

73 ERPCMISMATCH "RPC version wrong"

74 EPROGUNAVAIL "RPC prog. not avail"

75 EPROGMISMATCH "Program version wrong"

76 EPROCUNAVAIL "Bad procedure for program"

80 ENOMSG "No msg matches receive request"

81 EIDRM "Msg queue id has been removed"

82 ENOSR "Out of STREAMS resources"

83 ETIME "System call timed out"

84 EBADMSG "Next message has wrong type"

85 EPROTO "STREAMS protocol error"

86 ENODATA "No message on stream head read q"

87 ENOSTR "fd not associated with a stream"

88 ECLONEME "Tells open to clone the device"

89 EDIRTY "Mounting a dirty fs w/o force"

90 EDUPPKG "duplicate package name on install"

91 EVERSION "version number mismatch"

92 ENOPKG "unresolved package name"

93 ENOSYM "unresolved symbol name"

94 ECANCELED "operation canceled"

95 EFAIL "cannot start operation"

96 EFTYPE "inappropriate operation for file type"

97 EINPROG "operation (now) in progress"

98 EMTIMERS "too many timers"

99 ENOTSUP "function not implemented"

-1 ERESTART "restart syscall"

-2 EJUSTRETURN "don’t modify regs, just return"

123 ESOFT

124 EMEDIA

125 ERELOCATED

RELATED INFORMATION

perror(3)
<errno.h>

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026