make {get,set}rlimit code depend on RLIM_INFINITY existence (PW32, Minix 3)

This commit is contained in:
tg 2009-04-03 09:45:23 +00:00
parent cf6109d912
commit 9aff4d78fe
2 changed files with 9 additions and 3 deletions

View File

@ -1,5 +1,5 @@
#!/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
# CPPFLAGS recognised: MKSH_SMALL MKSH_ASSUME_UTF8 MKSH_NOPWNAM MKSH_NOVI
@ -351,7 +351,7 @@ Plan9)
PW32*)
HAVE_SIG_T=0 # incompatible
warn=' and will currently not work'
# missing: killpg() getrlimit()
# missing: killpg()
: ${HAVE_SETLOCALE_CTYPE=0}
;;
QNX)

View File

@ -5,7 +5,7 @@
#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 a POSIX special builtin;
@ -2847,6 +2847,7 @@ ptest_error(Test_env *te, int ofs, const char *msg)
bi_errorf("%s", msg);
}
#ifdef RLIM_INFINITY
#define SOFT 0x1
#define HARD 0x2
@ -2859,10 +2860,12 @@ struct limits {
static void print_ulimit(const struct limits *, int);
static int set_ulimit(const struct limits *, const char *, int);
#endif
int
c_ulimit(const char **wp)
{
#ifdef RLIM_INFINITY
static const struct limits limits[] = {
/* do not use options -H, -S or -a or change the order */
#ifdef RLIMIT_CPU
@ -2959,9 +2962,11 @@ c_ulimit(const char **wp)
shprintf("%-20s ", l->name);
print_ulimit(l, how);
}
#endif
return (0);
}
#ifdef RLIM_INFINITY
static int
set_ulimit(const struct limits *l, const char *v, int how)
{
@ -3025,6 +3030,7 @@ print_ulimit(const struct limits *l, int how)
else
shprintf("%ld\n", (long)(val / l->factor));
}
#endif
int
c_rename(const char **wp)