2005-04-21 16:53:53 +02:00
|
|
|
/* The <limits.h> header defines some basic sizes, both of the language types
|
|
|
|
* (e.g., the number of bits in an integer), and of the operating system (e.g.
|
|
|
|
* the number of characters in a file name.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _LIMITS_H
|
|
|
|
#define _LIMITS_H
|
|
|
|
|
2010-06-22 12:50:03 +02:00
|
|
|
#include <minix/limits.h>
|
|
|
|
|
2005-04-21 16:53:53 +02:00
|
|
|
/* 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 */
|
|
|
|
#define CHAR_MAX 127 /* maximum value of a char */
|
|
|
|
#define SCHAR_MIN -128 /* minimum value of a signed char */
|
|
|
|
#define SCHAR_MAX 127 /* maximum value of a signed char */
|
|
|
|
#define UCHAR_MAX 255 /* maximum value of an unsigned char */
|
|
|
|
#define MB_LEN_MAX 1 /* maximum length of a multibyte char */
|
|
|
|
|
|
|
|
/* Definitions about shorts (16 bits in MINIX). */
|
|
|
|
#define SHRT_MIN (-32767-1) /* minimum value of a short */
|
|
|
|
#define SHRT_MAX 32767 /* maximum value of a short */
|
|
|
|
#define USHRT_MAX 0xFFFF /* maximum value of unsigned short */
|
|
|
|
|
|
|
|
/* _EM_WSIZE is a compiler-generated symbol giving the word size in bytes. */
|
|
|
|
#if _EM_WSIZE == 2
|
|
|
|
#define INT_MIN (-32767-1) /* minimum value of a 16-bit int */
|
|
|
|
#define INT_MAX 32767 /* maximum value of a 16-bit int */
|
|
|
|
#define UINT_MAX 0xFFFF /* maximum value of an unsigned 16-bit int */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if _EM_WSIZE == 4
|
|
|
|
#define INT_MIN (-2147483647-1) /* minimum value of a 32-bit int */
|
|
|
|
#define INT_MAX 2147483647 /* maximum value of a 32-bit int */
|
|
|
|
#define UINT_MAX 0xFFFFFFFF /* maximum value of an unsigned 32-bit int */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*Definitions about longs (32 bits in MINIX). */
|
|
|
|
#define LONG_MIN (-2147483647L-1)/* minimum value of a long */
|
|
|
|
#define LONG_MAX 2147483647L /* maximum value of a long */
|
|
|
|
#define ULONG_MAX 0xFFFFFFFFL /* maximum value of an unsigned long */
|
|
|
|
|
2009-12-09 20:01:38 +01:00
|
|
|
/*Definitions about long longs (64 bits, may not be supported). */
|
|
|
|
#ifdef __LONG_LONG_SUPPORTED
|
|
|
|
#define LLONG_MIN (-0x7FFFFFFFFFFFFFFFLL-1) /* minimum value of a
|
|
|
|
* long long
|
|
|
|
*/
|
|
|
|
#define LLONG_MAX 0x7FFFFFFFFFFFFFFFLL /* maximum value of a
|
|
|
|
* long long
|
|
|
|
*/
|
|
|
|
#define ULLONG_MAX 0xFFFFFFFFFFFFFFFFULL /* maximum value of an
|
|
|
|
* unsigned long long
|
|
|
|
*/
|
|
|
|
#endif
|
|
|
|
|
2009-11-06 09:46:22 +01:00
|
|
|
#include <minix/dir.h>
|
2005-04-21 16:53:53 +02:00
|
|
|
|
|
|
|
/* Minimum sizes required by the POSIX P1003.1 standard (Table 2-3). */
|
|
|
|
#ifdef _POSIX_SOURCE /* these are only visible for POSIX */
|
|
|
|
#define _POSIX_ARG_MAX 4096 /* exec() may have 4K worth of args */
|
|
|
|
#define _POSIX_CHILD_MAX 6 /* a process may have 6 children */
|
|
|
|
#define _POSIX_LINK_MAX 8 /* a file may have 8 links */
|
|
|
|
#define _POSIX_MAX_CANON 255 /* size of the canonical input queue */
|
|
|
|
#define _POSIX_MAX_INPUT 255 /* you can type 255 chars ahead */
|
2005-11-14 17:35:32 +01:00
|
|
|
#define _POSIX_NAME_MAX DIRSIZ /* max. file name length */
|
- Introduce support for sticky bit.
- Revise VFS-FS protocol and update VFS/MFS/ISOFS accordingly.
- Clean up MFS by removing old, dead code (backwards compatibility is broken by
the new VFS-FS protocol, anyway) and rewrite other parts. Also, make sure all
functions have proper banners and prototypes.
- VFS should always provide a (syntactically) valid path to the FS; no need for
the FS to do sanity checks when leaving/entering mount points.
- Fix several bugs in MFS:
- Several path lookup bugs in MFS.
- A link can be too big for the path buffer.
- A mountpoint can become inaccessible when the creation of a new inode
fails, because the inode already exists and is a mountpoint.
- Introduce support for supplemental groups.
- Add test 46 to test supplemental group functionality (and removed obsolete
suppl. tests from test 2).
- Clean up VFS (not everything is done yet).
- ISOFS now opens device read-only. This makes the -r flag in the mount command
unnecessary (but will still report to be mounted read-write).
- Introduce PipeFS. PipeFS is a new FS that handles all anonymous and
named pipes. However, named pipes still reside on the (M)FS, as they are part
of the file system on disk. To make this work VFS now has a concept of
'mapped' inodes, which causes read, write, truncate and stat requests to be
redirected to the mapped FS, and all other requests to the original FS.
2009-12-20 21:27:14 +01:00
|
|
|
#define _POSIX_NGROUPS_MAX 8 /* max. number of supplemental groups */
|
2010-06-22 12:50:03 +02:00
|
|
|
|
|
|
|
/* 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
|
|
|
|
|
2005-04-21 16:53:53 +02:00
|
|
|
#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 */
|
|
|
|
#define _POSIX_SSIZE_MAX 32767 /* read() must support 32767 byte reads */
|
2007-08-07 13:43:49 +02:00
|
|
|
#define _POSIX_SYMLOOP_MAX 8 /* The number of symbolic links that can be
|
|
|
|
* traversed in the resolution of a pathname
|
|
|
|
* in the absence of a loop.
|
|
|
|
*/
|
- Introduce support for sticky bit.
- Revise VFS-FS protocol and update VFS/MFS/ISOFS accordingly.
- Clean up MFS by removing old, dead code (backwards compatibility is broken by
the new VFS-FS protocol, anyway) and rewrite other parts. Also, make sure all
functions have proper banners and prototypes.
- VFS should always provide a (syntactically) valid path to the FS; no need for
the FS to do sanity checks when leaving/entering mount points.
- Fix several bugs in MFS:
- Several path lookup bugs in MFS.
- A link can be too big for the path buffer.
- A mountpoint can become inaccessible when the creation of a new inode
fails, because the inode already exists and is a mountpoint.
- Introduce support for supplemental groups.
- Add test 46 to test supplemental group functionality (and removed obsolete
suppl. tests from test 2).
- Clean up VFS (not everything is done yet).
- ISOFS now opens device read-only. This makes the -r flag in the mount command
unnecessary (but will still report to be mounted read-write).
- Introduce PipeFS. PipeFS is a new FS that handles all anonymous and
named pipes. However, named pipes still reside on the (M)FS, as they are part
of the file system on disk. To make this work VFS now has a concept of
'mapped' inodes, which causes read, write, truncate and stat requests to be
redirected to the mapped FS, and all other requests to the original FS.
2009-12-20 21:27:14 +01:00
|
|
|
#define _POSIX_SYMLINK_MAX 255 /* The number of bytes in a symbolic link */
|
2005-04-21 16:53:53 +02:00
|
|
|
|
|
|
|
/* Values actually implemented by MINIX (Tables 2-4, 2-5, 2-6, and 2-7). */
|
|
|
|
/* Some of these old names had better be defined when not POSIX. */
|
2005-09-16 16:23:14 +02:00
|
|
|
#define _NO_LIMIT 100 /* arbitrary number; limit not enforced */
|
2005-04-21 16:53:53 +02:00
|
|
|
|
- Introduce support for sticky bit.
- Revise VFS-FS protocol and update VFS/MFS/ISOFS accordingly.
- Clean up MFS by removing old, dead code (backwards compatibility is broken by
the new VFS-FS protocol, anyway) and rewrite other parts. Also, make sure all
functions have proper banners and prototypes.
- VFS should always provide a (syntactically) valid path to the FS; no need for
the FS to do sanity checks when leaving/entering mount points.
- Fix several bugs in MFS:
- Several path lookup bugs in MFS.
- A link can be too big for the path buffer.
- A mountpoint can become inaccessible when the creation of a new inode
fails, because the inode already exists and is a mountpoint.
- Introduce support for supplemental groups.
- Add test 46 to test supplemental group functionality (and removed obsolete
suppl. tests from test 2).
- Clean up VFS (not everything is done yet).
- ISOFS now opens device read-only. This makes the -r flag in the mount command
unnecessary (but will still report to be mounted read-write).
- Introduce PipeFS. PipeFS is a new FS that handles all anonymous and
named pipes. However, named pipes still reside on the (M)FS, as they are part
of the file system on disk. To make this work VFS now has a concept of
'mapped' inodes, which causes read, write, truncate and stat requests to be
redirected to the mapped FS, and all other requests to the original FS.
2009-12-20 21:27:14 +01:00
|
|
|
#define NGROUPS_MAX 8 /* max. number of supplemental groups */
|
2005-04-21 16:53:53 +02:00
|
|
|
#if _EM_WSIZE > 2
|
2009-03-17 08:38:35 +01:00
|
|
|
#define ARG_MAX 262144 /* # bytes of args + environ for exec() */
|
2005-04-21 16:53:53 +02:00
|
|
|
#else
|
2005-09-16 16:23:14 +02:00
|
|
|
#define ARG_MAX 4096 /* args + environ on small machines */
|
2005-04-21 16:53:53 +02:00
|
|
|
#endif
|
2005-09-16 16:23:14 +02:00
|
|
|
#define CHILD_MAX _NO_LIMIT /* MINIX does not limit children */
|
2010-06-22 12:50:03 +02:00
|
|
|
#define OPEN_MAX __MINIX_OPEN_MAX /* # open files a process may have */
|
2005-04-21 16:53:53 +02:00
|
|
|
#if 0 /* V1 file system */
|
2005-09-16 16:23:14 +02:00
|
|
|
#define LINK_MAX CHAR_MAX /* # links a file may have */
|
2005-04-21 16:53:53 +02:00
|
|
|
#else /* V2 or better file system */
|
2005-09-16 16:23:14 +02:00
|
|
|
#define LINK_MAX SHRT_MAX /* # links a file may have */
|
2005-04-21 16:53:53 +02:00
|
|
|
#endif
|
2005-09-16 16:23:14 +02:00
|
|
|
#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 */
|
2010-06-22 12:50:03 +02:00
|
|
|
#define PATH_MAX __MINIX_PATH_MAX /* # chars in a path name */
|
2010-07-15 14:48:15 +02:00
|
|
|
#define PIPE_BUF 32768 /* # bytes in atomic write to a pipe */
|
2005-09-16 16:23:14 +02:00
|
|
|
#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 */
|
2010-10-11 00:33:23 +02:00
|
|
|
#define SSIZE_MAX INT_MAX /* max defined byte count for read() */
|
2010-06-22 11:30:26 +02:00
|
|
|
#define SIZE_MAX UINT_MAX
|
- Introduce support for sticky bit.
- Revise VFS-FS protocol and update VFS/MFS/ISOFS accordingly.
- Clean up MFS by removing old, dead code (backwards compatibility is broken by
the new VFS-FS protocol, anyway) and rewrite other parts. Also, make sure all
functions have proper banners and prototypes.
- VFS should always provide a (syntactically) valid path to the FS; no need for
the FS to do sanity checks when leaving/entering mount points.
- Fix several bugs in MFS:
- Several path lookup bugs in MFS.
- A link can be too big for the path buffer.
- A mountpoint can become inaccessible when the creation of a new inode
fails, because the inode already exists and is a mountpoint.
- Introduce support for supplemental groups.
- Add test 46 to test supplemental group functionality (and removed obsolete
suppl. tests from test 2).
- Clean up VFS (not everything is done yet).
- ISOFS now opens device read-only. This makes the -r flag in the mount command
unnecessary (but will still report to be mounted read-write).
- Introduce PipeFS. PipeFS is a new FS that handles all anonymous and
named pipes. However, named pipes still reside on the (M)FS, as they are part
of the file system on disk. To make this work VFS now has a concept of
'mapped' inodes, which causes read, write, truncate and stat requests to be
redirected to the mapped FS, and all other requests to the original FS.
2009-12-20 21:27:14 +01:00
|
|
|
#define SYMLINK_MAX 1024 /* # bytes in a symbolic link */
|
2007-08-07 13:43:49 +02:00
|
|
|
#define SYMLOOP_MAX 16 /* maximum number of symbolic links that can
|
|
|
|
* be reliably traversed in the resolution of
|
|
|
|
* a pathname in the absence of a loop.
|
|
|
|
*/
|
2010-01-08 14:40:34 +01:00
|
|
|
#define IOV_MAX INT_MAX /* maximum number of buffers for readv/writev */
|
2005-04-21 16:53:53 +02:00
|
|
|
#endif /* _POSIX_SOURCE */
|
|
|
|
|
|
|
|
#endif /* _LIMITS_H */
|