STRERROR(3) FreeBSD Library Functions Manual STRERROR(3)
NAME
perror, strerror, strerror_r, sys_errlist, sys_nerr — system error mes‐
sages
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <stdio.h>
void
perror(const char *string);
...
DESCRIPTION
...
The perror() function finds the error message corresponding to the cur‐
rent value of the global variable errno (intro(2)) and writes it, fol‐
lowed by a newline, to the standard error file descriptor. If the argu‐
ment 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.
...
STANDARDS
The perror() and strerror() functions conform to ISO/IEC 9899:1999
(「ISO C99」). ...
如果您總是使用大小爲len的'1'元素來調用它,則不需要將'fwrite'與元素數進行比較。然後可能的返回值只有0和1,其中0表示任何失敗,1表示成功。 – 2011-02-22 18:56:57