.\" -*- coding: UTF-8 -*- .\" Copyright (c) 1992 Drew Eckhardt (drew@cs.colorado.edu), March 28, 1992 .\" .\" %%%LICENSE_START(VERBATIM) .\" 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. .\" %%%LICENSE_END .\" .\" Modified by Michael Haardt (michael@moria.de) .\" Modified Sat Jul 24 14:29:17 1993 by Rik Faith (faith@cs.unc.edu) .\" Modified 961203 and 001211 and 010326 by aeb@cwi.nl .\" Modified 001213 by Michael Haardt (michael@moria.de) .\" Modified 13 Jun 02, Michael Kerrisk .\" Added note on nonstandard behavior when SIGCHLD is ignored. .\" Modified 2004-11-16, mtk, Noted that the nonconformance when .\" SIGCHLD is being ignored is fixed in 2.6.9; other minor changes .\" Modified 2004-12-08, mtk, in 2.6 times() return value changed .\" 2005-04-13, mtk .\" Added notes on nonstandard behavior: Linux allows 'buf' to .\" be NULL, but POSIX.1 doesn't specify this and it's nonportable. .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH TIMES 2 "15 septembre 2017" Linux "Manuel du programmeur Linux" .SH NOM times \- Obtenir les statistiques temporelles du processus .SH SYNOPSIS \fB#include \fP .PP \fBclock_t times(struct tms *\fP\fIbuf\fP\fB);\fP .SH DESCRIPTION La fonction \fBtimes\fP() stocke les durées statistiques du processus en cours dans la structure \fIstruct tms\fP pointée par \fIbuf\fP. La structure \fIstruct tms\fP est définie ainsi dans \fI\fP\ : .PP .in +4n .EX struct tms { clock_t tms_utime; /* durée utilisateur */ clock_t tms_stime; /* durée système */ clock_t tms_cutime; /* durée utilisateur des fils */ clock_t tms_cstime; /* durée système des fils */ .EE .in .PP The \fItms_utime\fP field contains the CPU time spent executing instructions of the calling process. The \fItms_stime\fP field contains the CPU time spent executing inside the kernel while performing tasks on behalf of the calling process. .PP The \fItms_cutime\fP field contains the sum of the \fItms_utime\fP and \fItms_cutime\fP values for all waited\-for terminated children. The \fItms_cstime\fP field contains the sum of the \fItms_stime\fP and \fItms_cstime\fP values for all waited\-for terminated children. .PP Les durées des processus fils terminés (et de leurs descendants) sont ajoutées au moment où \fBwait\fP(2) ou \fBwaitpid\fP(2) renvoient leur numéro de PID. En particulier, les durées des petits\-fils que le fils n'a pas attendu ne sont jamais vues. .PP Toutes les durées sont exprimées en tops d'horloge. .SH "VALEUR RENVOYÉE" \fBtimes\fP() renvoie le nombre de tops d'horloge écoulés depuis un instant arbitraire dans le passé. Cette valeur peut déborder de l'intervalle contenu dans un \fIclock_t\fP. En cas d'erreur \fI(clock_t)\ \-1\fP est renvoyé et \fIerrno\fP contient le code d'erreur. .SH ERREURS .TP \fBEFAULT\fP \fItms\fP pointe en dehors de l'espace d'adressage du processus. .SH CONFORMITÉ POSIX.1\-2001, POSIX.1\-2008, SVr4, 4.3BSD. .SH NOTES Le nombre de tops d'horloge par seconde peut être obtenu en utilisant\ : .PP .in +4n .EX sysconf(_SC_CLK_TCK); .EE .in .PP Dans POSIX.1\-1996, le symbole \fBCLK_TCK\fP (défini dans \fI\fP) est indiqué en voie d'obsolescence. Il est désormais obsolète. .PP .\" See the description of times() in XSH, which says: .\" The times of a terminated child process are included... when wait() .\" or waitpid() returns the process ID of this terminated child. Sous les noyaux Linux antérieurs à 2.6.9, si le traitement de \fBSIGCHLD\fP est configuré avec \fBSIG_IGN\fP, alors les durées des enfants terminés sont automatiquement incluses dans les champs \fItms_cstime\fP et \fItms_cutime\fP, bien que POSIX.1\-2001 précise que ceci ne doit se produire que si le processus appelant a fait un \fBwait\fP(2) pour ses enfants. Cette non conformité est corrigée depuis Linux 2.6.9. .PP Sous Linux, l'argument \fIbuf\fP peut être NULL, auquel cas \fBtimes\fP() renvoie simplement son résultat. Cependant, ce comportement n'est pas spécifié par POSIX, et la plupart des implémentations requièrent une valeur non NULL de \fIbuf\fP. .PP Notez que \fBclock\fP(3) renvoie aussi des valeurs de type \fIclock_t\fP, mais cette valeur est mesurée en unités de \fBCLOCKS_PER_SEC\fP, pas en tops d'horloge utilisés par \fBtimes\fP(). .PP .\" .PP .\" On older systems the number of clock ticks per second is given .\" by the variable HZ. On Linux, the "arbitrary point in the past" from which the return value of \fBtimes\fP() is measured has varied across kernel versions. On Linux 2.4 and earlier, this point is the moment the system was booted. Since Linux 2.6, this point is \fI(2^32/HZ) \- 300\fP seconds before system boot time. This variability across kernel versions (and across UNIX implementations), combined with the fact that the returned value may overflow the range of \fIclock_t\fP, means that a portable application would be wise to avoid using this value. To measure changes in elapsed time, use \fBclock_gettime\fP(2) instead. .SS Historique SVr1\-3 renvoie un \fIlong\fP et les membres de la structure sont de type \fItime_t\fP bien qu'ils stockent des tops d'horloge et pas des secondes depuis l'époque. V7 utilisait des \fIlong\fP pour les membres des structures, car il n'avait pas encore de type \fItime_t\fP. .SH BOGUES .\" The problem is that a syscall return of -4095 to -1 .\" is interpreted by glibc as an error, and the wrapper converts .\" the return value to -1. .\" http://marc.info/?l=linux-kernel&m=119447727031225&w=2 .\" "compat_sys_times() bogus until jiffies >= 0" .\" November 2007 Une limitation des conventions d'appel système Linux sur certaines architectures (notamment i386) fait que sous linux\ 2.6, il y a une petite fenêtre de temps (41\ secondes) après le démarrage où \fBtimes\fP() peut retourner \-1, indiquant à tort qu'une erreur est apparue. Le même problème peut survenir lorsque les enveloppes de valeurs renvoyées ont passé la valeur maximum qui puisse être stockée dans \fBclock_t\fP. .SH "VOIR AUSSI" \fBtime\fP(1), \fBgetrusage\fP(2), \fBwait\fP(2), \fBclock\fP(3), \fBsysconf\fP(3), \fBtime\fP(7) .SH COLOPHON Cette page fait partie de la publication\ 5.10 du projet \fIman\-pages\fP Linux. Une description du projet et des instructions pour signaler des anomalies et la dernière version de cette page peuvent être trouvées à l'adresse \%https://www.kernel.org/doc/man\-pages/. .SH TRADUCTION La traduction française de cette page de manuel a été créée par Christophe Blaess , Stéphan Rafin , Thierry Vignaud , François Micaux, Alain Portal , Jean-Philippe Guérard , Jean-Luc Coulon (f5ibh) , Julien Cristau , Thomas Huriaux , Nicolas François , Florentin Duneau , Simon Paillard , Denis Barbier et David Prévot . Cette traduction est une documentation libre ; veuillez vous reporter à la .UR https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License version 3 .UE concernant les conditions de copie et de distribution. Il n'y a aucune RESPONSABILITÉ LÉGALE. Si vous découvrez un bogue dans la traduction de cette page de manuel, veuillez envoyer un message à .MT debian-l10n-french@lists.debian.org .ME .