OSDN Git Service

LDP: Update original to LDP v3.68
[linuxjm/LDP_man-pages.git] / original / man2 / getrlimit.2
1 .\" Copyright (c) 1992 Drew Eckhardt, March 28, 1992
2 .\" and Copyright (c) 2002, 2004, 2005, 2008, 2010 Michael Kerrisk
3 .\"
4 .\" %%%LICENSE_START(VERBATIM)
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
8 .\"
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
13 .\"
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein.  The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
20 .\" professionally.
21 .\"
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
24 .\" %%%LICENSE_END
25 .\"
26 .\" Modified by Michael Haardt <michael@moria.de>
27 .\" Modified 1993-07-23 by Rik Faith <faith@cs.unc.edu>
28 .\" Modified 1996-01-13 by Arnt Gulbrandsen <agulbra@troll.no>
29 .\" Modified 1996-01-22 by aeb, following a remark by
30 .\"          Tigran Aivazian <tigran@sco.com>
31 .\" Modified 1996-04-14 by aeb, following a remark by
32 .\"          Robert Bihlmeyer <robbe@orcus.ping.at>
33 .\" Modified 1996-10-22 by Eric S. Raymond <esr@thyrsus.com>
34 .\" Modified 2001-05-04 by aeb, following a remark by
35 .\"          HÃ¥vard Lygre <hklygre@online.no>
36 .\" Modified 2001-04-17 by Michael Kerrisk <mtk.manpages@gmail.com>
37 .\" Modified 2002-06-13 by Michael Kerrisk <mtk.manpages@gmail.com>
38 .\"     Added note on nonstandard behavior when SIGCHLD is ignored.
39 .\" Modified 2002-07-09 by Michael Kerrisk <mtk.manpages@gmail.com>
40 .\"     Enhanced descriptions of 'resource' values
41 .\" Modified 2003-11-28 by aeb, added RLIMIT_CORE
42 .\" Modified 2004-03-26 by aeb, added RLIMIT_AS
43 .\" Modified 2004-06-16 by Michael Kerrisk <mtk.manpages@gmail.com>
44 .\"     Added notes on CAP_SYS_RESOURCE
45 .\"
46 .\" 2004-11-16 -- mtk: the getrlimit.2 page, which formally included
47 .\" coverage of getrusage(2), has been split, so that the latter
48 .\" is now covered in its own getrusage.2.
49 .\"
50 .\" Modified 2004-11-16, mtk: A few other minor changes
51 .\" Modified 2004-11-23, mtk
52 .\"     Added notes on RLIMIT_MEMLOCK, RLIMIT_NPROC, and RLIMIT_RSS
53 .\"             to "CONFORMING TO"
54 .\" Modified 2004-11-25, mtk
55 .\"     Rewrote discussion on RLIMIT_MEMLOCK to incorporate kernel
56 .\"             2.6.9 changes.
57 .\"     Added note on RLIMIT_CPU error in older kernels
58 .\" 2004-11-03, mtk, Added RLIMIT_SIGPENDING
59 .\" 2005-07-13, mtk, documented RLIMIT_MSGQUEUE limit.
60 .\" 2005-07-28, mtk, Added descriptions of RLIMIT_NICE and RLIMIT_RTPRIO
61 .\" 2008-05-07, mtk / Peter Zijlstra, Added description of RLIMIT_RTTIME
62 .\" 2010-11-06, mtk: Added documentation of prlimit()
63 .\"
64 .TH GETRLIMIT 2 2014-05-28 "Linux" "Linux Programmer's Manual"
65 .SH NAME
66 getrlimit, setrlimit, prlimit \- get/set resource limits
67 .SH SYNOPSIS
68 .B #include <sys/time.h>
69 .br
70 .B #include <sys/resource.h>
71 .sp
72 .BI "int getrlimit(int " resource ", struct rlimit *" rlim );
73 .br
74 .BI "int setrlimit(int " resource ", const struct rlimit *" rlim );
75 .sp
76 .BI "int prlimit(pid_t "  pid ", int " resource \
77 ", const struct rlimit *" new_limit ,
78 .br
79 .BI "            struct rlimit *" old_limit );
80 .sp
81 .in -4n
82 Feature Test Macro Requirements for glibc (see
83 .BR feature_test_macros (7)):
84 .in
85 .sp
86 .BR prlimit ():
87 _GNU_SOURCE && _FILE_OFFSET_BITS == 64
88 .SH DESCRIPTION
89 The
90 .BR getrlimit ()
91 and
92 .BR setrlimit ()
93 system calls get and set resource limits respectively.
94 Each resource has an associated soft and hard limit, as defined by the
95 .I rlimit
96 structure:
97 .PP
98 .in +4n
99 .nf
100 struct rlimit {
101     rlim_t rlim_cur;  /* Soft limit */
102     rlim_t rlim_max;  /* Hard limit (ceiling for rlim_cur) */
103 };
104
105 .fi
106 .in
107 The soft limit is the value that the kernel enforces for the
108 corresponding resource.
109 The hard limit acts as a ceiling for the soft limit:
110 an unprivileged process may set only its soft limit to a value in the
111 range from 0 up to the hard limit, and (irreversibly) lower its hard limit.
112 A privileged process (under Linux: one with the
113 .B CAP_SYS_RESOURCE
114 capability) may make arbitrary changes to either limit value.
115 .PP
116 The value
117 .B RLIM_INFINITY
118 denotes no limit on a resource (both in the structure returned by
119 .BR getrlimit ()
120 and in the structure passed to
121 .BR setrlimit ()).
122 .PP
123 The
124 .I resource
125 argument must be one of:
126 .TP
127 .B RLIMIT_AS
128 The maximum size of the process's virtual memory (address space) in bytes.
129 .\" since 2.0.27 / 2.1.12
130 This limit affects calls to
131 .BR brk (2),
132 .BR mmap (2)
133 and
134 .BR mremap (2),
135 which fail with the error
136 .B ENOMEM
137 upon exceeding this limit.
138 Also automatic stack expansion will fail
139 (and generate a
140 .B SIGSEGV
141 that kills the process if no alternate stack
142 has been made available via
143 .BR sigaltstack (2)).
144 Since the value is a \fIlong\fP, on machines with a 32-bit \fIlong\fP
145 either this limit is at most 2 GiB, or this resource is unlimited.
146 .TP
147 .B RLIMIT_CORE
148 Maximum size of
149 .I core
150 file.
151 When 0 no core dump files are created.
152 When nonzero, larger dumps are truncated to this size.
153 .TP
154 .B RLIMIT_CPU
155 CPU time limit in seconds.
156 When the process reaches the soft limit, it is sent a
157 .B SIGXCPU
158 signal.
159 The default action for this signal is to terminate the process.
160 However, the signal can be caught, and the handler can return control to
161 the main program.
162 If the process continues to consume CPU time, it will be sent
163 .B SIGXCPU
164 once per second until the hard limit is reached, at which time
165 it is sent
166 .BR SIGKILL .
167 (This latter point describes Linux behavior.
168 Implementations vary in how they treat processes which continue to
169 consume CPU time after reaching the soft limit.
170 Portable applications that need to catch this signal should
171 perform an orderly termination upon first receipt of
172 .BR SIGXCPU .)
173 .TP
174 .B RLIMIT_DATA
175 The maximum size of the process's data segment (initialized data,
176 uninitialized data, and heap).
177 This limit affects calls to
178 .BR brk (2)
179 and
180 .BR sbrk (2),
181 which fail with the error
182 .B ENOMEM
183 upon encountering the soft limit of this resource.
184 .TP
185 .B RLIMIT_FSIZE
186 The maximum size of files that the process may create.
187 Attempts to extend a file beyond this limit result in delivery of a
188 .B SIGXFSZ
189 signal.
190 By default, this signal terminates a process, but a process can
191 catch this signal instead, in which case the relevant system call (e.g.,
192 .BR write (2),
193 .BR truncate (2))
194 fails with the error
195 .BR EFBIG .
196 .TP
197 .BR RLIMIT_LOCKS " (Early Linux 2.4 only)"
198 .\" to be precise: Linux 2.4.0-test9; no longer in 2.4.25 / 2.5.65
199 A limit on the combined number of
200 .BR flock (2)
201 locks and
202 .BR fcntl (2)
203 leases that this process may establish.
204 .TP
205 .B RLIMIT_MEMLOCK
206 The maximum number of bytes of memory that may be locked
207 into RAM.
208 In effect this limit is rounded down to the nearest multiple
209 of the system page size.
210 This limit affects
211 .BR mlock (2)
212 and
213 .BR mlockall (2)
214 and the
215 .BR mmap (2)
216 .B MAP_LOCKED
217 operation.
218 Since Linux 2.6.9 it also affects the
219 .BR shmctl (2)
220 .B SHM_LOCK
221 operation, where it sets a maximum on the total bytes in
222 shared memory segments (see
223 .BR shmget (2))
224 that may be locked by the real user ID of the calling process.
225 The
226 .BR shmctl (2)
227 .B SHM_LOCK
228 locks are accounted for separately from the per-process memory
229 locks established by
230 .BR mlock (2),
231 .BR mlockall (2),
232 and
233 .BR mmap (2)
234 .BR MAP_LOCKED ;
235 a process can lock bytes up to this limit in each of these
236 two categories.
237 In Linux kernels before 2.6.9, this limit controlled the amount of
238 memory that could be locked by a privileged process.
239 Since Linux 2.6.9, no limits are placed on the amount of memory
240 that a privileged process may lock, and this limit instead governs
241 the amount of memory that an unprivileged process may lock.
242 .TP
243 .BR RLIMIT_MSGQUEUE " (since Linux 2.6.8)"
244 Specifies the limit on the number of bytes that can be allocated
245 for POSIX message queues for the real user ID of the calling process.
246 This limit is enforced for
247 .BR mq_open (3).
248 Each message queue that the user creates counts (until it is removed)
249 against this limit according to the formula:
250 .nf
251
252     bytes = attr.mq_maxmsg * sizeof(struct msg_msg *) +
253             attr.mq_maxmsg * attr.mq_msgsize
254
255 .fi
256 where
257 .I attr
258 is the
259 .I mq_attr
260 structure specified as the fourth argument to
261 .BR mq_open (3).
262
263 The first addend in the formula, which includes
264 .I "sizeof(struct msg_msg\ *)"
265 (4 bytes on Linux/i386), ensures that the user cannot
266 create an unlimited number of zero-length messages (such messages
267 nevertheless each consume some system memory for bookkeeping overhead).
268 .TP
269 .BR RLIMIT_NICE " (since Linux 2.6.12, but see BUGS below)"
270 Specifies a ceiling to which the process's nice value can be raised using
271 .BR setpriority (2)
272 or
273 .BR nice (2).
274 The actual ceiling for the nice value is calculated as
275 .IR "20\ \-\ rlim_cur" .
276 (This strangeness occurs because negative numbers cannot be specified
277 as resource limit values, since they typically have special meanings.
278 For example,
279 .B RLIM_INFINITY
280 typically is the same as \-1.)
281 .TP
282 .B RLIMIT_NOFILE
283 Specifies a value one greater than the maximum file descriptor number
284 that can be opened by this process.
285 Attempts
286 .RB ( open (2),
287 .BR pipe (2),
288 .BR dup (2),
289 etc.)
290 to exceed this limit yield the error
291 .BR EMFILE .
292 (Historically, this limit was named
293 .B RLIMIT_OFILE
294 on BSD.)
295 .TP
296 .B RLIMIT_NPROC
297 The maximum number of processes (or, more precisely on Linux, threads)
298 that can be created for the real user ID of the calling process.
299 Upon encountering this limit,
300 .BR fork (2)
301 fails with the error
302 .BR EAGAIN .
303 This limit is not enforced for processes that have either the
304 .B CAP_SYS_ADMIN
305 or the
306 .B CAP_SYS_RESOURCE
307 capability.
308 .TP
309 .B RLIMIT_RSS
310 Specifies the limit (in pages) of the process's resident set
311 (the number of virtual pages resident in RAM).
312 This limit has effect only in Linux 2.4.x, x < 30, and there
313 affects only calls to
314 .BR madvise (2)
315 specifying
316 .BR MADV_WILLNEED .
317 .\" As at kernel 2.6.12, this limit still does nothing in 2.6 though
318 .\" talk of making it do something has surfaced from time to time in LKML
319 .\"       -- MTK, Jul 05
320 .TP
321 .BR RLIMIT_RTPRIO " (since Linux 2.6.12, but see BUGS)"
322 Specifies a ceiling on the real-time priority that may be set for
323 this process using
324 .BR sched_setscheduler (2)
325 and
326 .BR sched_setparam (2).
327 .TP
328 .BR RLIMIT_RTTIME " (since Linux 2.6.25)"
329 Specifies a limit (in microseconds)
330 on the amount of CPU time that a process scheduled
331 under a real-time scheduling policy may consume without making a blocking
332 system call.
333 For the purpose of this limit,
334 each time a process makes a blocking system call,
335 the count of its consumed CPU time is reset to zero.
336 The CPU time count is not reset if the process continues trying to
337 use the CPU but is preempted, its time slice expires, or it calls
338 .BR sched_yield (2).
339
340 Upon reaching the soft limit, the process is sent a
341 .B SIGXCPU
342 signal.
343 If the process catches or ignores this signal and
344 continues consuming CPU time, then
345 .B SIGXCPU
346 will be generated once each second until the hard limit is reached,
347 at which point the process is sent a
348 .B SIGKILL
349 signal.
350
351 The intended use of this limit is to stop a runaway
352 real-time process from locking up the system.
353 .TP
354 .BR RLIMIT_SIGPENDING " (since Linux 2.6.8)"
355 Specifies the limit on the number of signals
356 that may be queued for the real user ID of the calling process.
357 Both standard and real-time signals are counted for the purpose of
358 checking this limit.
359 However, the limit is enforced only for
360 .BR sigqueue (3);
361 it is always possible to use
362 .BR kill (2)
363 to queue one instance of any of the signals that are not already
364 queued to the process.
365 .\" This replaces the /proc/sys/kernel/rtsig-max system-wide limit
366 .\" that was present in kernels <= 2.6.7.  MTK Dec 04
367 .TP
368 .B RLIMIT_STACK
369 The maximum size of the process stack, in bytes.
370 Upon reaching this limit, a
371 .B SIGSEGV
372 signal is generated.
373 To handle this signal, a process must employ an alternate signal stack
374 .RB ( sigaltstack (2)).
375
376 Since Linux 2.6.23,
377 this limit also determines the amount of space used for the process's
378 command-line arguments and environment variables; for details, see
379 .BR execve (2).
380 .SS prlimit()
381 .\" commit c022a0acad534fd5f5d5f17280f6d4d135e74e81
382 .\" Author: Jiri Slaby <jslaby@suse.cz>
383 .\" Date:   Tue May 4 18:03:50 2010 +0200
384 The Linux-specific
385 .BR prlimit ()
386 system call combines and extends the functionality of
387 .BR setrlimit ()
388 and
389 .BR getrlimit ().
390 It can be used to both set and get the resource limits of an arbitrary process.
391
392 The
393 .I resource
394 argument has the same meaning as for
395 .BR setrlimit ()
396 and
397 .BR getrlimit ().
398
399 If the
400 .IR new_limit
401 argument is a not NULL, then the
402 .I rlimit
403 structure to which it points is used to set new values for
404 the soft and hard limits for
405 .IR resource .
406 If the
407 .IR old_limit
408 argument is a not NULL, then a successful call to
409 .BR prlimit ()
410 places the previous soft and hard limits for
411 .I resource
412 in the
413 .I rlimit
414 structure pointed to by
415 .IR old_limit .
416
417 The
418 .I pid
419 argument specifies the ID of the process on which the call is to operate.
420 If
421 .I pid
422 is 0, then the call applies to the calling process.
423 To set or get the resources of a process other than itself,
424 the caller must have the
425 .B CAP_SYS_RESOURCE
426 capability, or the
427 real, effective, and saved set user IDs of the target process
428 must match the real user ID of the caller
429 .I and
430 the real, effective, and saved set group IDs of the target process
431 must match the real group ID of the caller.
432 .\" FIXME this permission check is strange
433 .\" Asked about this on LKML, 7 Nov 2010
434 .\"     "Inconsistent credential checking in prlimit() syscall"
435 .SH RETURN VALUE
436 On success, these system calls return 0.
437 On error, \-1 is returned, and
438 .I errno
439 is set appropriately.
440 .SH ERRORS
441 .TP
442 .B EFAULT
443 A pointer argument points to a location
444 outside the accessible address space.
445 .TP
446 .B EINVAL
447 The value specified in
448 .I resource
449 is not valid;
450 or, for
451 .BR setrlimit ()
452 or
453 .BR prlimit ():
454 .I rlim\->rlim_cur
455 was greater than
456 .IR rlim\->rlim_max .
457 .TP
458 .B EPERM
459 An unprivileged process tried to raise the hard limit; the
460 .B CAP_SYS_RESOURCE
461 capability is required to do this.
462 Or, the caller tried to increase the hard
463 .B RLIMIT_NOFILE
464 limit above the current kernel maximum
465 .RB ( NR_OPEN ).
466 Or, the calling process did not have permission to set limits
467 for the process specified by
468 .IR pid .
469 .TP
470 .B ESRCH
471 Could not find a process with the ID specified in
472 .IR pid .
473 .SH VERSIONS
474 The
475 .BR prlimit ()
476 system call is available since Linux 2.6.36.
477 Library support is available since glibc 2.13.
478 .SH CONFORMING TO
479 .BR getrlimit (),
480 .BR setrlimit ():
481 SVr4, 4.3BSD, POSIX.1-2001.
482 .br
483 .BR prlimit ():
484 Linux-specific.
485
486 .B RLIMIT_MEMLOCK
487 and
488 .B RLIMIT_NPROC
489 derive from BSD and are not specified in POSIX.1-2001;
490 they are present on the BSDs and Linux, but on few other implementations.
491 .B RLIMIT_RSS
492 derives from BSD and is not specified in POSIX.1-2001;
493 it is nevertheless present on most implementations.
494 .BR RLIMIT_MSGQUEUE ,
495 .BR RLIMIT_NICE ,
496 .BR RLIMIT_RTPRIO ,
497 .BR RLIMIT_RTTIME ,
498 and
499 .B RLIMIT_SIGPENDING
500 are Linux-specific.
501 .SH NOTES
502 A child process created via
503 .BR fork (2)
504 inherits its parent's resource limits.
505 Resource limits are preserved across
506 .BR execve (2).
507
508 Lowering the soft limit for a resource below the process's
509 current consumption of that resource will succeed
510 (but will prevent the process from further increasing
511 its consumption of the resource).
512
513 One can set the resource limits of the shell using the built-in
514 .IR ulimit
515 command
516 .RI ( limit
517 in
518 .BR csh (1)).
519 The shell's resource limits are inherited by the processes that
520 it creates to execute commands.
521
522 Since Linux 2.6.24, the resource limits of any process can be inspected via
523 .IR /proc/[pid]/limits ;
524 see
525 .BR proc (5).
526
527 Ancient systems provided a
528 .BR vlimit ()
529 function with a similar purpose to
530 .BR setrlimit ().
531 For backward compatibility, glibc also provides
532 .BR vlimit ().
533 All new applications should be written using
534 .BR setrlimit ().
535 .SH BUGS
536 .\" FIXME prlimit() does not suffer
537 .\" https://bugzilla.kernel.org/show_bug.cgi?id=5042
538 .\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=12201
539 .\" Since versions 2.13, glibc has library implementations of
540 .\" getrlimit() and setrlimit() that use prlimit() to work around
541 .\" this bug.
542 In older Linux kernels, the
543 .B SIGXCPU
544 and
545 .B SIGKILL
546 signals delivered when a process encountered the soft and hard
547 .B RLIMIT_CPU
548 limits were delivered one (CPU) second later than they should have been.
549 This was fixed in kernel 2.6.8.
550
551 In 2.6.x kernels before 2.6.17, a
552 .B RLIMIT_CPU
553 limit of 0 is wrongly treated as "no limit" (like
554 .BR RLIM_INFINITY ).
555 Since Linux 2.6.17, setting a limit of 0 does have an effect,
556 but is actually treated as a limit of 1 second.
557 .\" see http://marc.theaimsgroup.com/?l=linux-kernel&m=114008066530167&w=2
558
559 A kernel bug means that
560 .\" See https://lwn.net/Articles/145008/
561 .B RLIMIT_RTPRIO
562 does not work in kernel 2.6.12; the problem is fixed in kernel 2.6.13.
563
564 In kernel 2.6.12, there was an off-by-one mismatch
565 between the priority ranges returned by
566 .BR getpriority (2)
567 and
568 .BR RLIMIT_NICE .
569 This had the effect that the actual ceiling for the nice value
570 was calculated as
571 .IR "19\ \-\ rlim_cur" .
572 This was fixed in kernel 2.6.13.
573 .\" see http://marc.theaimsgroup.com/?l=linux-kernel&m=112256338703880&w=2
574
575 Since Linux 2.6.12,
576 .\" The relevant patch, sent to LKML, seems to be
577 .\" http://thread.gmane.org/gmane.linux.kernel/273462
578 .\" From: Roland McGrath <roland <at> redhat.com>
579 .\" Subject: [PATCH 7/7] make RLIMIT_CPU/SIGXCPU per-process
580 .\" Date: 2005-01-23 23:27:46 GMT
581 if a process reaches its soft
582 .BR RLIMIT_CPU
583 limit and has a handler installed for
584 .BR SIGXCPU ,
585 then, in addition to invoking the signal handler,
586 the kernel increases the soft limit by one second.
587 This behavior repeats if the process continues to consume CPU time,
588 until the hard limit is reached,
589 at which point the process is killed.
590 Other implementations
591 .\" Tested Solaris 10, FreeBSD 9, OpenBSD 5.0
592 do not change the
593 .BR RLIMIT_CPU
594 soft limit in this manner,
595 and the Linux behavior is probably not standards conformant;
596 portable applications should avoid relying on this Linux-specific behavior.
597 .\" FIXME https://bugzilla.kernel.org/show_bug.cgi?id=50951
598 The Linux-specific
599 .BR RLIMIT_RTTIME
600 limit exhibits the same behavior when the soft limit is encountered.
601
602 Kernels before 2.4.22 did not diagnose the error
603 .B EINVAL
604 for
605 .BR setrlimit ()
606 when
607 .I rlim\->rlim_cur
608 was greater than
609 .IR rlim\->rlim_max .
610 .SH EXAMPLE
611 The program below demonstrates the use of
612 .BR prlimit ().
613 .PP
614 .nf
615 #define _GNU_SOURCE
616 #define _FILE_OFFSET_BITS 64
617 #include <stdio.h>
618 #include <time.h>
619 #include <stdlib.h>
620 #include <unistd.h>
621 #include <sys/resource.h>
622
623 #define errExit(msg)    do { perror(msg); exit(EXIT_FAILURE); \\
624                         } while (0)
625
626 int
627 main(int argc, char *argv[])
628 {
629     struct rlimit old, new;
630     struct rlimit *newp;
631     pid_t pid;
632
633     if (!(argc == 2 || argc == 4)) {
634         fprintf(stderr, "Usage: %s <pid> [<new\-soft\-limit> "
635                 "<new\-hard\-limit>]\\n", argv[0]);
636         exit(EXIT_FAILURE);
637     }
638
639     pid = atoi(argv[1]);        /* PID of target process */
640
641     newp = NULL;
642     if (argc == 4) {
643         new.rlim_cur = atoi(argv[2]);
644         new.rlim_max = atoi(argv[3]);
645         newp = &new;
646     }
647
648     /* Set CPU time limit of target process; retrieve and display
649        previous limit */
650
651     if (prlimit(pid, RLIMIT_CPU, newp, &old) == \-1)
652         errExit("prlimit\-1");
653     printf("Previous limits: soft=%lld; hard=%lld\\n",
654             (long long) old.rlim_cur, (long long) old.rlim_max);
655
656     /* Retrieve and display new CPU time limit */
657
658     if (prlimit(pid, RLIMIT_CPU, NULL, &old) == \-1)
659         errExit("prlimit\-2");
660     printf("New limits: soft=%lld; hard=%lld\\n",
661             (long long) old.rlim_cur, (long long) old.rlim_max);
662
663     exit(EXIT_FAILURE);
664 }
665 .fi
666 .SH SEE ALSO
667 .BR prlimit (1),
668 .BR dup (2),
669 .BR fcntl (2),
670 .BR fork (2),
671 .BR getrusage (2),
672 .BR mlock (2),
673 .BR mmap (2),
674 .BR open (2),
675 .BR quotactl (2),
676 .BR sbrk (2),
677 .BR shmctl (2),
678 .BR malloc (3),
679 .BR sigqueue (3),
680 .BR ulimit (3),
681 .BR core (5),
682 .BR capabilities (7),
683 .BR signal (7)
684 .SH COLOPHON
685 This page is part of release 3.68 of the Linux
686 .I man-pages
687 project.
688 A description of the project,
689 information about reporting bugs,
690 and the latest version of this page,
691 can be found at
692 \%http://www.kernel.org/doc/man\-pages/.