sys_times.h(7POSIX)

πŸ’– PROLOG πŸ’–

okay so real talk before we even start: this page is part of the POSIX Programmer's Manual. that means the Linux implementation of this interface may differ (so like, go check the matching Linux manual page for the actual Linux behavior, bestie) β€” or honestly the interface might not even be implemented on Linux at all. not every vibe ships everywhere πŸ’…

This one is sys_times.h(7POSIX) from the POSIX Programmer's Manual, and we're about to read the whole thing together, no skimming, no skipping. 🫢


✨ NAME ✨

sys/times.h β€” the file access and modification times structure. that's the whole job. it's giving "one header, one purpose, iconic". πŸ‘‘


🌸 SYNOPSIS 🌸

#include <sys/times.h>

that's it. that's the door. walk in. πŸšͺ✨


πŸŽ€ DESCRIPTION πŸŽ€

so the <sys/times.h> header shall define the tms structure. this is the struct that times() hands back to you, and it shall include at least these members:

clock_t  tms_utime  User CPU time.
clock_t  tms_stime  System CPU time.
clock_t  tms_cutime User CPU time of terminated child processes.
clock_t  tms_cstime System CPU time of terminated child processes.

look at her. four little fields, all clock_t, all doing their own thing. tms_utime is your user CPU time, tms_stime is your system CPU time, tms_cutime is the user CPU time of terminated child processes, and tms_cstime is the system CPU time of terminated child processes. children said "here's my CPU time, mom" 😭

also, the <sys/times.h> header shall define the clock_t type, exactly as described over in <sys/types.h>. don't reinvent her, she already exists. πŸ’œ

and then β€” the following shall be declared as a function, and it may also be defined as a macro, and a function prototype shall be provided:

clock_t times(struct tms *);

periodt. that's the whole interface. one struct, one function, zero drama. 🌈

heads up: the following sections (APPLICATION USAGE, RATIONALE, FUTURE DIRECTIONS) are informative β€” not normative. they're the vibes section, not the rules section. πŸ“

πŸ“ APPLICATION USAGE πŸ“

None. literally none. nothing to add. she said "no notes" πŸ’…


🧚 RATIONALE 🧚

None. again, no notes. the reasoning is simply that she's right. ✨


πŸ¦‹ FUTURE DIRECTIONS πŸ¦‹

None. the future is bright and it is unchanged. 🌟


πŸ‘‘ SEE ALSO πŸ‘‘

  • <sys_types.h> β€” go read that one too, bestie, clock_t lives there 🫢
  • The System Interfaces volume of POSIX.1‐2017, times() β€” the main character herself, the function this whole header is built around πŸ”₯

okay legal moment, stay with me, this part is important and I'm not changing a single fact of it:

Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group.

In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. (translation: if they disagree, the original wins, no debate, no cap. 🫑)

The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .

Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .


and that's the page, bestie!! πŸ’–βœ¨ this one came to you courtesy of IEEE/The Open Group, dated 2017 β€” so when you cite her, cite her right. mwah. πŸŽ€πŸ¦‹πŸ’