I am new to C language and am trying to view the source for the header file errno.h.
How can I:
- Figure out where the header file is stored on my computer?
- View the source of the header file?
What I've Tried
From this answer, running gcc --print-file-name=errno.h in my $HOME directory just outputs errno.h.
From this answer, running cpp -dM /usr/include/errno.h | grep 'define E' | sort -n -k 3 outputs:
clang: error: no such file or directory: '/usr/include/errno.h'
clang: error: no input files
From this answer, running clang -E /usr/include/errno.h outputs:
clang: error: no such file or directory: '/usr/include/errno.h'
clang: error: no input files
One solution I know works is running sudo find / -name "errno*.h" -type f. However, this returns many results. I am wondering if there's some programmatic way to find the source using a C-related tool (e.g. by invoking gcc).
My Computer
- macOS version: 10.15.7 (Catalina)
clang --version-->Apple clang version 12.0.0 (clang-1200.0.32.27)