[LCP]error control

Keith Schincke keith.schincke at gmail.com
Mon Feb 7 03:01:01 UTC 2005


> 1) errno

error is just a flag indicating that a system call or other function has failed.
"man 3 errono"

> 2) perror

perror is a function that will print an error message to standard error. 
"man 3 perror"

errono is good for checking for a program error. perror is good for
informing a user of an error.

if(errno)
{
    perror ("Something failed" ) ;
}

Advanced Programming in the Unix Environment by Stevens has
information on programming in the *nix environment.

Keith




More information about the linuxCprogramming mailing list