fix(zephyr): Real os_timespec definition with comments

This commit is contained in:
Lucas Abad 2025-09-09 12:13:45 +02:00
parent 45acd9fb9f
commit c8a7f00326
No known key found for this signature in database
GPG Key ID: A711808FFB607F04

View File

@ -281,7 +281,24 @@ typedef unsigned int os_nfds_t;
#define FIONREAD ZFD_IOCTL_FIONREAD
typedef struct timespec os_timespec;
/*
* The previous `os_timespec` was a forward declaration:
*
* typedef struct timespec os_timespec;
*
* It was not bad as is, but seemed to not be included from anywhere.
* As of Zephyr v3.7.0 (LTS) the `timespec` struct is only declared with the
* configuration `CONFIG_POSIX_API` enabled which is not a prefered
* configuration for the Zephyr port.
*
* NOTE: If Zephyr later exposes `struct timespec` without requiring
* CONFIG_POSIX_API, this definition should be replaced by an alias.
*/
typedef struct {
int64_t tv_sec;
long tv_nsec;
} os_timespec;
#ifndef CLOCK_REALTIME
#define CLOCK_REALTIME 1