1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

Add three options to 'ulimit' (#406)

This patch adds a few extra options to the ulimit command (if the OS
supports them). These options are also present in Bash, although in ksh
additional long forms of each option are available:
  ulimit -k/--kqueues   This is the maximum number of kqueues.
  ulimit -P/--npts      This is the maximum number of pseudo-terminals.
  ulimit -R/--rttime    This is the time a real-time process can run
                        before blocking, in microseconds. When the
                        limit is exceeded, the process is sent SIGXCPU.

Other changes:
- bltins/ulimit.c: Change the formatting from sfprintf and increase the
  size of the tmp buffer to prevent text from being cut off in ulimit
  -a (this was required to add ulimit -R).
- data/limits.c: Add support for using microseconds as a unit.
This commit is contained in:
Johnothan King 2021-12-28 13:55:56 -08:00 committed by Martijn Dekker
parent 8f24d4dc56
commit 8f9d1bec97
8 changed files with 53 additions and 8 deletions

View file

@ -103,6 +103,9 @@
#ifndef RLIMIT_FSIZE
#define RLIMIT_FSIZE RLIMIT_UNKNOWN
#endif
#ifndef RLIMIT_KQUEUES
#define RLIMIT_KQUEUES RLIMIT_UNKNOWN
#endif
#ifndef RLIMIT_LOCKS
#define RLIMIT_LOCKS RLIMIT_UNKNOWN
#endif
@ -121,6 +124,9 @@
#ifndef RLIMIT_NPROC
#define RLIMIT_NPROC RLIMIT_UNKNOWN
#endif
#ifndef RLIMIT_NPTS
#define RLIMIT_NPTS RLIMIT_UNKNOWN
#endif
#ifndef RLIMIT_PIPE
#define RLIMIT_PIPE RLIMIT_UNKNOWN
#endif
@ -133,6 +139,9 @@
#ifndef RLIMIT_RTPRIO
#define RLIMIT_RTPRIO RLIMIT_UNKNOWN
#endif
#ifndef RLIMIT_RTTIME
#define RLIMIT_RTTIME RLIMIT_UNKNOWN
#endif
#ifndef RLIMIT_SBSIZE
#define RLIMIT_SBSIZE RLIMIT_UNKNOWN
#endif
@ -154,6 +163,7 @@
#define LIM_BYTE 2
#define LIM_KBYTE 3
#define LIM_SECOND 4
#define LIM_MICROSECOND 5
typedef struct Limit_s
{