make {get,set}rlimit code depend on RLIM_INFINITY existence (PW32, Minix 3)
This commit is contained in:
		
							
								
								
									
										4
									
								
								Build.sh
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								Build.sh
									
									
									
									
									
								
							| @@ -1,5 +1,5 @@ | |||||||
| #!/bin/sh | #!/bin/sh | ||||||
| srcversion='$MirOS: src/bin/mksh/Build.sh,v 1.380 2009/04/03 09:42:37 tg Exp $' | srcversion='$MirOS: src/bin/mksh/Build.sh,v 1.381 2009/04/03 09:45:22 tg Exp $' | ||||||
| #- | #- | ||||||
| # Environment used: CC CFLAGS CPPFLAGS LDFLAGS LIBS NOWARN NROFF TARGET_OS | # Environment used: CC CFLAGS CPPFLAGS LDFLAGS LIBS NOWARN NROFF TARGET_OS | ||||||
| # CPPFLAGS recognised:	MKSH_SMALL MKSH_ASSUME_UTF8 MKSH_NOPWNAM MKSH_NOVI | # CPPFLAGS recognised:	MKSH_SMALL MKSH_ASSUME_UTF8 MKSH_NOPWNAM MKSH_NOVI | ||||||
| @@ -351,7 +351,7 @@ Plan9) | |||||||
| PW32*) | PW32*) | ||||||
| 	HAVE_SIG_T=0	# incompatible | 	HAVE_SIG_T=0	# incompatible | ||||||
| 	warn=' and will currently not work' | 	warn=' and will currently not work' | ||||||
| 	# missing: killpg() getrlimit() | 	# missing: killpg() | ||||||
| 	: ${HAVE_SETLOCALE_CTYPE=0} | 	: ${HAVE_SETLOCALE_CTYPE=0} | ||||||
| 	;; | 	;; | ||||||
| QNX) | QNX) | ||||||
|   | |||||||
							
								
								
									
										8
									
								
								funcs.c
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								funcs.c
									
									
									
									
									
								
							| @@ -5,7 +5,7 @@ | |||||||
|  |  | ||||||
| #include "sh.h" | #include "sh.h" | ||||||
|  |  | ||||||
| __RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.101 2009/04/03 09:39:05 tg Exp $"); | __RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.102 2009/04/03 09:45:23 tg Exp $"); | ||||||
|  |  | ||||||
| /* A leading = means assignments before command are kept; | /* A leading = means assignments before command are kept; | ||||||
|  * a leading * means a POSIX special builtin; |  * a leading * means a POSIX special builtin; | ||||||
| @@ -2847,6 +2847,7 @@ ptest_error(Test_env *te, int ofs, const char *msg) | |||||||
| 		bi_errorf("%s", msg); | 		bi_errorf("%s", msg); | ||||||
| } | } | ||||||
|  |  | ||||||
|  | #ifdef RLIM_INFINITY | ||||||
| #define SOFT	0x1 | #define SOFT	0x1 | ||||||
| #define HARD	0x2 | #define HARD	0x2 | ||||||
|  |  | ||||||
| @@ -2859,10 +2860,12 @@ struct limits { | |||||||
|  |  | ||||||
| static void print_ulimit(const struct limits *, int); | static void print_ulimit(const struct limits *, int); | ||||||
| static int set_ulimit(const struct limits *, const char *, int); | static int set_ulimit(const struct limits *, const char *, int); | ||||||
|  | #endif | ||||||
|  |  | ||||||
| int | int | ||||||
| c_ulimit(const char **wp) | c_ulimit(const char **wp) | ||||||
| { | { | ||||||
|  | #ifdef RLIM_INFINITY | ||||||
| 	static const struct limits limits[] = { | 	static const struct limits limits[] = { | ||||||
| 		/* do not use options -H, -S or -a or change the order */ | 		/* do not use options -H, -S or -a or change the order */ | ||||||
| #ifdef RLIMIT_CPU | #ifdef RLIMIT_CPU | ||||||
| @@ -2959,9 +2962,11 @@ c_ulimit(const char **wp) | |||||||
| 		shprintf("%-20s ", l->name); | 		shprintf("%-20s ", l->name); | ||||||
| 		print_ulimit(l, how); | 		print_ulimit(l, how); | ||||||
| 	} | 	} | ||||||
|  | #endif | ||||||
| 	return (0); | 	return (0); | ||||||
| } | } | ||||||
|  |  | ||||||
|  | #ifdef RLIM_INFINITY | ||||||
| static int | static int | ||||||
| set_ulimit(const struct limits *l, const char *v, int how) | set_ulimit(const struct limits *l, const char *v, int how) | ||||||
| { | { | ||||||
| @@ -3025,6 +3030,7 @@ print_ulimit(const struct limits *l, int how) | |||||||
| 	else | 	else | ||||||
| 		shprintf("%ld\n", (long)(val / l->factor)); | 		shprintf("%ld\n", (long)(val / l->factor)); | ||||||
| } | } | ||||||
|  | #endif | ||||||
|  |  | ||||||
| int | int | ||||||
| c_rename(const char **wp) | c_rename(const char **wp) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user