File: getrlimit.2

package info (click to toggle)
manpages-fr 0.5-3
  • links: PTS
  • area: main
  • in suites: slink
  • size: 4,236 kB
  • ctags: 4
  • sloc: makefile: 55
file content (142 lines) | stat: -rw-r--r-- 4,774 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
.\" Hey Emacs! This file is -*- nroff -*- source.
.\"
.\" Copyright (c) 1992 Drew Eckhardt, March 28, 1992
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Permission is granted to copy and distribute modified versions of this
.\" manual under the conditions for verbatim copying, provided that the
.\" entire resulting derived work is distributed under the terms of a
.\" permission notice identical to this one
.\" 
.\" Since the Linux kernel and libraries are constantly changing, this
.\" manual page may be incorrect or out-of-date.  The author(s) assume no
.\" responsibility for errors or omissions, or for damages resulting from
.\" the use of the information contained herein.  The author(s) may not
.\" have taken the same level of care in the production of this manual,
.\" which is licensed free of charge, as they might when working
.\" professionally.
.\" 
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
.\"
.\" Modified by Michael Haardt (u31b3hs@pool.informatik.rwth-aachen.de)
.\" Modified Fri Jul 23 21:18:14 1993 by Rik Faith (faith@cs.unc.edu)
.\" Modified Jan 13, 1996 by Arnt Gulbrandsen <agulbra@troll.no>
.\" 
.\" Traduction  11/10/1996 Christophe BLAESS (ccb@club-internet.fr)
.\" Mise a jour 8/04/97
.TH GETRLIMIT 2 "8 Avril 1997" Linux "Manuel du programmeur Linux"
.SH NOM
getrlimit, getrusage, setrlimit \- Lire / ecrire les limites d'utilisation des ressources systemes.
.SH SYNOPSIS
.B #include <sys/time.h>
.br
.B #include <sys/resource.h>
.br
.B #include <unistd.h>
.sp
.BI "int getrlimit (int " resource ", struct rlimit *" rlim );
.br
.BI "int getrusage (int " who ", struct rusage *" usage );
.br
.BI "int setrlimit (int " resource ", const struct rlimit *" rlim );
.SH DESCRIPTION
.B getrlimit
et
.B setrlimit
lisent ou ecrivent les limites des ressources systemes.
.I resource
doit etre l'un des elements suivants :
.PP
\fBRLIMIT_CPU\fP	/* Temps CPU en secondes           */
.br
\fBRLIMIT_FSIZE\fP	/* Taille maximale d'un fichier    */
.br
\fBRLIMIT_DATA\fP	/* Taille maximale zone de donnees */
.br
\fBRLIMIT_STACK\fP	/* Taille maximale de la pile      */
.br
\fBRLIMIT_CORE\fP	/* Taille maximale fichier core    */
.br
\fBRLIMIT_RSS\fP	/* Max resident set size */
.br
\fBRLIMIT_NPROC\fP	/* Nombre maximal de processus     */
.br
\fBRLIMIT_NOFILE\fP	/* Nombre maximal fichiers ouverts */
.PP
L'element suivant n'est pas implemente sous Linux 1.2.13:
.PP
\fBRLIMIT_MEMLOCK\fP	/* Verouillage maximal en memoire  */
.PP
Une ressource peut etre illimitee si l'on precise
.BR RLIM_INFINITY ". " RLIMIT_OFILE
est le nom "BSD" pour
.BR RLIMIT_NOFILE .
.PP
La structure
.B rlimit
est definie comme suit :
.PP
.in +0.5i
.nf
struct rlimit
{
	int	rlim_cur;
	int	rlim_max;
};
.fi
.in -0.5i
.PP
.B getrusage
renvoie l'utilisation courante des ressources, pour \fIwho\fP
correspondant a 
.B RUSAGE_SELF
ou
.B RUSAGE_CHILDREN.
.PP 
.in +0.5i
.nf
struct rusage
{
  struct timeval ru_utime; /* Temps utilisateur ecoule         */
  struct timeval ru_stime; /* Temps systeme ecoule             */
  long  ru_maxrss;         /* maximum resident set size */
  long  ru_ixrss;          /* Taille de memoire partagee       */
  long  ru_idrss;          /* Taille des donnees non partagees */
  long  ru_isrss;          /* Taille de pile                   */
  long  ru_minflt;         /* Demandes de pages                */
  long  ru_majflt;         /* Nombre de fautes de pages        */
  long  ru_nswap;          /* Nombre de swaps                  */
  long  ru_inblock;        /* Nombre de lectures de blocs      */
  long  ru_oublock;        /* Nombre d'ecritures de blocs      */
  long  ru_msgsnd;         /* Nombre de messages emis          */
  long  ru_msgrcv;         /* Nombre de messages recus         */
  long  ru_nsignals;       /* Nombre de signaux recus          */
  long  ru_nvcsw;          /* Chgmnts de contexte volontaires  */
  long  ru_nivcsw;         /* Chgmnts de contexte involontaires*/
};
.fi
.in -0.5i
.SH "VALEUR RENVOYEE"
Ces fonctions
renvoient 0 si elles reussissent, ou \-1 si elles echouent, auquel cas
.I errno
contient le code d'erreur.
.SH ERREURS
.TP
.B EINVAL
.BR getrlimit " ou " setrlimit
est appele avec un mauvais argument \fIresource\fP, 
ou \fBgetrusage\fP est appele avec un mauvais argument \fIwho\fP.
.TP
.B EPERM
Tentative d'utiliser \fBsetrlimit()\fP sans etre Super\-User pour
augmenter ses limites, ou alors le Super\-User essaye d'augmenter
les limites au-dessus des maxima du noyau.
.SH "CONFORMITE"
SVr4, BSD 4.3
.SH "VOIR AUSSI"
.BR ulimit "(2), " quotactl (2)