]> www.infradead.org Git - users/sagi/libnvme.git/commitdiff
examples: Include sys/stat.h for S_I* constants
authorWarner Losh <imp@bsdimp.com>
Fri, 3 May 2024 16:14:29 +0000 (10:14 -0600)
committerDaniel Wagner <wagi@monom.org>
Mon, 6 May 2024 17:01:40 +0000 (19:01 +0200)
POSIX says that these constants are defined in sys/stat.h. On Linux with
glibc and musl this is also defined in fcntl.h. Other systems define it
only in sys/stat.h, so include that as well. The Linux headers ensure
that the first of sys/stat.h or fcntl.h define the constant, so it's
harmless to include both.

For the latest standard, IEEE Std 1003.1-2017, see
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/fcntl.h.html
and
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_stat.h.html
for details.

Signed-off-by: Warner Losh <imp@bsdimp.com>
examples/telemetry-listen.c

index ec5edb3817a9c445d6beb105099dfdac0200d5ef..9aae8b07737ab753a0e63421639d1bf833f57b3c 100644 (file)
@@ -19,6 +19,7 @@
 #include <unistd.h>
 #include <time.h>
 #include <libnvme.h>
+#include <sys/stat.h>
 
 #include <ccan/endian/endian.h>