<sys/syslimits.h>

reduces differences, raise NAME_MAX

Change-Id: I2e5f6296e6539162c52fdf13fb1fd27a56587e0c
This commit is contained in:
Ben Gras 2013-12-12 14:27:56 +01:00 committed by Lionel Sambuc
parent bd27a0696b
commit ad9df9a490
18 changed files with 34 additions and 16 deletions

View file

@ -35,6 +35,7 @@
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/syslimits.h>
#include <errno.h> #include <errno.h>
#include <fcntl.h> #include <fcntl.h>
#include <utime.h> #include <utime.h>

View file

@ -15,6 +15,7 @@
#include <fcntl.h> #include <fcntl.h>
#include <time.h> #include <time.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/syslimits.h>
#include <utime.h> #include <utime.h>
#include <dirent.h> #include <dirent.h>
#include <errno.h> #include <errno.h>

View file

@ -29,7 +29,7 @@ extern int optind;
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#define NAMELEN (NAME_MAX+5) #define NAMELEN 500
#define ISONAMELEN 12 /* XXX could easily be 31 */ #define ISONAMELEN 12 /* XXX could easily be 31 */
#define PLATFORM_80X86 0 #define PLATFORM_80X86 0

View file

@ -7,7 +7,7 @@
int closefrom(int fd) int closefrom(int fd)
{ {
int f, ok = 0, e = 0; int f, ok = 0, e = 0;
for(f = fd; f < __MINIX_OPEN_MAX; f++) { for(f = fd; f < OPEN_MAX; f++) {
if(close(f) >= 0) if(close(f) >= 0)
ok = 1; ok = 1;
else else

View file

@ -58,7 +58,7 @@ typedef __uint32_t __fd_mask;
#ifndef FD_SETSIZE #ifndef FD_SETSIZE
#ifdef __minix #ifdef __minix
#include <sys/syslimits.h> #include <sys/syslimits.h>
#define FD_SETSIZE __MINIX_OPEN_MAX #define FD_SETSIZE OPEN_MAX
#else #else
#define FD_SETSIZE 256 #define FD_SETSIZE 256
#endif #endif

View file

@ -34,16 +34,15 @@
#ifndef _SYS_SYSLIMITS_H_ #ifndef _SYS_SYSLIMITS_H_
#define _SYS_SYSLIMITS_H_ #define _SYS_SYSLIMITS_H_
#if defined(__minix) #if defined(_STANDALONE) && defined(__minix)
#define __MINIX_OPEN_MAX 255 /* a process may have 255 files open */
#define __MINIX_PATH_MAX 1024/* a pathname may contain 1023 chars (+ '\0')*/
#if defined(_STANDALONE)
/* LSC: In NetBSD this gets pulled in through libkern.h */ /* LSC: In NetBSD this gets pulled in through libkern.h */
#include <sys/null.h> #include <sys/null.h>
uint32_t crc32(uint32_t, const uint8_t *, size_t); uint32_t crc32(uint32_t, const uint8_t *, size_t);
#endif /* defined(_STANDALONE) */ #endif /* defined(_STANDALONE) */
#endif /* defined(__minix) */
#ifdef __minix
#define OPEN_MAX 255
#endif
#include <sys/featuretest.h> #include <sys/featuretest.h>
@ -53,19 +52,24 @@ uint32_t crc32(uint32_t, const uint8_t *, size_t);
#ifndef CHILD_MAX #ifndef CHILD_MAX
#define CHILD_MAX 160 /* max simultaneous processes */ #define CHILD_MAX 160 /* max simultaneous processes */
#endif #endif
#define GID_MAX USHRT_MAX /* max value for a gid_t (2^31-2) */ #define GID_MAX 2147483647U /* max value for a gid_t (2^31-2) */
#define LINK_MAX 32767 /* max file link count */ #define LINK_MAX 32767 /* max file link count */
#define MAX_CANON 255 /* max bytes in term canon input line */ #define MAX_CANON 255 /* max bytes in term canon input line */
#define MAX_INPUT 255 /* max bytes in terminal input */ #define MAX_INPUT 255 /* max bytes in terminal input */
#define NAME_MAX 255 /* max bytes in a file name, must be */ #define NAME_MAX 511 /* max bytes in a file name, must be */
/* kept in sync with MAXPATHLEN */ /* kept in sync with MAXPATHLEN */
#define NGROUPS_MAX 8 /* max supplemental group id's */ #define NGROUPS_MAX 16 /* max supplemental group id's */
#define UID_MAX USHRT_MAX /* max value for a uid_t */ #define UID_MAX 2147483647U /* max value for a uid_t (2^31-2) */
#ifndef OPEN_MAX #ifndef OPEN_MAX
#define OPEN_MAX __MINIX_OPEN_MAX /* max open files per process */ #define OPEN_MAX 128 /* max open files per process */
#endif
#define PATH_MAX 1024 /* max bytes in pathname */
#ifdef __minix
#define PIPE_BUF 32768 /* max bytes for atomic pipe wri
#else
#define PIPE_BUF 512 /* max bytes for atomic pipe writes */
#endif #endif
#define PATH_MAX __MINIX_PATH_MAX /* max bytes in pathname */
#define PIPE_BUF 32768 /* max bytes for atomic pipe writes */
#define BC_BASE_MAX INT_MAX /* max ibase/obase values in bc(1) */ #define BC_BASE_MAX INT_MAX /* max ibase/obase values in bc(1) */
#define BC_DIM_MAX 65535 /* max array elements in bc(1) */ #define BC_DIM_MAX 65535 /* max array elements in bc(1) */

View file

@ -9,6 +9,7 @@
#include <unistd.h> #include <unistd.h>
#include <stdio.h> #include <stdio.h>
#include <sys/statvfs.h> #include <sys/statvfs.h>
#include <sys/syslimits.h>
#include "common.h" #include "common.h"

View file

@ -17,6 +17,7 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <fcntl.h> #include <fcntl.h>
#include <sys/select.h> #include <sys/select.h>
#include <sys/syslimits.h>
#include <errno.h> #include <errno.h>
#include <sys/wait.h> #include <sys/wait.h>
#include <string.h> #include <string.h>

View file

@ -6,6 +6,7 @@
#include <sys/types.h> #include <sys/types.h>
#include <sys/wait.h> #include <sys/wait.h>
#include <sys/syslimits.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>

View file

@ -10,6 +10,7 @@
#include <sys/types.h> #include <sys/types.h>
#include <sys/time.h> #include <sys/time.h>
#include <sys/wait.h> #include <sys/wait.h>
#include <sys/syslimits.h>
#include <signal.h> #include <signal.h>
#include <unistd.h> #include <unistd.h>
#include <errno.h> #include <errno.h>

View file

@ -9,6 +9,7 @@
#include <sys/wait.h> #include <sys/wait.h>
#include <sys/select.h> #include <sys/select.h>
#include <sys/ptrace.h> #include <sys/ptrace.h>
#include <sys/syslimits.h>
#define ITERATIONS 3 #define ITERATIONS 3
int max_error = 4; int max_error = 4;

View file

@ -20,6 +20,7 @@
#include <sys/types.h> #include <sys/types.h>
#include <sys/wait.h> #include <sys/wait.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/syslimits.h>
int subtest = -1; int subtest = -1;
int max_error = 999; /* Effectively no limit. This is necessary as this int max_error = 999; /* Effectively no limit. This is necessary as this

View file

@ -1,6 +1,7 @@
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/wait.h> #include <sys/wait.h>
#include <sys/syslimits.h>
#include <fcntl.h> #include <fcntl.h>
#include <stdio.h> #include <stdio.h>
#include <unistd.h> #include <unistd.h>

View file

@ -3,6 +3,7 @@
#include <sys/socket.h> #include <sys/socket.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/wait.h> #include <sys/wait.h>
#include <sys/syslimits.h>
#include <errno.h> #include <errno.h>
#include <fcntl.h> #include <fcntl.h>
#include <netdb.h> #include <netdb.h>

View file

@ -1,5 +1,6 @@
#include <sys/types.h> #include <sys/types.h>
#include <sys/wait.h> #include <sys/wait.h>
#include <sys/syslimits.h>
#include <errno.h> #include <errno.h>
#include <fcntl.h> #include <fcntl.h>
#include <signal.h> #include <signal.h>

View file

@ -5,6 +5,7 @@
#include <sys/wait.h> #include <sys/wait.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <sys/utsname.h> #include <sys/utsname.h>
#include <sys/syslimits.h>
#include <netinet/in.h> #include <netinet/in.h>
#include <signal.h> #include <signal.h>
#include <unistd.h> #include <unistd.h>

View file

@ -6,6 +6,7 @@
#include <signal.h> #include <signal.h>
#include <termios.h> #include <termios.h>
#include <sys/wait.h> #include <sys/wait.h>
#include <sys/syslimits.h>
#include <paths.h> #include <paths.h>
#include <fcntl.h> #include <fcntl.h>
#include <util.h> #include <util.h>

View file

@ -4,6 +4,7 @@
#include <errno.h> #include <errno.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/bootblock.h> #include <sys/bootblock.h>
#include <sys/syslimits.h>
#include <fcntl.h> #include <fcntl.h>
#include <unistd.h> #include <unistd.h>
#include <string.h> #include <string.h>