]> www.infradead.org Git - users/sagi/libnvme.git/commit
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)
commit41a448da815eda28c63e3e8132f7f40e0aea8afc
tree8af5cfe3d35a62b7edacd9940034edf991fd4ee6
parent80c5cf2aa45f4afc7571dc48850fae3fd62828af
examples: Include sys/stat.h for S_I* constants

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