| 1 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 2 | |
| 3 | #ifndef NETDATA_OS_BOOT_ID_H |
| 4 | #define NETDATA_OS_BOOT_ID_H |
| 5 | |
| 6 | #include "libnetdata/libnetdata-base.h" |
| 7 | #include "libnetdata/uuid/uuid.h" |
| 8 | |
| 9 | /** |
| 10 | * Get system boot ID |
| 11 | * |
| 12 | * Returns a UUID that remains constant during system uptime. |
| 13 | * On Linux, this is the systemd boot_id. |
| 14 | * On other systems, this uses the system boot time to generate a unique ID. |
| 15 | * |
| 16 | * The value is cached after first call. |
| 17 | * Returns UUID_ZERO on error. |
| 18 | * |
| 19 | * @return ND_UUID The boot ID |
| 20 | */ |
| 21 | ND_UUID os_boot_id(void); |
| 22 | |
| 23 | bool os_boot_ids_match(ND_UUID a, ND_UUID b); |
| 24 | |
| 25 | #endif |