1 /* Copyright (C) 1993, 1996 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 License, or (at your option) any later version.
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public
15 License along with the GNU C Library; see the file COPYING.LIB. If
16 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
17 Cambridge, MA 02139, USA. */
20 #include <sys/types.h>
22 #ifdef HAVE_SYS_PARAM_H
23 #include <sys/param.h>
30 #ifdef HAVE_SYS_LIMITS_H
31 #include <sys/limits.h>
34 /* Generate local_lim.h from the values defined in the system's headers. */
42 static struct param params
[] =
45 #if !defined (ARG_MAX) && defined (NCARGS)
46 #define ARG_MAX NCARGS
49 { "ARG_MAX", ARG_MAX
},
52 #if !defined (CHILD_MAX) && defined (MAXUPRC)
53 #define CHILD_MAX MAXUPRC
56 { "CHILD_MAX", CHILD_MAX
},
59 #if !defined (LINK_MAX) && defined (MAXLINK)
60 #define LINK_MAX MAXLINK
63 { "LINK_MAX", LINK_MAX
},
66 #if !defined (OPEN_MAX) && defined (NOFILE)
67 #define OPEN_MAX NOFILE
70 { "OPEN_MAX", OPEN_MAX
},
73 #if !defined (MAX_CANON) && defined (CANBSIZ)
74 #define MAX_CANON CANBSIZ
77 { "MAX_CANON", MAX_CANON
},
80 #if !defined (NAME_MAX) && defined (MAXNAMLEN)
81 #define NAME_MAX MAXNAMLEN
84 #define NAME_MAX 255 /* XXX ? */
86 { "NAME_MAX", NAME_MAX
},
88 #if !defined (PATH_MAX) && defined (MAXPATHLEN)
89 #define PATH_MAX MAXPATHLEN
92 { "PATH_MAX", PATH_MAX
},
95 #if !defined (SYMLOOP_MAX) && defined (MAXSYMLINKS)
96 #define SYMLOOP_MAX MAXSYMLINKS
99 { "SYMLOOP_MAX", SYMLOOP_MAX
},
108 extern char *ctime ();
109 extern time_t time ();
110 time_t now
= time ((time_t *) NULL
);
111 register struct param
*p
;
113 if (! params
[0].name
)
114 /* We have no information to give, so let the caller know. */
118 /* Implementation-specific limits.\n\
119 Generated at %.24s. */\n\n", ctime (&now
));
121 for (p
= params
; p
->name
!= NULL
; ++p
)
122 printf ("#define %s %d\n", p
->name
, p
->value
);