0

Where can I find the definitions for file mode flags such as S_IRUSR, S_IRUSR, S_IROTH.. etc...?

I looked on sys/stat.h but couldn't find the same?

Killbill
  • 37
  • 1
  • If they're not in the file for ``, they're probably in a file included, directly or indirectly, from it. On a Mac, `S_IRUSR` is defined in what corresponds to `/usr/include/sys/_types/_s_ifmt.h` — that's one of 17 headers included from `/usr/include/sys/stat.h`. But the details don't matter most of the time, as long as the compiler can find them. You can search with `grep` or `cscope` or another tool. – Jonathan Leffler Jan 25 '23 at 04:36

1 Answers1

0

On my system they are defined in:

  • /usr/include/fcntl.h
  • /usr/include/linux/stat.h
  • /usr/include/x86_64-linux-gnu/sys/stat.h
Allan Wind
  • 23,068
  • 5
  • 28
  • 38