sys_time.h(7POSIX)

πŸ’– PROLOG πŸ’–

okay bestie, quick heads up before we dive in: this manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (so like, go check the corresponding Linux manual page for the deets on how Linux actually does it), or the interface might not even be implemented on Linux at all. πŸ™ˆ


✨ NAME ✨

sys/time.h β€” time types. that's it, that's the vibe. we're talking about the time types header, and it's iconic for it. πŸ•πŸ‘‘


🌸 SYNOPSIS 🌸

#include <sys/time.h>

πŸŽ€ DESCRIPTION πŸŽ€

so the <sys/time.h> header shall define the timeval structure, and it shall include at least these members:

time_t         tv_sec      Seconds.
suseconds_t    tv_usec     Microseconds.

the <sys/time.h> header shall also define the itimerval structure, which shall include at least these members:

struct timeval it_interval Timer interval.
struct timeval it_value    Current value.

the <sys/time.h> header shall define the time_t and suseconds_t types as described in <sys/types.h>. periodt. πŸ’…

the <sys/time.h> header shall define the fd_set type as described in <sys/select.h>. slay.

and now, the main characters β€” the <sys/time.h> header shall define these symbolic constants for the which argument of getitimer() and setitimer():

  • ITIMER_REAL β€” decrements in real time. clocking actual time, fr fr.
  • ITIMER_VIRTUAL β€” decrements in process virtual time.
  • ITIMER_PROF β€” decrements both in process virtual time and when the system is running on behalf of the process. overachiever energy, honestly. πŸ”₯

the <sys/time.h> header shall define the following as described in <sys/select.h>: FD_CLR() FD_ISSET() FD_SET() FD_ZERO() FD_SETSIZE

the following shall be declared as functions and may also be defined as macros. Function prototypes shall be provided. no cap, these are them:

int   getitimer(int, struct itimerval *);
int   gettimeofday(struct timeval *restrict, void *restrict);
int   setitimer(int, const struct itimerval *restrict,
          struct itimerval *restrict);
int   select(int, fd_set *restrict, fd_set *restrict, fd_set *restrict,
          struct timeval *restrict);
int   utimes(const char *, const struct timeval [2]);
πŸ‘€ heads up: inclusion of the <sys/time.h> header may make visible all symbols from the <sys/select.h> header. surprise crossover episode, bestie.

the following sections are informative. (yes, they're like, the bonus content. not the main plot but still cute.)


🌈 APPLICATION USAGE 🌈

None. literally nothing. empty. a whole mood. πŸ¦‹


πŸ’œ RATIONALE πŸ’œ

None. again, nothing. we're keeping it mysterious. ✨


⭐ FUTURE DIRECTIONS ⭐

None. no future plans, living in the present, main character energy. πŸ’…


🫢 SEE ALSO 🫢

  • <sys_select.h>
  • <sys_types.h>

The System Interfaces volume of POSIX.1‐2017, futimens(), getitimer(), gettimeofday(), pselect()


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. 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 whole page, bestie!! this one came from the IEEE/The Open Group, dated 2017, and it lives at sys_time.h(7POSIX) in the POSIX Programmer's Manual. go off, time types. πŸŽ€βœ¨πŸ’–