I have been going through header files and I'm not able to find any file with status flag definitions (like O_RDONLY).
Thanks, John
I have been going through header files and I'm not able to find any file with status flag definitions (like O_RDONLY).
Thanks, John
Summary
If you're on Linux, it should be in
/usr/include/bits/fcntl.h.You can find it using
rgrep, orctagsandVim, orcpp, orcwhere.rgrep
The simplest way is to use
rgrep, a.k.a.grep -R.ctags
Or, you could run
ctags -Rin/usr/includeand then runvim -t O_WRONLY.Or, a bit better, but more typing:
cpp
The best way I have found is using
cpp.Assuming you have a source file called YOUR_SOURCE_FILE with the necessary
#includes, try running:Then search for your
#define, e.g./O_WRONLY, then scroll up to find the first file name above it. In this case:means that
O_WRONLYis being picked up from/usr/include/bits/fcntl.hif you include the three header files mentioned inman fcntl.cwhere
I have a script called
cwhereto automate runningcpp:Download cwhere here
If
descis installed, you can just type the name of the function that uses that#define, e.g.Download desc here