diff options
Diffstat (limited to 'Src/Builtins')
-rw-r--r-- | Src/Builtins/rlimits.c | 25 | ||||
-rw-r--r-- | Src/Builtins/sched.c | 2 |
2 files changed, 22 insertions, 5 deletions
diff --git a/Src/Builtins/rlimits.c b/Src/Builtins/rlimits.c index fd4c94aaa..9da31831d 100644 --- a/Src/Builtins/rlimits.c +++ b/Src/Builtins/rlimits.c @@ -32,12 +32,17 @@ #if defined(HAVE_GETRLIMIT) && defined(RLIM_INFINITY) -#ifdef RLIMIT_POSIXLOCKS +#if defined(HAVE_RLIMIT_POSIXLOCKS) && !defined(HAVE_RLIMIT_LOCKS) # define RLIMIT_LOCKS RLIMIT_POSIXLOCKS +# define HAVE_RLIMIT_LOCKS 1 #endif -#ifdef RLIMIT_NTHR +#if defined(HAVE_RLIMIT_NTHR) && !defined(HAVE_RLIMIT_PTHREAD) # define RLIMIT_PTHREAD RLIMIT_NTHR +# define HAVE_RLIMIT_PTHREAD 1 +# define THREAD_FMT "-T: threads " +#else +# define THREAD_FMT "-T: threads per process " #endif enum { @@ -367,13 +372,13 @@ printulimit(char *nam, int lim, int hard, int head) # ifdef HAVE_RLIMIT_SBSIZE case RLIMIT_SBSIZE: if (head) - printf("-b: socket buffer size (bytes) ", RLIMIT_SBSIZE); + printf("-b: socket buffer size (bytes) "); break; # endif /* HAVE_RLIMIT_SBSIZE */ # ifdef HAVE_RLIMIT_PTHREAD case RLIMIT_PTHREAD: if (head) - printf("-T: threads per process "); + printf("%s", THREAD_FMT); break; # endif /* HAVE_RLIMIT_PTHREAD */ # ifdef HAVE_RLIMIT_NICE @@ -860,6 +865,13 @@ bin_ulimit(char *name, char **argv, UNUSED(Options ops), UNUSED(int func)) case 'r': res = RLIMIT_RTPRIO; break; +# else +# ifdef HAVE_RLIMIT_NTHR + /* For compatibility with sh on NetBSD */ + case 'r': + res = RLIMIT_NTHR; + break; +# endif /* HAVE_RLIMIT_NTHR */ # endif # ifdef HAVE_RLIMIT_NPTS case 'p': @@ -876,6 +888,11 @@ bin_ulimit(char *name, char **argv, UNUSED(Options ops), UNUSED(int func)) res = RLIMIT_KQUEUES; break; # endif +# ifdef HAVE_RLIMIT_PTHREAD + case 'T': + res = RLIMIT_PTHREAD; + break; +# endif default: /* unrecognised limit */ zwarnnam(name, "bad option: -%c", *options); diff --git a/Src/Builtins/sched.c b/Src/Builtins/sched.c index 1ec3269bd..c1cc98354 100644 --- a/Src/Builtins/sched.c +++ b/Src/Builtins/sched.c @@ -211,7 +211,7 @@ bin_sched(char *nam, char **argv, UNUSED(Options ops), UNUSED(int func)) t = sch->time; tmp = localtime(&t); - ztrftime(tbuf, 40, "%a %b %e %k:%M:%S", tmp); + ztrftime(tbuf, 40, "%a %b %e %k:%M:%S", tmp, 0L); if (sch->flags & SCHEDFLAG_TRASH_ZLE) flagstr = "-o "; else |