From: Kees van Reeuwijk Date: Tue, 22 Jun 2010 10:50:03 +0000 (+0000) Subject: Sort out problems with POSIX constants. X-Git-Tag: v3.1.8~407 X-Git-Url: http://zhaoyanbai.com/repos/icons/debian/static/%22http:/zlib_tech.html?a=commitdiff_plain;h=3eed5d3bdb3d3a7bee0dc38853ef04b2130a046e;p=minix.git Sort out problems with POSIX constants. --- diff --git a/include/Makefile b/include/Makefile index b80d23585..782ded77e 100644 --- a/include/Makefile +++ b/include/Makefile @@ -15,6 +15,7 @@ INCS+= minix/a.out.h minix/bitmap.h minix/callnr.h minix/cdrom.h \ minix/com.h minix/config.h minix/const.h minix/cpufeature.h \ minix/crtso.h minix/debug.h minix/devio.h minix/dirent.h \ minix/dir.h minix/dl_eth.h minix/dmap.h minix/driver.h \ + minix/limits.h \ minix/drivers.h minix/drvlib.h minix/ds.h minix/endpoint.h \ minix/fslib.h minix/ioctl.h minix/ipc.h minix/ipcconst.h \ minix/keymap.h minix/minlib.h minix/mq.h \ diff --git a/include/limits.h b/include/limits.h index 3baa81d0e..d2742005e 100644 --- a/include/limits.h +++ b/include/limits.h @@ -6,6 +6,8 @@ #ifndef _LIMITS_H #define _LIMITS_H +#include + /* Definitions about chars (8 bits in MINIX, and signed). */ #define CHAR_BIT 8 /* # bits in a char */ #define CHAR_MIN -128 /* minimum value of a char */ @@ -62,8 +64,13 @@ #define _POSIX_MAX_INPUT 255 /* you can type 255 chars ahead */ #define _POSIX_NAME_MAX DIRSIZ /* max. file name length */ #define _POSIX_NGROUPS_MAX 8 /* max. number of supplemental groups */ -#define _POSIX_OPEN_MAX 16 /* a process may have 16 files open */ -#define _POSIX_PATH_MAX 255 /* a pathname may contain 255 chars */ + +/* a process may have this many files open */ +#define _POSIX_OPEN_MAX __MINIX_OPEN_MAX + +/* a pathname may contain at most this many chars */ +#define _POSIX_PATH_MAX __MINIX_PATH_MAX + #define _POSIX_PIPE_BUF 512 /* pipes writes of 512 bytes must be atomic */ #define _POSIX_STREAM_MAX 8 /* at least 8 FILEs can be open at once */ #define _POSIX_TZNAME_MAX 3 /* time zone names can be at least 3 chars */ @@ -85,7 +92,7 @@ #define ARG_MAX 4096 /* args + environ on small machines */ #endif #define CHILD_MAX _NO_LIMIT /* MINIX does not limit children */ -#define OPEN_MAX 30 /* # open files a process may have */ +#define OPEN_MAX __MINIX_OPEN_MAX /* # open files a process may have */ #if 0 /* V1 file system */ #define LINK_MAX CHAR_MAX /* # links a file may have */ #else /* V2 or better file system */ @@ -94,7 +101,7 @@ #define MAX_CANON 255 /* size of the canonical input queue */ #define MAX_INPUT 255 /* size of the type-ahead buffer */ #define NAME_MAX DIRSIZ /* # chars in a file name */ -#define PATH_MAX 255 /* # chars in a path name */ +#define PATH_MAX __MINIX_PATH_MAX /* # chars in a path name */ #define PIPE_BUF 7168 /* # bytes in atomic write to a pipe */ #define STREAM_MAX 20 /* must be the same as FOPEN_MAX in stdio.h */ #define TZNAME_MAX 3 /* maximum bytes in a time zone name is 3 */ diff --git a/include/minix/limits.h b/include/minix/limits.h new file mode 100644 index 000000000..41dcc4455 --- /dev/null +++ b/include/minix/limits.h @@ -0,0 +1,12 @@ +/* The header defines the Minix values for some MINIX + * constants. Both the MINIX constants and the non-posix constants + * refer to these underlying definitions. + */ + +#ifndef _MINIX_LIMITS_H +#define _MINIX_LIMITS_H + +#define __MINIX_OPEN_MAX 30 /* a process may have 30 files open */ +#define __MINIX_PATH_MAX 255 /* a pathname may contain 255 chars */ + +#endif /* _MINIX_LIMITS_H */ diff --git a/include/sys/param.h b/include/sys/param.h index 389a078e2..13b2c6bc8 100644 --- a/include/sys/param.h +++ b/include/sys/param.h @@ -6,9 +6,10 @@ sys/param.h #define __SYS_PARAM_H__ #include +#include #define MAXHOSTNAMELEN 256 /* max hostname size */ #define NGROUPS 8 /* max number of supplementary groups */ -#define MAXPATHLEN PATH_MAX +#define MAXPATHLEN __MINIX_PATH_MAX #endif /* __SYS_PARAM_H__ */ diff --git a/include/sys/select.h b/include/sys/select.h index 3132d718f..8b7f3b23b 100644 --- a/include/sys/select.h +++ b/include/sys/select.h @@ -1,12 +1,9 @@ #ifndef _SYS_SELECT_H #define _SYS_SELECT_H 1 -#ifndef _POSIX_SOURCE -#define _POSIX_SOURCE 1 -#endif - #include #include +#include #include #include @@ -22,7 +19,7 @@ typedef u32_t fd_mask; /* Default FD_SETSIZE is OPEN_MAX. */ #ifndef FD_SETSIZE -#define FD_SETSIZE OPEN_MAX +#define FD_SETSIZE __MINIX_OPEN_MAX #endif /* We want to store FD_SETSIZE bits. */