From: Gianluca Guida Date: Fri, 4 Mar 2011 22:37:43 +0000 (+0000) Subject: Sync NBSD libc errno.h with minix errno.h X-Git-Tag: v3.2.0~620 X-Git-Url: http://zhaoyanbai.com/repos/%22../static/icons/man.7.txt?a=commitdiff_plain;h=693842c8558cfa4a4e6ff057347992bf3c435e7e;p=minix.git Sync NBSD libc errno.h with minix errno.h This patch fixes some wrong error code number in nbsd libc's sys/errno.h and adds new ones. As in NetBSD the errno.h is used to automatically generate errlist.c array, EBADCPU set to 1000 to be a bit too large, so we instruct the awk script to stop at EDEADEPT (ELAST). --- diff --git a/lib/nbsd_libc/gen/errlist-minix.awk b/lib/nbsd_libc/gen/errlist-minix.awk index 1b3f7f27a..afa7f92b1 100644 --- a/lib/nbsd_libc/gen/errlist-minix.awk +++ b/lib/nbsd_libc/gen/errlist-minix.awk @@ -73,11 +73,16 @@ BEGIN { } perror("ENOERROR", 0, "Undefined error: 0"); errno = 1; + last = 0; } /^#define/ { + if ( last ) next; + name = $2; - if (name == "ELAST") + if (name == "ELAST") { + last = 1; next; + } number = $4; if (number < 0 || number == "EAGAIN") next; diff --git a/nbsd_include/sys/errno.h b/nbsd_include/sys/errno.h index 8b4b966dd..2655772f6 100644 --- a/nbsd_include/sys/errno.h +++ b/nbsd_include/sys/errno.h @@ -107,12 +107,12 @@ #define EOPNOTSUPP (_SIGN 76 ) /* Operation not supported */ #define ENOTSUP EOPNOTSUPP /* Not supported */ #define ENETDOWN (_SIGN 77 ) /* network is down */ -#define ECONNABORTED (_SIGN 78 ) /* Software caused connection abort */ +#define EPFNOSUPPORT (_SIGN 78 ) /* Protocol family not supported */ #define EDESTADDRREQ (_SIGN 79 ) /* Destination address required */ #define EHOSTDOWN (_SIGN 80 ) /* Host is down */ #define ENETRESET (_SIGN 81 ) /* Network dropped connection on reset */ #define ESOCKTNOSUPPORT (_SIGN 82 ) /* Socket type not supported */ -#define EPFNOSUPPORT (_SIGN 83 ) /* Protocol family not supported */ +#define ECONNABORTED (_SIGN 83 ) /* Software caused connection abort */ #define ETOOMANYREFS (_SIGN 84 ) /* Too many references: can't splice */ /* The following are not POSIX errors, but they can still happen. @@ -166,8 +166,20 @@ #define ENOSTR (_SIGN 192 ) /* Not a STREAM */ #define ETIME (_SIGN 193 ) /* STREAM ioctl timeout */ -#define ELAST EDONTREPLY /* Must equal largest errno */ +/* The following are non-POSIX server responses */ +#define EBADEPT (_SIGN 301 ) /* specified endpoint is bad */ +#define EDEADEPT (_SIGN 302 ) /* specified endpoint is not alive */ + +/* This define is put before EBADCPU to instruct errlist-minix.awk to + stop creating the errlist array here. '1000' infact is definitely + too large for an error number to be included in a fixed array, as + this would need ~700 empty array entries. */ +#define ELAST EBADCPU /* Must equal largest errno */ + +#define EBADCPU (_SIGN 1000 ) /* requested CPU does not work */ + + /* Here are the numerical values of the error numbers. */ -#define _NERROR 201 /* number of errors */ +#define _NERROR 1000 /* number of errors */ #endif /* _ERRNO_H */