xref: /plan9/sys/src/ape/cmd/pax/limits.h (revision 9a747e4fd48b9f4522c70c07e8f882a15030f964)
1*9a747e4fSDavid du Colombier /* $Source: /u/mark/src/pax/RCS/limits.h,v $
2*9a747e4fSDavid du Colombier  *
3*9a747e4fSDavid du Colombier  * $Revision: 1.2 $
4*9a747e4fSDavid du Colombier  *
5*9a747e4fSDavid du Colombier  * 	limits.h - POSIX compatible defnitions for some of <limits.h>
6*9a747e4fSDavid du Colombier  *
7*9a747e4fSDavid du Colombier  * DESCRIPTION
8*9a747e4fSDavid du Colombier  *
9*9a747e4fSDavid du Colombier  * 	We need to include <limits.h> if this system is being compiled with an
10*9a747e4fSDavid du Colombier  * 	ANSI standard C compiler, or if we are running on a POSIX confomrming
11*9a747e4fSDavid du Colombier  * 	system.  If the manifest constant _POSIX_SOURCE is not defined when
12*9a747e4fSDavid du Colombier  * 	<limits.h> is included, then none of the POSIX constants are defined
13*9a747e4fSDavid du Colombier  *	and we need to define them here.  It's a bit wierd, but it works.
14*9a747e4fSDavid du Colombier  *
15*9a747e4fSDavid du Colombier  * 	These values where taken from the IEEE P1003.1 standard, draft 12.
16*9a747e4fSDavid du Colombier  * 	All of the values below are the MINIMUM values allowed by the standard.
17*9a747e4fSDavid du Colombier  * 	Not all values are used by the PAX program, but they are included for
18*9a747e4fSDavid du Colombier  * 	completeness, and for support of future enhancements.  Please see
19*9a747e4fSDavid du Colombier  * 	section 2.9 of the draft standard for more information on the following
20*9a747e4fSDavid du Colombier  * 	constants.
21*9a747e4fSDavid du Colombier  *
22*9a747e4fSDavid du Colombier  * AUTHOR
23*9a747e4fSDavid du Colombier  *
24*9a747e4fSDavid du Colombier  *     Mark H. Colburn, NAPS International (mark@jhereg.mn.org)
25*9a747e4fSDavid du Colombier  *
26*9a747e4fSDavid du Colombier  * Sponsored by The USENIX Association for public distribution.
27*9a747e4fSDavid du Colombier  *
28*9a747e4fSDavid du Colombier  * Copyright (c) 1989 Mark H. Colburn.
29*9a747e4fSDavid du Colombier  * All rights reserved.
30*9a747e4fSDavid du Colombier  *
31*9a747e4fSDavid du Colombier  * Redistribution and use in source and binary forms are permitted
32*9a747e4fSDavid du Colombier  * provided that the above copyright notice and this paragraph are
33*9a747e4fSDavid du Colombier  * duplicated in all such forms and that any documentation,
34*9a747e4fSDavid du Colombier  * advertising materials, and other materials related to such
35*9a747e4fSDavid du Colombier  * distribution and use acknowledge that the software was developed
36*9a747e4fSDavid du Colombier  * by Mark H. Colburn and sponsored by The USENIX Association.
37*9a747e4fSDavid du Colombier  *
38*9a747e4fSDavid du Colombier  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
39*9a747e4fSDavid du Colombier  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
40*9a747e4fSDavid du Colombier  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
41*9a747e4fSDavid du Colombier  */
42*9a747e4fSDavid du Colombier 
43*9a747e4fSDavid du Colombier #ifndef _PAX_LIMITS_H
44*9a747e4fSDavid du Colombier #define _PAX_LIMITS_H
45*9a747e4fSDavid du Colombier 
46*9a747e4fSDavid du Colombier /* Headers */
47*9a747e4fSDavid du Colombier 
48*9a747e4fSDavid du Colombier #if defined(__STDC__) || defined(_POSIX_SOURCE)
49*9a747e4fSDavid du Colombier #   include <limits.h>
50*9a747e4fSDavid du Colombier #endif
51*9a747e4fSDavid du Colombier 
52*9a747e4fSDavid du Colombier 
53*9a747e4fSDavid du Colombier /* Defines */
54*9a747e4fSDavid du Colombier 
55*9a747e4fSDavid du Colombier #ifndef _POSIX_SOURCE
56*9a747e4fSDavid du Colombier 
57*9a747e4fSDavid du Colombier #define MAX_INPUT	256	/* Max numbef of bytes in terminal input */
58*9a747e4fSDavid du Colombier #define NGROUPS_MAX	1	/* Max number of suplemental group id's */
59*9a747e4fSDavid du Colombier #define PASS_MAX	8	/* Max number of bytes in a password */
60*9a747e4fSDavid du Colombier #define PID_MAX		30000	/* Max value for a process ID */
61*9a747e4fSDavid du Colombier #define UID_MAX		32000	/* Max value for a user or group ID */
62*9a747e4fSDavid du Colombier #define ARG_MAX		4096	/* Nax number of bytes passed to exec */
63*9a747e4fSDavid du Colombier #define CHILD_MAX	6	/* Max number of simultaneous processes */
64*9a747e4fSDavid du Colombier #define MAX_CANON	256	/* Max numbef of bytes in a cononical queue */
65*9a747e4fSDavid du Colombier #define OPEN_MAX	16	/* Nax number of open files per process */
66*9a747e4fSDavid du Colombier #define NAME_MAX	14	/* Max number of bytes in a file name */
67*9a747e4fSDavid du Colombier #define PATH_MAX	255	/* Max number of bytes in pathname */
68*9a747e4fSDavid du Colombier #define LINK_MAX	8	/* Max value of a file's link count */
69*9a747e4fSDavid du Colombier #define PIPE_BUF	512	/* Max number of bytes for pipe reads */
70*9a747e4fSDavid du Colombier 
71*9a747e4fSDavid du Colombier #endif /* _POSIX_SOURCE */
72*9a747e4fSDavid du Colombier #endif /* _PAX_LIMITS_H */
73