times.3 (a307d598387eeb7d775332066d996ab0dadf7e5f) | times.3 (97e1bac18964fab4898772668968d319f434db34) |
---|---|
1.\" Copyright (c) 1990, 1991, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. --- 32 unchanged lines hidden (view full) --- 41.Sh LIBRARY 42.Lb libc 43.Sh SYNOPSIS 44.Fd #include <sys/times.h> 45.Ft clock_t 46.Fn times "struct tms *tp" 47.Sh DESCRIPTION 48.Bf -symbolic | 1.\" Copyright (c) 1990, 1991, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. --- 32 unchanged lines hidden (view full) --- 41.Sh LIBRARY 42.Lb libc 43.Sh SYNOPSIS 44.Fd #include <sys/times.h> 45.Ft clock_t 46.Fn times "struct tms *tp" 47.Sh DESCRIPTION 48.Bf -symbolic |
49This interface is obsoleted by getrusage(2) 50and gettimeofday(3). | 49This interface is obsoleted by 50.Xr getrusage 2 51and 52.Xr gettimeofday 3 . |
51.Ef 52.Pp 53The 54.Fn times 55function returns the value of time in 56.Dv CLK_TCK Ns 's 57of a second since 580 hours, 0 minutes, 0 seconds, January 1, 1970, Coordinated Universal 59Time. 60.Pp 61It also fills in the structure pointed to by 62.Fa tp 63with time-accounting information. 64.Pp 65The | 53.Ef 54.Pp 55The 56.Fn times 57function returns the value of time in 58.Dv CLK_TCK Ns 's 59of a second since 600 hours, 0 minutes, 0 seconds, January 1, 1970, Coordinated Universal 61Time. 62.Pp 63It also fills in the structure pointed to by 64.Fa tp 65with time-accounting information. 66.Pp 67The |
66.Fa tms | 68.Vt tms |
67structure is defined as follows: 68.Bd -literal -offset indent | 69structure is defined as follows: 70.Bd -literal -offset indent |
69typedef struct { | 71struct tms { |
70 clock_t tms_utime; 71 clock_t tms_stime; 72 clock_t tms_cutime; 73 clock_t tms_cstime; | 72 clock_t tms_utime; 73 clock_t tms_stime; 74 clock_t tms_cutime; 75 clock_t tms_cstime; |
74} | 76}; |
75.Ed 76.Pp 77The elements of this structure are defined as follows: | 77.Ed 78.Pp 79The elements of this structure are defined as follows: |
78.Bl -tag -width tms_cutime 79.It Fa tms_utime | 80.Bl -tag -width ".Va tms_cutime" 81.It Va tms_utime |
80The 81.Tn CPU 82time charged for the execution of user instructions. | 82The 83.Tn CPU 84time charged for the execution of user instructions. |
83.It Fa tms_stime | 85.It Va tms_stime |
84The 85.Tn CPU 86time charged for execution by the system on behalf of 87the process. | 86The 87.Tn CPU 88time charged for execution by the system on behalf of 89the process. |
88.It Fa tms_cutime | 90.It Va tms_cutime |
89The sum of the | 91The sum of the |
90.Fa tms_utime s | 92.Va tms_utime Ns s |
91and | 93and |
92.Fa tms_cutime s | 94.Va tms_cutime Ns s |
93of the child processes. | 95of the child processes. |
94.It Fa tms_cstime | 96.It Va tms_cstime |
95The sum of the 96.Fa tms_stime Ns s 97and 98.Fa tms_cstime Ns s 99of the child processes. 100.El 101.Pp 102All times are in 103.Dv CLK_TCK Ns 's 104of a second. 105.Pp 106The times of a terminated child process are included in the | 97The sum of the 98.Fa tms_stime Ns s 99and 100.Fa tms_cstime Ns s 101of the child processes. 102.El 103.Pp 104All times are in 105.Dv CLK_TCK Ns 's 106of a second. 107.Pp 108The times of a terminated child process are included in the |
107.Fa tms_cutime | 109.Va tms_cutime |
108and | 110and |
109.Fa tms_cstime | 111.Va tms_cstime |
110elements of the parent when one of the 111.Xr wait 2 112functions returns the process ID of the terminated child to the parent. 113If an error occurs, 114.Fn times 115returns the value | 112elements of the parent when one of the 113.Xr wait 2 114functions returns the process ID of the terminated child to the parent. 115If an error occurs, 116.Fn times 117returns the value |
116.Pq (clock_t)\-1 , 117and sets errno to indicate the error. | 118.Pq Po Vt clock_t Pc Ns \-1 , 119and sets 120.Va errno 121to indicate the error. |
118.Sh ERRORS 119The 120.Fn times 121function 122may fail and set the global variable 123.Va errno 124for any of the errors specified for the library 125routines --- 15 unchanged lines hidden --- | 122.Sh ERRORS 123The 124.Fn times 125function 126may fail and set the global variable 127.Va errno 128for any of the errors specified for the library 129routines --- 15 unchanged lines hidden --- |