Skip to content

Commit

Permalink
examples: Include sys/stat.h for S_I* constants
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
bsdimp authored and igaw committed May 6, 2024
1 parent 80c5cf2 commit 41a448d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions examples/telemetry-listen.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <unistd.h>
#include <time.h>
#include <libnvme.h>
#include <sys/stat.h>

#include <ccan/endian/endian.h>

Expand Down

0 comments on commit 41a448d

Please sign in to comment.