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
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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