home *** CD-ROM | disk | FTP | other *** search
/ PC Extra Super CD 1998 January / PCPLUS131.iso / DJGPP / V2 / DJLSR201.ZIP / src / libc / ansi / stdio / perror.txh < prev    next >
Encoding:
Text File  |  1995-07-10  |  514 b   |  31 lines

  1. @node perror, stdio
  2. @subheading Syntax
  3.  
  4. @example
  5. #include <stdio.h>
  6.  
  7. void perror(const char *string);
  8. @end example
  9.  
  10. @subheading Description
  11.  
  12. This function formats an error message and prints it to @code{stderr}. 
  13. The message is the @var{string}, a colon, and a message suitable for the error
  14. condition indicated by @code{errno}. 
  15.  
  16. @subheading Return Value
  17.  
  18. None.
  19.  
  20. @subheading Example
  21.  
  22. @example
  23. int x = open("foo", O_RDONLY);
  24. if (x < 0)
  25. @{
  26.   perror("foo");
  27.   exit(1);
  28. @}
  29. @end example
  30.  
  31.