The OpenNET Project / Index page

[ новости /+++ | форум | теги | ]

Интерактивная система просмотра системных руководств (man-ов)

 ТемаНаборКатегория 
 
 [Cписок руководств | Печать]

strerror (3)
  • strerror (3) ( Solaris man: Библиотечные вызовы )
  • >> strerror (3) ( FreeBSD man: Библиотечные вызовы )
  • strerror (3) ( Русские man: Библиотечные вызовы )
  • strerror (3) ( Linux man: Библиотечные вызовы )
  • strerror (3) ( POSIX man: Библиотечные вызовы )

  • BSD mandoc
     

    NAME

    
    
    perror
    
     
    strerror
    
     
    strerror_r
    
     
    sys_errlist
    
     
    sys_nerr
    
     - system error messages
    
     
    

    LIBRARY

    Lb libc
    
     
    

    SYNOPSIS

       #include <stdio.h>
    void perror (const char *string);
    Vt extern const char * const sys_errlist[] ; Vt extern const int sys_nerr ;    #include <string.h>
    char * strerror (int errnum);
    int strerror_r (int errnum char *strerrbuf size_t buflen);
     

    DESCRIPTION

    The strerror (,);
    strerror_r ();
    and perror ();
    functions look up the error message string corresponding to an error number.

    The strerror ();
    function accepts an error number argument Fa errnum and returns a pointer to the corresponding message string.

    The strerror_r ();
    function renders the same result into Fa strerrbuf for a maximum of Fa buflen characters and returns 0 upon success.

    The perror ();
    function finds the error message corresponding to the current value of the global variable errno (intro(2) ) and writes it, followed by a newline, to the standard error file descriptor. If the argument Fa string is non- NULL and does not point to the null character, this string is prepended to the message string and separated from it by a colon and space (`` '' ) otherwise, only the error message string is printed.

    If the error number is not recognized, these functions return an error message string containing ``Unknown error:  '' followed by the error number in decimal. The strerror ();
    and strerror_r ();
    functions return Er EINVAL as a warning. Error numbers recognized by this implementation fall in the range 0 < Fa errnum < Fa sys_nerr .

    If insufficient storage is provided in Fa strerrbuf (as specified in Fa buflen ) to contain the error string, strerror_r ();
    returns Er ERANGE and Fa strerrbuf will contain an error message that has been truncated and NUL terminated to fit the length specified by Fa buflen .

    The message strings can be accessed directly using the external array sys_errlist The external value sys_nerr contains a count of the messages in sys_errlist The use of these variables is deprecated; strerror ();
    or strerror_r ();
    should be used instead.  

    SEE ALSO

    intro(2), psignal(3)  

    STANDARDS

    The perror ();
    and strerror ();
    functions conform to St -isoC-99 . The strerror_r ();
    function conforms to St -p1003.1-2001 .  

    HISTORY

    The strerror ();
    and perror ();
    functions first appeared in BSD 4.4 The strerror_r ();
    function was implemented in Fx 4.4 by An Wes Peters Aq [email protected] .  

    BUGS

    For unknown error numbers, the strerror ();
    function will return its result in a static buffer which may be overwritten by subsequent calls.

    The return type for strerror ();
    is missing a type-qualifier; it should actually be Vt const char * .

    Programs that use the deprecated sys_errlist variable often fail to compile because they declare it inconsistently.


     

    Index

    NAME
    LIBRARY
    SYNOPSIS
    DESCRIPTION
    SEE ALSO
    STANDARDS
    HISTORY
    BUGS


    Поиск по тексту MAN-ов: 




    Партнёры:
    PostgresPro
    Inferno Solutions
    Hosting by Hoster.ru
    Хостинг:

    Закладки на сайте
    Проследить за страницей
    Created 1996-2024 by Maxim Chirkov
    Добавить, Поддержать, Вебмастеру