C language and the linux keyword - proof that linux is always Number 1
arjunsreedharan.org
arjunsreedharan.org
It's there so you can guard platform-dependent code with #if linux -- that's why it's defined to a trivial non-zero value.
This kind of macro should really be named with underscores, like __linux__ but the bare linux constant has been there since the early days of Linux and they just can't remove it now.
For fun, here's a list of other OS-specific macros for platform detection: