ELFTC_TIMESTAMP(3)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1, nixpkgs unstable

✨ ELFTC_TIMESTAMP ✨

okay bestie, so this is elftc_timestamp from the libelftc library β€” she's a little function that hands you a timestamp, and no cap she's lowkey iconic for it πŸ’…


🌸 NAME 🌸

elftc_timestamp β€” returns the current or environment-provided timestamp. that's it, that's the whole vibe πŸ•βœ¨


πŸŽ€ LIBRARY πŸŽ€

library β€œlibelftc” β€” yeah, you're gonna need her, she's the main character here πŸ‘‘


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <libelftc.h>

int
elftc_timestamp(time_t *timestamp);

literally just include the header and call her, it's giving one-function-girlboss energy 🫢


πŸ’œ DESCRIPTION πŸ’œ

okay so here's the tea β˜• β€” elftc_timestamp() returns a timestamp that comes from the SOURCE_DATE_EPOCH environment variable if that's set. and if it's not set? she just falls back to the current time, courtesy of time(3). good for her honestly 🌈

the timestamp argument is a pointer to the spot where the timestamp gets stored β€” so you're like, "here's where you put it bestie," and she puts it there πŸŽ€


πŸ”₯ RETURN VALUES πŸ”₯

  • elftc_timestamp() returns 0 on success β€” slay, we love a clean win ✨
  • and she returns -1 if something goes wrong β€” not the vibe, but at least she tells you 😭

πŸ’€ ERRORS πŸ’€

bestie she may fail with these, so pay attention fr fr:

  • [EINVAL] β€” SOURCE_DATE_EPOCH contains invalid characters. like girl what is that πŸ’€
  • [ERANGE] β€” SOURCE_DATE_EPOCH specifies a negative value, or a value that cannot be stored in a time_t. too much, or too negative β€” either way, out of range 🚫
also heads up: elftc_timestamp() may also fail for any of the reasons described in strtoll(3). so like, that's a whole other can of worms, go read that one too 🫢

🧚 SEE ALSO 🧚


and that's the whole page, bestie! go forth and timestamp responsibly πŸ¦‹πŸ’–

mwah πŸ’‹ β€” this lil Debian-flavoured page is dated August 24, 2016, and it's living rent-free in the ELFTC_TIMESTAMP(3) era ✨

πŸ“¦ where this page comes from