1SD_BUS_MESSAGE_GET_MONOTsOdN_IbCu_sU_SmEeCs(s3a)ge_get_mSoDn_oBtUoSn_iMcE_SuSsAeGcE_GET_MONOTONIC_USEC(3)
2
3
4

NAME

6       sd_bus_message_get_monotonic_usec, sd_bus_message_get_realtime_usec,
7       sd_bus_message_get_seqnum - Retrieve the sender timestamps and sequence
8       number of a message
9

SYNOPSIS

11       #include <systemd/sd-bus.h>
12
13       int sd_bus_message_get_monotonic_usec(sd_bus_message *message,
14                                             uint64_t *usec);
15
16       int sd_bus_message_get_realtime_usec(sd_bus_message *message,
17                                            uint64_t *usec);
18
19       int sd_bus_message_get_seqnum(sd_bus_message *message,
20                                     uint64_t *seqnum);
21

DESCRIPTION

23       sd_bus_message_get_monotonic_usec() returns the monotonic timestamp of
24       the time the message was sent. This value is in microseconds since the
25       CLOCK_MONOTONIC epoch, see clock_gettime(2) for details.
26
27       Similarly, sd_bus_message_get_realtime_usec() returns the realtime
28       (wallclock) timestamp of the time the message was sent. This value is
29       in microseconds since Jan 1st, 1970, i.e. in the CLOCK_REALTIME clock.
30
31       sd_bus_message_get_seqnum() returns the kernel-assigned sequence number
32       of the message. The kernel assigns a global, monotonically increasing
33       sequence number to all messages transmitted on the local system, at the
34       time the message was sent. This sequence number is useful for
35       determining message send order, even across different buses of the
36       local system. The sequence number combined with the boot ID of the
37       system (as returned by sd_id128_get_boot(3)) is a suitable globally
38       unique identifier for bus messages.
39
40       Note that the sending order and receiving order of messages might
41       differ, in particular for broadcast messages. This means that the
42       sequence number and the timestamps of messages a client reads are not
43       necessarily monotonically increasing.
44
45       These timestamps and the sequence number are attached to each message
46       by the kernel and cannot be manipulated by the sender.
47
48       Note that these timestamps are only available on some bus transports,
49       and only after support for them has been negotiated with the
50       sd_bus_negotiate_timestamp(3) call.
51

RETURN VALUE

53       On success, these calls return 0 or a positive integer. On failure,
54       these calls return a negative errno-style error code.
55
56       On success, the timestamp or sequence number is returned in the
57       specified 64-bit unsigned integer variable.
58

ERRORS

60       Returned errors may indicate the following problems:
61
62       -EINVAL
63           A specified parameter is invalid.
64
65       -ENODATA
66           No timestamp or sequence number information is attached to the
67           passed message. This error is returned if the underlying transport
68           does not support timestamping or assigning of sequence numbers, or
69           if this feature has not been negotiated with
70           sd_bus_negotiate_timestamp(3).
71

NOTES

73       These APIs are implemented as a shared library, which can be compiled
74       and linked to with the libsystemd pkg-config(1) file.
75

SEE ALSO

77       systemd(1), sd-bus(3), sd_bus_new(3), sd_bus_negotiate_timestamp(3),
78       clock_gettime(2), sd_id128_get_boot(3)
79
80
81
82systemd 241                               SD_BUS_MESSAGE_GET_MONOTONIC_USEC(3)
Impressum