error

ERROR(3)                   Linux Programmer's Manual                  ERROR(3)



åå
       error, error_at_line, error_message_count, error_one_per_line,
       error_print_progname - glibc ã®ã¨ã©ã¼æ¸ãåºãé¢æ°

æ¸å¼
       #include <error.h>

       void error(int status, int errnum, const char *format, ...);

       void error_at_line(int status, int errnum, const char *filename,
                          unsigned int linenum, const char *format, ...);

       extern unsigned int error_message_count;

       extern int error_one_per_line;

       extern void (*error_print_progname) (void);

説æ
       error()  ã¯æ±ç¨çãªã¨ã©ã¼æ¸ãåºãé¢æ°ã§ããã ãã®é¢æ°ã¯æ¨æºåºå (stdout)
       ã«æ¸ãåºãã¦ãããæ¨æºã¨ã©ã¼åºå (stderr)  ã«æ¸ãåºãã æ¸ãåºãå容ã¯ããã‐
       ã°ã©ã åã»ã³ãã³ã»ã¹ãã¼ã¹ã» printf(3)  å½¢å¼ã® ãã©ã¼ãããæåå format
       ã§æå®ãããã¡ãã»ã¼ã¸ã§ããã errnum ã 0 以å¤ã®å ´åã2 ã¤ç®ã®ã³ã‐
       ã³ã¨ã¹ãã¼ã¹ã®å¾ã« strerror(errnum) ã§æå®ãããæååãæ¸ãåºãã format
       ã«å¿è¦ãªä»»æã®å¼ãæ°ããå¼ãæ°ãªã¹ãã® format ã®å¾ã«ç¶ãã
       åºåã®çµç«¯ã«ã¯æ¹è¡æåãä»ãã

       error()  ã§åºåãããããã°ã©ã åã¯ã大åå¤æ° program_invocation_name(3)
       ã®å¤ã§ããã program_invocation_name ã®åæå¤ã¯ main()  ã® argv[0] ã®å¤ã¨ç‐
       ããã ãã®å¤æ°ã®å¤ã¯å¤æ´å¯è½ã§ãããå¤æ´ãã㨠error()  ã®åºåãå¤ããã

       status ã 0 以å¤ã®å ´åã error()  㯠exit(3)
       ãå¼ã³åºãã¦ãæå®ãããçµäºã¹ãã¼ã¿ã¹ã§ããã°ã©ã ãçµäºãããã

       error_at_line()  é¢æ°ã¯ãå¼ãæ° filename 㨠linenum ã追å ããã¦ãã以å¤ã¯ã
       error() ã¨åãã§ããã çæãããåºåã¯ãããã°ã©ã åã®å¾ã« ã³ãã³ã»filename ã®å¤ã»ã³ã‐
       ã³ã»linenum ã®å¤ãæ¸ãåºããã以å¤ã¯ã error()  ã¨åãã§ããã ããªããã»ããµã®å¤
       __LINE__ 㨠__FILE__ ã¯ã error_at_line()  ãå¼ã³åºãã¨ãã«å½¹ã«ç«ã¤ã
       ãã®ä»ã®ããªããã»ããµã®å¤ã使ããã¨ãã§ããã
       ä¾ãã°ããããã®å¼ãæ°ã§å¥åãã¡ã¤ã«ã«ãããä½ç½®ãåç§ã§ããã

       大åå¤æ° error_one_per_line ã 0 以å¤ã«è¨å®ããã¦ããå ´åã filename ã¨
       linenum ã®å¤ãå±ã«çãã error_at_line()  ã®å¼ã³åºãã¯ã 1 ã¤ã® (æåã®)
       ã¡ãã»ã¼ã¸ã®åºåã«ã¾ã¨ããããã

       大åå¤æ° error_message_count ã¯ã error()  㨠error_at_line()
       ã§åºåãããã¡ãã»ã¼ã¸ã®æ°ã表ãã

       大åå¤æ° error_print_progname ã« é¢æ°ã®ã¢ãã¬ã¹ãå²ãå½ã¦ããã¦ããå ´å (ã¤ã¾ã
       NULL ã§ã¯ãªãå ´å)ã ã¡ãã»ã¼ã¸ã®åã«ããã°ã©ã åã¨ã³ãã³ãæ¸ãåºãã®ã§ã¯ãªãã
       ãã®é¢æ°ãå¼ã³åºãã ãã®é¢æ°ã¯æ¨æºã¨ã©ã¼åºå (stderr) ã«å¯¾ãã¦ã®é©åãªæå‐
       åãæ¸ãåºããªããã°ãªããªãã

æºæ
       ãããã®é¢æ°ã¨å¤æ°ã¯ GNU ã«ããæ¡å¼µã§ããã 移æ¤æ§ãèãããã‐
       ã°ã©ã ã§ã¯ä½¿ç¨ãã¹ãã§ã¯ãªãã

é¢é£é ç®
       err(3), errno(3), exit(3), perror(3), program_invocation_name(3),
       strerror(3)

ãã®ææ¸ã«ã¤ãã¦
       ãã® man ãã¼ã¸ã¯ Linux man-pages ããã¸ã§ã¯ãã®ãªãªã¼ã¹ 3.79 ã®ä¸é¨
       ã§ãããããã¸ã§ã¯ãã®èª¬æã¨ãã°å ±åã«é¢ããæå ±ã¯
       http://www.kernel.org/doc/man-pages/ ã«æ¸ããã¦ããã



GNU                               2010-08-29                          ERROR(3)