tevent_helpers(3)
๐ tevent_helpers โ the tevent helper functions ๐
okay bestie, gather round, because this is the manual page for tevent_helpers โ that's section 3 of the library functions manual for tevent, and honestly? it's giving very useful little grab-bag of utility functions. ๐
It's all about timevals (those struct timeval cuties) and one very smart pid cache. No cap. Let's get into it. ๐ฆ
โจ SYNOPSIS โจ
๐ Topics
- The tevent call depth tracking functions โ the call depth tracking consists of two parts.
๐ ๏ธ Functions
int tevent_timeval_compare (const struct timeval *tv1, const struct timeval *tv2)โ compare two timeval values.struct timeval tevent_timeval_zero (void)โ get a zero timeval value.struct timeval tevent_timeval_current (void)โ get a timeval value for the current time.struct timeval tevent_timeval_set (uint32_t secs, uint32_t usecs)โ get a timeval structure with the given values.struct timeval tevent_timeval_until (const struct timeval *tv1, const struct timeval *tv2)โ get the difference between two timeval values.bool tevent_timeval_is_zero (const struct timeval *tv)โ check if a given timeval structure is zero.struct timeval tevent_timeval_add (const struct timeval *tv, uint32_t secs, uint32_t usecs)โ add the given amount of time to a timeval structure.struct timeval tevent_timeval_current_ofs (uint32_t secs, uint32_t usecs)โ get a timeval in the future with a specified offset from now.pid_t tevent_cached_getpid (void)โ a cached version ofgetpid().
๐ Detailed Description
Todo: description
(yeah bestie, the docs literally say "todo" here. iconic of them honestly. ๐ that's all the detailed description we get!)
๐ฅ Function Documentation ๐ฅ
๐ง pid_t tevent_cached_getpid (void )
A cached version of getpid(). We use getpid() in a lot a performance critical situations in order to check if caches are still valid in the current process.
Calling getpid() always add the cost of an additional syscall! ๐ญ
When tevent is build with pthread support, we already make use of pthread_atfork(), so it's trivial to use it maintain a cache for getpid().
Returns
- The pid of the current process. ๐
๐ struct timeval tevent_timeval_add (const struct timeval * tv, uint32_t secs, uint32_t usecs)
Add the given amount of time to a timeval structure.
Parameters
- tv โ The timeval structure to add the time.
- secs โ The seconds to add to the timeval.
- usecs โ The microseconds to add to the timeval.
Returns
- The timeval structure with the new time. โจ
โญ int tevent_timeval_compare (const struct timeval * tv1, const struct timeval * tv2)
Compare two timeval values.
Parameters
- tv1 โ The first timeval value to compare.
- tv2 โ The second timeval value to compare.
Returns
0if they are equal.1if the first time is greater than the second.-1if the first time is smaller than the second.
Compare two timeval values.
Return -1 if tv1 < tv2 Return 0 if tv1 == tv2 Return 1 if tv1 > tv2
๐ซถ struct timeval tevent_timeval_current (void )
Get a timeval value for the current time.
Returns
- A timeval value with the current time. ๐
Get a timeval value for the current time.
๐
struct timeval tevent_timeval_current_ofs (uint32_t secs, uint32_t usecs)
Get a timeval in the future with a specified offset from now.
Parameters
- secs โ The seconds of the offset from now.
- usecs โ The microseconds of the offset from now.
Returns
- A timeval with the given offset in the future. ๐ฎ
Get a timeval in the future with a specified offset from now.
๐ธ bool tevent_timeval_is_zero (const struct timeval * tv)
Check if a given timeval structure is zero.
Parameters
- tv โ The timeval to check if it is zero.
Returns
- True if it is zero, false otherwise. ๐
Check if a given timeval structure is zero.
๐ struct timeval tevent_timeval_set (uint32_t secs, uint32_t usecs)
Get a timeval structure with the given values.
Parameters
- secs โ The seconds to set.
- usecs โ The microseconds to set.
Returns
- A timeval structure with the given values. ๐
Get a timeval structure with the given values.
๐ฆ struct timeval tevent_timeval_until (const struct timeval * tv1, const struct timeval * tv2)
Get the difference between two timeval values.
Parameters
- tv1 โ The first timeval.
- tv2 โ The second timeval.
Returns
- A timeval structure with the difference between the first and the second value.
Get the difference between two timeval values.
๐ struct timeval tevent_timeval_zero (void )
Get a zero timeval value.
Returns
- A zero timeval value.
Get a zero timeval value.
โ๏ธ Author
Generated automatically by Doxygen for tevent from the source code.
okay that's the whole page, bestie!! ๐ฅณ this was tevent_helpers(3), from tevent, Version 0.9.8, and the manual page name is, you guessed it, tevent_helpers(3). go forth and timeval responsibly!! ๐โจ๐
๐ฆ where this page comes from
- centos-stream 10: libtevent-devel 0.17.1-100.el10 ยท LGPL-3.0-or-later
- fedora 43: libtevent-devel 0.17.1-3.fc43 ยท LGPL-3.0-or-later
- fedora 43: libtevent-devel 0.17.1-3.fc43 ยท LGPL-3.0-or-later
- opensuse-leap 16.0: tevent-man 0.16.2-160000.2.2 ยท LGPL-3.0-or-later
- opensuse-leap 16.0: tevent-man 0.16.2-160000.2.2 ยท LGPL-3.0-or-later
- opensuse-leap 16.0: tevent-man 0.16.2-160000.2.2 ยท LGPL-3.0-or-later
- opensuse-leap 16.0: tevent-man 0.16.2-160000.2.2 ยท LGPL-3.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms