evocation/constants-linux.e
2026-09-24 17:47:58 +03:00

29 lines
688 B
Text

~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ ~~ OS-specific constants for Linux ~~
~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ An ABI value of 0 (for the System V ABI) would work fine too, but 3 allows
~ FreeBSD's Linux compatibility features to kick in.
: elf-osabi 3 ~ : -1 Linux ABI
;
~ Syscall numbers for Linux on AMD64
: SYS_read 0 ;
: SYS_write 1 ;
: SYS_open 2 ;
: SYS_close 3 ;
: SYS_mmap 9 ;
: SYS_exit 60 ;
~ Memory protection flags for Linux
: PROT_READ 1 ;
: PROT_WRITE 2 ;
: PROT_EXEC 4 ;
~ mmap(2) flags
: MAP_PRIVATE 2 ;
: MAP_ANONYMOUS 0x20 ;
~ errno constants. Evocation follows the Linux kernel API of returning the
~ error values as negated.
: -EINTR -4 ;