In which header file are EINVAL, ENOMEM etc. defined in Linux?

He said that error numbers such as EINVAL, ENOMEM etc. are defined in errno.h, but I cannot find them in errno.h, I also looked for some directories in / usr / include, but still not I can find them. I can use these macros without any problems in my C code. Can anyone tell me where they are?

+4
source share
3 answers

It is defined either directly in errno.h, or in a file included (directly or indirectly) with errno.h.

I searched for it using the following command:

find /usr/include | xargs grep ENOMEM | grep '#define'

and I found a match in /usr/include/asm-generic/errno-base.hin my Linux (RHEL 6).

+9
source

C.

, <errno.h> - , .

.

+5

You can run locate errno.h | xargs grep EINVALto find the location

On my Ubuntu 12.04 computer, its in /usr/lib/syslinux/com32/include/errno.h

+1
source

All Articles