OSDN Git Service

(split) LDP_man-pages: update original to v3.34.
[linuxjm/LDP_man-pages.git] / original / man2 / getrlimit.2
index 52f99ab..3b71e66 100644 (file)
@@ -61,7 +61,7 @@
 .\" 2008-05-07, mtk / Peter Zijlstra, Added description of RLIMIT_RTTIME
 .\" 2010-11-06, mtk: Added documentation of prlimit()
 .\"
-.TH GETRLIMIT 2 2010-12-03 "Linux" "Linux Programmer's Manual"
+.TH GETRLIMIT 2 2011-09-10 "Linux" "Linux Programmer's Manual"
 .SH NAME
 getrlimit, setrlimit, prlimit \- get/set resource limits
 .SH SYNOPSIS
@@ -84,7 +84,7 @@ Feature Test Macro Requirements for glibc (see
 .in
 .sp
 .BR prlimit ():
-_GNU_SOURCE
+_GNU_SOURCE && _FILE_OFFSET_BITS == 64
 .SH DESCRIPTION
 The
 .BR getrlimit ()
@@ -164,7 +164,7 @@ If the process continues to consume CPU time, it will be sent
 once per second until the hard limit is reached, at which time
 it is sent
 .BR SIGKILL .
-(This latter point describes Linux 2.2 through 2.6 behavior.
+(This latter point describes Linux behavior.
 Implementations vary in how they treat processes which continue to
 consume CPU time after reaching the soft limit.
 Portable applications that need to catch this signal should
@@ -352,7 +352,7 @@ that may be queued for the real user ID of the calling process.
 Both standard and real-time signals are counted for the purpose of
 checking this limit.
 However, the limit is only enforced for
-.BR sigqueue (2);
+.BR sigqueue (3);
 it is always possible to use
 .BR kill (2)
 to queue one instance of any of the signals that are not already
@@ -523,17 +523,21 @@ The program below demonstrates the use of
 .PP
 .nf
 #define _GNU_SOURCE
+#define _FILE_OFFSET_BITS 64
 #include <stdio.h>
 #include <time.h>
 #include <stdlib.h>
 #include <unistd.h>
 #include <sys/resource.h>
 
+#define errExit(msg)   do { perror(msg); exit(EXIT_FAILURE); \\
+                        } while (0)
+
 int
 main(int argc, char *argv[])
 {
-    struct rlimit64 old, new;
-    struct rlimit64 *newp;
+    struct rlimit old, new;
+    struct rlimit *newp;
     pid_t pid;
 
     if (!(argc == 2 || argc == 4)) {
@@ -551,7 +555,7 @@ main(int argc, char *argv[])
         newp = &new;
     }
 
-    /* Set CPU time limit of target prcess; retrieve and display
+    /* Set CPU time limit of target process; retrieve and display
        previous limit */
 
     if (prlimit(pid, RLIMIT_CPU, newp, &old) == \-1)
@@ -624,8 +628,8 @@ was greater than
 .BR quotactl (2),
 .BR sbrk (2),
 .BR shmctl (2),
-.BR sigqueue (2),
 .BR malloc (3),
+.BR sigqueue (3),
 .BR ulimit (3),
 .BR core (5),
 .BR capabilities (7),