1. ¼òµ¥Ã÷ÁË£¬Ò»¸öÃüÁÏ뿴ʲô¿´Ê²Ã´£º
# perror
Èç# perror 0 ±íʾSuccess, #perror 1±íʾOperation not permitted
2. Ö±½Ó¿´CÎļþÀïµÄ¶¨Ò壺
# more /usr/include/asm-generic/errno-base.h (»ù±¾´íÎ󣬴Ó0µ½34)
# more /usr/include/asm-generic/errno.h (À©Õ¹´íÎ󣬴Ó35µ½131)
3. д¸öC³ÌÐòÀ´ÇÆÇÆ£º
# vi errorlist.c[code]#include
#include
#include
int main()
{
int i;
for (i=0; i<257; i++)
{
printf("Error # %d: %s\n", i, strerror(i));
}
}[/code]# gcc errorlist.c ±àÒë¸ÃCÎļþ
# ./a.out Ö´ÐУ¬²é¿´Êä³ö½á¹û
ÆäʵÓеĶ«Î÷ÕæµÄºÜ¼òµ¥£¬Ö»Êǵ±Äã²»µÃÆäÃŶøÈëʱ£¬Ö»ÄÜÍûÑóÐË̾!
yanfei163 ÓÚ 2008-02-26 23:23:15·¢±í:
ºÃÌù ¶¥Ò»¸ö