elftc_timestamp(3)

elftc_timestamp3

Return the current or environment-provided timestamp

Usage

#include <libelftc.h>

int

elftc_timestamp(time_t *timestamp);

Library

library “libelftc”

Overview

The elftc_timestamp() function returns a timestamp supplied by the SOURCE_DATE_EPOCH environment variable, or the current time provided by time(3) if the environment variable is not set.

The timestamp argument specifies a pointer to the location where the timestamp will be stored.

Return values

Function elftc_timestamp() returns 0 on success, and -1 in the event of an error.

Errors

The elftc_timestamp() function may fail with the following errors:

[EINVAL]

SOURCE_DATE_EPOCH contains invalid characters.

[ERANGE]

SOURCE_DATE_EPOCH specifies a negative value or a value that cannot be stored in a time_t.

The elftc_timestamp() function may also fail for any of the reasons described in strtoll(3).

Releases

24 releases since FreeBSD 11.1-RELEASE; the text changed 2 times.

  1. 11.1–12.0
  2. 12.1–15.1
  3. 16.0

From base 16.0-CURRENT-20261027-61c70dc16a79 in FreeBSD 16.0-CURRENT (2026-10-27). Parsed by carta from the page's mdoc source.