読者です 読者をやめる 読者になる 読者になる

errno の値の一覧

gdbデバッグする際に、errno.h の各値がわからなかったので、以下のプログラムでリストしてみた。

#include <stdio.h>
#include <errno.h>

main(){

printf("E2BIG:%d\n", E2BIG);
printf("EACCES:%d\n", EACCES);
printf("EADDRINUSE:%d\n", EADDRINUSE);
printf("EADDRNOTAVAIL:%d\n", EADDRNOTAVAIL);
printf("EAFNOSUPPORT:%d\n", EAFNOSUPPORT);
printf("EAGAIN:%d\n", EAGAIN);
printf("EALREADY:%d\n", EALREADY);
printf("EBADE:%d\n", EBADE);
printf("EBADF:%d\n", EBADF);
printf("EBADFD:%d\n", EBADFD);
printf("EBADMSG:%d\n", EBADMSG);
printf("EBADR:%d\n", EBADR);
printf("EBADRQC:%d\n", EBADRQC);
printf("EBADSLT:%d\n", EBADSLT);
printf("EBUSY:%d\n", EBUSY);
//printf("ECANCELED:%d\n", ECANCELED);
printf("ECHILD:%d\n", ECHILD);
printf("ECHRNG:%d\n", ECHRNG);
printf("ECOMM:%d\n", ECOMM);
printf("ECONNABORTED:%d\n", ECONNABORTED);
printf("ECONNREFUSED:%d\n", ECONNREFUSED);
printf("ECONNRESET:%d\n", ECONNRESET);
printf("EDEADLK:%d\n", EDEADLK);
printf("EDEADLOCK:%d\n", EDEADLOCK);
printf("EDESTADDRREQ:%d\n", EDESTADDRREQ);
printf("EDOM:%d\n", EDOM);
printf("EDQUOT:%d\n", EDQUOT);
printf("EEXIST:%d\n", EEXIST);
printf("EFAULT:%d\n", EFAULT);
printf("EFBIG:%d\n", EFBIG);
printf("EHOSTDOWN:%d\n", EHOSTDOWN);
printf("EHOSTUNREACH:%d\n", EHOSTUNREACH);
printf("EIDRM:%d\n", EIDRM);
printf("EILSEQ:%d\n", EILSEQ);
printf("EINPROGRESS:%d\n", EINPROGRESS);
printf("EINTR:%d\n", EINTR);
printf("EINVAL:%d\n", EINVAL);
printf("EIO:%d\n", EIO);
printf("EISCONN:%d\n", EISCONN);
printf("EISDIR:%d\n", EISDIR);
//printf("EISNAM:%d\n", EISNAM);
//printf("EKEYEXPIRED:%d\n", EKEYEXPIRED);
//printf("EKEYREJECTED:%d\n", EKEYREJECTED);
//printf("EKEYREVOKED:%d\n", EKEYREVOKED);
printf("EL2HLT:%d\n", EL2HLT);
printf("EL2NSYNC:%d\n", EL2NSYNC);
printf("EL3HLT:%d\n", EL3HLT);
printf("EL3RST:%d\n", EL3RST);
printf("ELIBACC:%d\n", ELIBACC);
printf("ELIBBAD:%d\n", ELIBBAD);
printf("ELIBMAX:%d\n", ELIBMAX);
printf("ELIBSCN:%d\n", ELIBSCN);
printf("ELIBEXEC:%d\n", ELIBEXEC);
printf("ELOOP:%d\n", ELOOP);
//printf("EMEDIUMTYPE:%d\n", EMEDIUMTYPE);
printf("EMFILE:%d\n", EMFILE);
printf("EMLINK:%d\n", EMLINK);
printf("EMSGSIZE:%d\n", EMSGSIZE);
printf("EMULTIHOP:%d\n", EMULTIHOP);
printf("ENAMETOOLONG:%d\n", ENAMETOOLONG);
printf("ENETDOWN:%d\n", ENETDOWN);
printf("ENETRESET:%d\n", ENETRESET);
printf("ENETUNREACH:%d\n", ENETUNREACH);
printf("ENFILE:%d\n", ENFILE);
printf("ENOBUFS:%d\n", ENOBUFS);
printf("ENODATA:%d\n", ENODATA);
printf("ENODEV:%d\n", ENODEV);
printf("ENOENT:%d\n", ENOENT);
printf("ENOEXEC:%d\n", ENOEXEC);
//printf("ENOKEY:%d\n", ENOKEY);
printf("ENOLCK:%d\n", ENOLCK);
printf("ENOLINK:%d\n", ENOLINK);
printf("ENOMEDIUM:%d\n", ENOMEDIUM);
printf("ENOMEM:%d\n", ENOMEM);
printf("ENOMSG:%d\n", ENOMSG);
printf("ENONET:%d\n", ENONET);
printf("ENOPKG:%d\n", ENOPKG);
printf("ENOPROTOOPT:%d\n", ENOPROTOOPT);
printf("ENOSPC:%d\n", ENOSPC);
printf("ENOSR:%d\n", ENOSR);
printf("ENOSTR:%d\n", ENOSTR);
printf("ENOSYS:%d\n", ENOSYS);
printf("ENOTBLK:%d\n", ENOTBLK);
printf("ENOTCONN:%d\n", ENOTCONN);
printf("ENOTDIR:%d\n", ENOTDIR);
printf("ENOTEMPTY:%d\n", ENOTEMPTY);
printf("ENOTSOCK:%d\n", ENOTSOCK);
printf("ENOTSUP:%d\n", ENOTSUP);
printf("ENOTTY:%d\n", ENOTTY);
printf("ENOTUNIQ:%d\n", ENOTUNIQ);
printf("ENXIO:%d\n", ENXIO);
printf("EOPNOTSUPP:%d\n", EOPNOTSUPP);
printf("EOVERFLOW:%d\n", EOVERFLOW);
printf("EPERM:%d\n", EPERM);
printf("EPFNOSUPPORT:%d\n", EPFNOSUPPORT);
printf("EPIPE:%d\n", EPIPE);
printf("EPROTO:%d\n", EPROTO);
printf("EPROTONOSUPPORT:%d\n", EPROTONOSUPPORT);
printf("EPROTOTYPE:%d\n", EPROTOTYPE);
printf("ERANGE:%d\n", ERANGE);
printf("EREMCHG:%d\n", EREMCHG);
printf("EREMOTE:%d\n", EREMOTE);
//printf("EREMOTEIO:%d\n", EREMOTEIO);
//printf("ERESTART:%d\n", ERESTART);
printf("EROFS:%d\n", EROFS);
printf("ESHUTDOWN:%d\n", ESHUTDOWN);
printf("ESPIPE:%d\n", ESPIPE);
printf("ESOCKTNOSUPPORT:%d\n", ESOCKTNOSUPPORT);
printf("ESRCH:%d\n", ESRCH);
printf("ESTALE:%d\n", ESTALE);
//printf("ESTRPIPE:%d\n", ESTRPIPE);
printf("ETIME:%d\n", ETIME);
printf("ETIMEDOUT:%d\n", ETIMEDOUT);
printf("ETXTBSY:%d\n", ETXTBSY);
//printf("EUCLEAN:%d\n", EUCLEAN);
printf("EUNATCH:%d\n", EUNATCH);
printf("EUSERS:%d\n", EUSERS);
printf("EWOULDBLOCK:%d\n", EWOULDBLOCK);
printf("EXDEV:%d\n", EXDEV);
printf("EXFULL :%d\n", EXFULL );

}

結果は、

E2BIG:7
EACCES:13
EADDRINUSE:112
EADDRNOTAVAIL:125
EAFNOSUPPORT:106
EAGAIN:11
EALREADY:120
EBADE:50
EBADF:9
EBADFD:81
EBADMSG:77
EBADR:51
EBADRQC:54
EBADSLT:55
EBUSY:16
ECHILD:10
ECHRNG:37
ECOMM:70
ECONNABORTED:113
ECONNREFUSED:111
ECONNRESET:104
EDEADLK:45
EDEADLOCK:56
EDESTADDRREQ:121
EDOM:33
EDQUOT:132
EEXIST:17
EFAULT:14
EFBIG:27
EHOSTDOWN:117
EHOSTUNREACH:118
EIDRM:36
EILSEQ:138
EINPROGRESS:119
EINTR:4
EINVAL:22
EIO:5
EISCONN:127
EISDIR:21
EL2HLT:44
EL2NSYNC:38
EL3HLT:39
EL3RST:40
ELIBACC:83
ELIBBAD:84
ELIBMAX:86
ELIBSCN:85
ELIBEXEC:87
ELOOP:92
EMFILE:24
EMLINK:31
EMSGSIZE:122
EMULTIHOP:74
ENAMETOOLONG:91
ENETDOWN:115
ENETRESET:126
ENETUNREACH:114
ENFILE:23
ENOBUFS:105
ENODATA:61
ENODEV:19
ENOENT:2
ENOEXEC:8
ENOLCK:46
ENOLINK:67
ENOMEDIUM:135
ENOMEM:12
ENOMSG:35
ENONET:64
ENOPKG:65
ENOPROTOOPT:109
ENOSPC:28
ENOSR:63
ENOSTR:60
ENOSYS:88
ENOTBLK:15
ENOTCONN:128
ENOTDIR:20
ENOTEMPTY:90
ENOTSOCK:108
ENOTSUP:134
ENOTTY:25
ENOTUNIQ:80
ENXIO:6
EOPNOTSUPP:95
EOVERFLOW:139
EPERM:1
EPFNOSUPPORT:96
EPIPE:32
EPROTO:71
EPROTONOSUPPORT:123
EPROTOTYPE:107
ERANGE:34
EREMCHG:82
EREMOTE:66
EROFS:30
ESHUTDOWN:110
ESPIPE:29
ESOCKTNOSUPPORT:124
ESRCH:3
ESTALE:133
ETIME:62
ETIMEDOUT:116
ETXTBSY:26
EUNATCH:42
EUSERS:131
EWOULDBLOCK:11
EXDEV:18
EXFULL :52