diff options
author | Jeff Johnston <jjohnstn@redhat.com> | 2001-01-31 20:11:48 +0000 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2001-01-31 20:11:48 +0000 |
commit | e29d83550eb33be51fd9a92d6443633c812504f7 (patch) | |
tree | 6d203309f3a3893b84ce58081d83b229506f804e /newlib/libc/include | |
parent | f8da1507583d5064ee73b6bd5786a027da7ed6c0 (diff) | |
download | newlib-e29d83550eb33be51fd9a92d6443633c812504f7.zip newlib-e29d83550eb33be51fd9a92d6443633c812504f7.tar.gz newlib-e29d83550eb33be51fd9a92d6443633c812504f7.tar.bz2 |
2001-01-31 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/stdio.h (FILENAME_MAX): Changed to use __FILENAME_MAX__
if defined.
(FOPEN_MAX): Changed to use __FOPEN_MAX__ if defined.
(L_tmpnam): Changed to use __L_tmpnam__ if defined.
* libc/include/sys/config.h: Changed to set __FILENAME_MAX__
appropriately for Cygwin and RTEMS so not to exceed PATH_MAX.
Diffstat (limited to 'newlib/libc/include')
-rw-r--r-- | newlib/libc/include/stdio.h | 21 | ||||
-rw-r--r-- | newlib/libc/include/sys/config.h | 5 |
2 files changed, 23 insertions, 3 deletions
diff --git a/newlib/libc/include/stdio.h b/newlib/libc/include/stdio.h index 5d794bd..9c1a06f 100644 --- a/newlib/libc/include/stdio.h +++ b/newlib/libc/include/stdio.h @@ -90,9 +90,24 @@ typedef struct __sFILE FILE; #define BUFSIZ 1024 #define EOF (-1) -#define FOPEN_MAX 20 /* must be <= OPEN_MAX <sys/syslimits.h> */ -#define FILENAME_MAX 1024 /* must be <= PATH_MAX <sys/syslimits.h> */ -#define L_tmpnam 1024 /* XXX must be == PATH_MAX */ +#ifdef __FOPEN_MAX__ +#define FOPEN_MAX __FOPEN_MAX__ +#else +#define FOPEN_MAX 20 +#endif + +#ifdef __FILENAME_MAX__ +#define FILENAME_MAX __FILENAME_MAX__ +#else +#define FILENAME_MAX 1024 +#endif + +#ifdef __L_tmpnam__ +#define L_tmpnam __L_tmpnam__ +#else +#define L_tmpnam FILENAME_MAX +#endif + #ifndef __STRICT_ANSI__ #define P_tmpdir "/tmp" #endif diff --git a/newlib/libc/include/sys/config.h b/newlib/libc/include/sys/config.h index f8bd8cd..0cf4b1e 100644 --- a/newlib/libc/include/sys/config.h +++ b/newlib/libc/include/sys/config.h @@ -127,6 +127,7 @@ typedef unsigned int __uint32_t; #if defined(__CYGWIN32__) || defined(__CYGWIN__) +#define __FILENAME_MAX__ (260 - 1 /* NUL */) #if defined(__INSIDE_CYGWIN__) || defined(_COMPILING_NEWLIB) #define __IMPORT #else @@ -134,6 +135,10 @@ typedef unsigned int __uint32_t; #endif #endif +#if defined(__rtems__) +#define __FILENAME_MAX__ 255 +#endif + #ifndef __IMPORT #define __IMPORT #endif |