Reading the Unix Manual Pages

The man entries contain most or all of the following parts, more or less in this order:

funcname(secno) : in the upper right corner, the function name and manual section number.

NAME : the name of the function(s) covered by the manual entry, and a very brief description.

SYNTAX or SYNOPSIS : the function name as it would appear in the function definition line, followed by the declarations of the arguments. This tells you what data type the function returns, and the order and type of the arguments. It is not an example of a call to the function, and it does not mean you should include the function declaration in your program. The argument declarations should match the data types of the arguments you are using in your call (see EXAMPLES below). If what the man page tells you to use does not work, try other combinations of * and & in the declaration and call.

DESCRIPTION : the full description of what the function is and does.

ENVIRONMENT : Unix C is useable in more than one operating system. If there are differences, they may appear here.

EXAMPLES : not always included, but should be. You may find that sometimes the declarations of function parameters differ between the descriptive section and the example programs. For instance, something declared in the syntax section as int* parameter may appear in the example program as int parameter. Use whichever version works best, or either one if they both work.

OPTIONS : for Unix commands, a list of all the possible option flags and their effects.

RESTRICTIONS : limits on field or buffer length and so on will show up here. If you think you have used the command correctly and it still fails, check the restrictions. Your problem may be that what you want to do cannot be done. Sometimes this is due to design limitations, sometimes it is a known bug.

RETURN VALUE : any function not listed as type void returns some value. The online man pages do not always tell you what the values mean, but the hardcopy manual may. For instance, input and output functions return a code which tells the success or failure of the operation. The code may give only success or failure, or it may tell you how many items were successfully transmitted. It is a good idea to check the return codes in your program, so you will know whether things are working correctly.

DIAGNOSTICS : things that may happen when all does not go well. Even if the same sympton is produced by several problems, you at least have a list of possibilities to check out.

FILES USED : Unix commands may get information from files, and may write information to files as well. The list given here may help when you get an error message referring to a file, when you know you did not type in that file name. The problem might be that your paths are not set correctly, so the file cannot be found, or it may be that the file has been accidentally deleted.

SEE ALSO : a list of related manual pages, in the form funcname (secname). You can use these to look further. The secnum helps the man command by telling it to look in just one set of files, rather than in all the manual files. If the cross-reference is printf(1), for example, use % man 1 printf


Previous Page
Index
Next Page