All of the C library functions are part of the AIX Base Operating System (BOS) Runtime Services and are described in detail in the AIX Version 4 Technical Reference, Volumes 1 and 2: Base Operating System and Extensions. Refer to the Subroutines Overview in AIX Version 4 General Programming Concepts for general information about library functions.
The macro NULL, defined in the /usr/include/stddef.h header file, expands to the null pointer constant, (void *)0. (4.1.5)
The assert macro, defined in the /usr/include/assert.h header file, writes the following message to standard error and stops the program (4.2):
Assertion failed: expression, file file_name, line line_number
In the error message, file_name is the name of the source file and line_number is the source line number of the assert statement.
The character-testing (ctype) functions (isalnum, isalpha, iscntrl, islower, isprint, and isupper) test for the following characters (4.3.1):
isalnum The alphanumeric characters [A-Z], [a-z], and [0-9] isalpha The alphabetic characters [A-Z] and [a-z] iscntrl The nonprinting characters and any control character (ASCII 0-31, or 127) islower The lowercase characters [a-z] isprint The alphanumeric, punctuation, and space printing characters isupper The uppercase characters [A-Z]
After a domain error (EDOM), the mathematics functions return the value NaN. (4.5.1)
The mathematics functions set the integer expression errno to the value of the macro ERANGE on underflow range errors. The /usr/include/sys/errno.h header file declares the errno variable and defines a constant for each of the possible error conditions. (4.5.1)
When the fmod function has a second argument of zero, a domain error (EDOM) is generated and NaN is returned. (4.5.6.4)
Signals
The sigaction, sigvec,
and signal functions of the C Library specify
the action to take upon delivery of a signal. These functions are
described in the AIX Version 4 Technical Reference, Volumes
1 and 2: Base Operating System and Extensions. (4.7.1.1)
Signals do not have parameters because they are not functions. (4.7.1.1)
The default handling and the handling at program startup for each signal recognized by the signal function are described with the sigaction, sigvec, and signal functions. (4.7.1.1)
The equivalent of signal (sig,SIG_DFL) is performed before the call of a signal handler. (4.7.1.1)
The default handling is reset if a SIGKILL signal is received by a handler specified to the signal function. (4.7.1.1)
Streams and Files
The last line of a text stream does not require a terminating
new-line character. (4.9.2)
Space characters that are written out to a text stream immediately before a new-line character appear when the stream is read back in. (4.9.2)
No null characters can be appended to data written to a binary stream. (4.9.2)
The file position indicator of an append mode stream is initially positioned at the end of the file. (4.9.3)
A write on a text stream does not cause the associated file to be truncated beyond that point. (4.9.3)
Default file buffering is fully buffered. File buffering can be set to line or to unbuffered with the setbuf function. (4.9.3)
A zero-length file can exist. (4.9.3)
The / character is not allowed in a valid file name. (4.9.3)
The same file can be opened multiple times. (4.9.3)
The remove function does not remove an open file. The file is removed after it is closed. (4.9.4.1)
If a file renamed by the rename function exists before a call to the function, the file is renamed anyway. (4.9.4.2)
The output for %p conversion in the fprintf and fscanf functions is a sequence of printable characters in an integer representation. (4.9.6.1 and 4.9.6.2)
In the fscanf function, a - (hyphen) character that is neither the first nor the last character in the scan list for %[ ] conversion is interpreted as indicating a range of characters in the scan list. For example, you can express [0123456789] as [0-9]. The - stands for itself whenever it is the first or the last character in the scan list. (4.9.6.2)
Temporary Files (tmpfile Function)
An open temporary file created by the tmpfile
function is automatically deleted if the program terminates
abnormally. (4.9.4.3)
errno Variable
The errno variable is set to the value of the
macro EINVAL (22) by the fgetpos
or ftell function on failure. (4.9.9.1 and
4.9.9.4)
The perror function writes a message on the standard error output that describes the last error encountered by a system call or library function. (4.9.10.4)
The error message includes the name of the program that caused the error followed by a : (colon), a blank, the message string, and a new-line character. The error number is taken from the global variable errno, which is set when an error occurs, but is not cleared when a successful call is made.
The following table lists the content of the error message strings.
Error Number |
Message Text |
Error Number |
Message Text |
---|---|---|---|
00 |
Error 0 occurred. |
52 |
Missing file or file system |
01 |
Not owner |
53 |
Requests blocked by Administrator |
02 |
No such file or directory |
54 |
Operation would block |
03 |
No such process |
55 |
Operation now in progress |
04 |
Interrupted system call |
56 |
Operation already in progress |
05 |
I/O error |
57 |
Socket operation on non-socket |
06 |
No such device or address |
58 |
Destination address required |
07 |
Arg list too long |
59 |
Message too long |
08 |
Exec format error |
60 |
Protocol wrong type for socket |
09 |
Bad file number |
61 |
Protocol not available |
10 |
No child processes |
62 |
Protocol not supported |
11 |
Resource temporarily unavailable |
63 |
Socket type not supported |
12 |
Not enough space |
64 |
Operation not supported on socket |
13 |
Permission denied |
65 |
Protocol family not supported |
14 |
Bad address |
66 |
Address not supported by protocol family |
15 |
Block device required |
67 |
Address already in use |
16 |
Device busy |
68 |
Cannot assign requested address |
17 |
File exists |
69 |
Network is down |
18 |
Cross-device link |
70 |
Network is unreachable |
19 |
No such device |
71 |
Network dropped connection on reset |
20 |
Not a directory |
72 |
Software caused connection abort |
21 |
Is a directory |
73 |
Connection reset by peer |
22 |
Invalid argument |
74 |
No buffer space available |
23 |
File table overflow |
75 |
Socket is already connected |
24 |
Too many open files |
76 |
Socket is not connected |
25 |
Not a typewriter |
77 |
Cannot send after socket shutdown |
26 |
Text file busy |
78 |
Connection timed out |
27 |
File too large |
79 |
Connection refused |
28 |
No space left on device |
80 |
Host is down |
29 |
Illegal seek |
81 |
No route to host |
30 |
Read-only file system |
82 |
Restart the system call |
31 |
Too many links |
83 |
Too many processes |
32 |
Broken pipe |
84 |
Too many users |
33 |
Argument out of domain |
85 |
Too many levels of symbolic links |
34 |
Result too large |
86 |
File name too long |
35 |
No message of desired type |
87 |
Directory not empty |
36 |
Identifier removed |
88 |
Disk quota exceeded |
37 |
Channel number out of range |
93 |
Item is not local to host |
38 |
Level 2 not synchronized |
109 |
Function not implemented |
39 |
Level 3 halted |
110 |
Media surface error |
40 |
Level 3 reset |
111 |
I/O completed, but needs relocation |
41 |
Link number out of range |
112 |
No attribute found |
42 |
Protocol driver not attached |
113 |
Security Authentication Denied |
43 |
No CSI structure available |
114 |
Not a Trusted Program. Too many references: can't splice |
44 |
Level 2 halted |
115 |
Invalid wide character |
45 |
Deadlock condition if locked |
116 |
Asynchronous I/O canceled |
46 |
Device not ready |
117 |
Out of STREAMS resources |
47 |
Write-protected media |
118 |
System call timed out |
48 |
Unformatted or incompatible media |
119 |
Next message has wrong type |
49 |
No locks available |
120 |
Error in protocol |
50 |
Cannot Establish Connection |
121 |
No message on stream head read q |
51 |
Connection Down |
122 |
fd not associated with a stream |
Note: Messages 89 to 92 and 94 to 108 are reserved for future use.
Memory (calloc, malloc, and realloc Functions)
If the size requested is zero, the calloc, malloc,
and realloc functions return a null pointer. (4.10.3)
abort Function
When the abort function is called, open and
temporary files are closed, and temporary files are erased. (4.10.4.1)
exit Function
If the value of the argument to the exit
function is other than zero, EXIT_SUCCESS, or EXIT_FAILURE the
process ends and returns the value as the return code. (4.10.4.3)
getenv Function
Environment names are defined by the underlying shell being used.
(4.10.4.4)
The environment list obtained by a call to the getenv function is altered in the following manner (4.10.4.4):
int putenv(char *)
system Function
The underlying command shell determines the format of the string
that is passed to the system. (4.10.4.5)
The string that is passed to the system function goes directly to the current shell. Then the shell command interprets it as a command and runs it. (4.10.4.5)
Note: The system function runs only Bourne Shell (bsh) commands. The results are unpredictable if the string parameter is not a valid bsh command.
strerror Function
The format of the error message output of the strerror
function is the same as for perror. (4.11.6.2)
The contents of the error message strings returned by a call to the strerror function is the same as for perror. (4.11.6.2)
Implementation-Defined Behavior
Implementation Dependencies