Wed Aug 9 14:25:35 1995 Miles Bader <miles@geech.gnu.ai.mit.edu>
[glibc.git] / sysdeps / posix / mk-stdiolim.c
blobda78a98394bea8a437302bc3b54b836f93c2aada
1 /* Copyright (C) 1991, 1992, 1993 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. */
19 #include <posix1_lim.h>
21 int
22 main()
24 /* These values correspond to the code in sysdeps/posix/tempname.c.
25 Change the values here if you change that code. */
26 printf("#define L_tmpnam %u\n", sizeof("/usr/tmp/") + 8);
27 printf("#define TMP_MAX %u\n", 62 * 62 * 62);
29 puts ("#ifdef __USE_POSIX");
30 printf("#define L_ctermid %u\n", sizeof("/dev/tty"));
31 printf("#define L_cuserid 9\n");
32 puts ("#endif");
34 /* POSIX does not require that OPEN_MAX and PATH_MAX be defined, so
35 <local_lim.h> will not define them if they are run-time variant (which
36 is the case in the Hurd). ANSI still requires that FOPEN_MAX and
37 FILENAME_MAX be defined, however. */
39 printf("#define FOPEN_MAX %u\n",
40 #ifdef OPEN_MAX
42 OPEN_MAX
43 #else
44 /* This is the minimum number of files that the implementation
45 guarantees can be open simultaneously. OPEN_MAX not being
46 defined means the maximum is run-time variant; but POSIX.1
47 requires that it never be less than _POSIX_OPEN_MAX, so that is
48 a good minimum to use. */
49 _POSIX_OPEN_MAX
50 #endif
54 printf("#define FILENAME_MAX %u\n",
55 #ifdef PATH_MAX
56 PATH_MAX
57 #else
58 /* This is supposed to be the size needed to hold the longest file
59 name string the implementation guarantees can be opened.
60 PATH_MAX not being defined means the actual limit on the length
61 of a file name is runtime-variant (or it is unlimited). ANSI
62 says in such a case FILENAME_MAX should be a good size to
63 allocate for a file name string. POSIX.1 guarantees that a
64 file name up to _POSIX_PATH_MAX chars long can be opened, so
65 this value must be at least that. */
66 1024 /* _POSIX_PATH_MAX is 255. */
67 #endif
70 exit(0);