Skip to content

Commit

Permalink
Delete some magic numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
jart committed Sep 26, 2024
1 parent 333c3d1 commit 9255113
Show file tree
Hide file tree
Showing 77 changed files with 1 addition and 246 deletions.
95 changes: 1 addition & 94 deletions libc/sysv/consts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1415,16 +1415,6 @@ syscon shm SHM_NORESERVE 0x1000 0x1000 0 0 0 0 0 0
syscon shm SHM_REMAP 0x4000 0x4000 0 0 0 0 0 0
syscon shm SHM_ANON 0 0 0 0 1 0 0 0

syscon lock LOCK_UNLOCK_CACHE 54 54 0 0 0 0 0 0 # wut

syscon misc IP6F_MORE_FRAG 0x0100 0x0100 0x0100 0x0100 0x0100 0x0100 0x0100 0x0100 # consensus
syscon misc IP6F_OFF_MASK 0xf8ff 0xf8ff 0xf8ff 0xf8ff 0xf8ff 0xf8ff 0xf8ff 0xf8ff # consensus
syscon misc IP6F_RESERVED_MASK 0x0600 0x0600 0x0600 0x0600 0x0600 0x0600 0x0600 0x0600 # consensus

syscon misc L_SET 0 0 0 0 0 0 0 0 # consensus
syscon misc L_INCR 1 1 1 1 1 1 1 0 # unix consensus
syscon misc L_XTND 2 2 2 2 2 2 2 0 # unix consensus

syscon misc SHUT_RD 0 0 0 0 0 0 0 0 # consensus (SD_RECEIVE)
syscon misc SHUT_WR 1 1 1 1 1 1 1 1 # consensus (SD_SEND)
syscon misc SHUT_RDWR 2 2 2 2 2 2 2 2 # consensus (SD_BOTH)
Expand Down Expand Up @@ -1470,11 +1460,6 @@ syscon misc ACCT_COMM 0x10 0x10 0 0 0 0 0 0
syscon misc COMMAND_COMPLETE 0 0 0 0 0 0 0 0 # consensus
syscon misc COMMAND_TERMINATED 17 17 0 0 0 0 0 0

syscon select FD_SETSIZE 0x0400 0x0400 0x0400 0x0400 0x0400 0x0400 0x0400 0x0400 # forced consensus (0x40 on NT)

syscon misc MATH_ERREXCEPT 2 2 2 2 2 2 2 0 # unix consensus
syscon misc MATH_ERRNO 1 1 1 1 1 1 1 0 # unix consensus

syscon misc MCAST_BLOCK_SOURCE 43 43 84 84 84 0 0 43
syscon misc MCAST_JOIN_GROUP 42 42 80 80 80 0 0 41
syscon misc MCAST_JOIN_SOURCE_GROUP 46 46 82 82 82 0 0 45
Expand Down Expand Up @@ -1943,86 +1928,8 @@ syscon junkerr EKEYREJECTED 129 129 -1 -1 -1 -1 -1 -1
syscon junkerr ERFKILL 132 132 -1 -1 -1 -1 -1 -1
syscon junkerr EHWPOISON 133 133 -1 -1 -1 -1 -1 -1

syscon misc FIFOTYPE 54 54 54 54 54 54 54 0 # unix consensus
syscon misc GRPQUOTA 1 1 1 1 1 1 1 0 # unix consensus
syscon misc IF_NAMESIZE 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0 # unix consensus
syscon misc INTERMEDIATE_C_GOOD 10 10 0 0 0 0 0 0
syscon misc INTERMEDIATE_GOOD 8 8 0 0 0 0 0 0

syscon select FD_SETSIZE 0x0400 0x0400 0x0400 0x0400 0x0400 0x0400 0x0400 0x0400 # forced consensus (0x40 on NT)
syscon misc IOV_MAX 1024 1024 1024 1024 1024 1024 1024 16 # unix consensus & MSG_MAXIOVLEN
syscon misc LINE_MAX 0x0800 0x0800 0x0800 0x0800 0x0800 0x0800 0x0800 0 # unix consensus
syscon misc LINKED_CMD_COMPLETE 10 10 0 0 0 0 0 0
syscon misc LINKED_FLG_CMD_COMPLETE 11 11 0 0 0 0 0 0

syscon misc LNKTYPE 49 49 49 49 49 49 49 0 # unix consensus
syscon misc MAXNAMLEN 255 255 255 255 255 255 255 0 # unix consensus
syscon misc MAXQUOTAS 2 2 2 2 2 2 2 0 # unix consensus
syscon misc MEDIUM_ERROR 3 3 0 0 0 0 0 0
syscon misc MEDIUM_SCAN 56 56 0 0 0 0 0 0

syscon misc NBBY 8 8 8 8 8 8 8 0 # unix consensus
syscon misc NR_DQHASH 43 43 0 0 0 0 0 0
syscon misc NR_DQUOTS 0x0100 0x0100 0 0 0 0 0 0

syscon misc PERSISTENT_RESERVE_IN 94 94 0 0 0 0 0 0
syscon misc PERSISTENT_RESERVE_OUT 95 95 0 0 0 0 0 0

syscon misc PRELIM 1 1 1 1 1 1 1 0 # unix consensus
syscon misc REGTYPE 48 48 48 48 48 48 48 0 # unix consensus
syscon misc RES_PRF_CLASS 4 4 4 4 4 4 4 0 # unix consensus
syscon misc RHF_GUARANTEE_START_INIT 0x80 0x80 0 0 0 0 0 0
syscon misc RHF_NO_LIBRARY_REPLACEMENT 4 4 0 0 0 0 0 0

syscon misc RRQ 1 1 1 1 1 1 1 0 # unix consensus
syscon misc RTF_NOFORWARD 0x1000 0x1000 0 0 0 0 0 0
syscon misc RTF_NOPMTUDISC 0x4000 0x4000 0 0 0 0 0 0

syscon misc SARMAG 8 8 8 8 8 8 8 0 # unix consensus
syscon misc SEGSIZE 0x0200 0x0200 0x0200 0x0200 0x0200 0x0200 0x0200 0 # unix consensus
syscon misc SEND_DIAGNOSTIC 29 29 0 0 0 0 0 0
syscon misc SEND_VOLUME_TAG 182 182 0 0 0 0 0 0

syscon misc SET_LIMITS 51 51 0 0 0 0 0 0
syscon misc SET_WINDOW 36 36 0 0 0 0 0 0

syscon misc SFD_CLOEXEC 0x080000 0x080000 0 0 0 0 0 0
syscon misc SFD_NONBLOCK 0x0800 0x0800 0 0 0 0 0 0

syscon misc SUBCMDMASK 255 255 255 255 255 255 255 0 # unix consensus
syscon misc SUBCMDSHIFT 8 8 8 8 8 8 8 0 # unix consensus
syscon misc SYMTYPE 50 50 50 50 50 50 50 0 # unix consensus
syscon misc TGEXEC 8 8 8 8 8 8 8 0 # unix consensus
syscon misc TGREAD 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0 # unix consensus
syscon misc TGWRITE 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0 # unix consensus
syscon misc TMAGLEN 6 6 6 6 6 6 6 0 # unix consensus
syscon misc TOEXEC 1 1 1 1 1 1 1 0 # unix consensus
syscon misc TOREAD 4 4 4 4 4 4 4 0 # unix consensus
syscon misc TOWRITE 2 2 2 2 2 2 2 0 # unix consensus
syscon misc TRANSIENT 4 4 4 4 4 4 4 0 # unix consensus
syscon misc TSGID 0x0400 0x0400 0x0400 0x0400 0x0400 0x0400 0x0400 0 # unix consensus
syscon misc TSUID 0x0800 0x0800 0x0800 0x0800 0x0800 0x0800 0x0800 0 # unix consensus
syscon misc TSVTX 0x0200 0x0200 0x0200 0x0200 0x0200 0x0200 0x0200 0 # unix consensus
syscon misc TUEXEC 0x40 0x40 0x40 0x40 0x40 0x40 0x40 0 # unix consensus
syscon misc TUREAD 0x0100 0x0100 0x0100 0x0100 0x0100 0x0100 0x0100 0 # unix consensus
syscon misc TUWRITE 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0 # unix consensus
syscon misc TVERSLEN 2 2 2 2 2 2 2 0 # unix consensus
syscon misc WORD_BIT 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0 # unix consensus
syscon misc WRQ 2 2 2 2 2 2 2 0 # unix consensus
syscon misc SIGEV_THREAD 2 2 3 3 2 0 2 0
syscon misc SIGEV_SIGNAL 0 0 1 1 1 0 1 0
syscon misc SIGEV_NONE 1 1 0 0 0 0 0 0

syscon misc BC_BASE_MAX 99 99 99 99 99 0x7fffffff 0x7fffffff 0
syscon misc BC_DIM_MAX 0x0800 0x0800 0x0800 0x0800 0x0800 0xffff 0xffff 0
syscon misc BC_SCALE_MAX 99 99 99 99 99 0x7fffffff 0x7fffffff 0
syscon misc BC_STRING_MAX 0x03e8 0x03e8 0x03e8 0x03e8 0x03e8 0x7fffffff 0x7fffffff 0

syscon misc ABORTED_COMMAND 11 11 0 0 0 0 0 0
syscon misc ACORE 0 0 8 8 8 8 8 0 # bsd consensus
syscon misc AFORK 0 0 1 1 1 1 1 0 # bsd consensus
syscon misc AIO_ALLDONE 2 2 1 1 3 0 0 0
syscon misc AIO_NOTCANCELED 1 1 4 4 2 0 0 0
syscon misc AIO_CANCELED 0 0 2 2 1 0 0 0

# baud rates
#
Expand Down
2 changes: 0 additions & 2 deletions libc/sysv/consts/ABORTED_COMMAND.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/ACORE.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/AFORK.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/AIO_ALLDONE.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/AIO_CANCELED.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/AIO_NOTCANCELED.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/BC_BASE_MAX.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/BC_DIM_MAX.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/BC_SCALE_MAX.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/BC_STRING_MAX.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/FIFOTYPE.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/GRPQUOTA.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/IF_NAMESIZE.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/INTERMEDIATE_C_GOOD.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/INTERMEDIATE_GOOD.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/IP6F_MORE_FRAG.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/IP6F_OFF_MASK.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/IP6F_RESERVED_MASK.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/LINE_MAX.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/LINKED_CMD_COMPLETE.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/LINKED_FLG_CMD_COMPLETE.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/LNKTYPE.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/LOCK_UNLOCK_CACHE.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/L_INCR.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/L_SET.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/L_XTND.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/MATH_ERREXCEPT.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/MATH_ERRNO.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/MAXNAMLEN.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/MAXQUOTAS.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/MEDIUM_ERROR.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/MEDIUM_SCAN.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/NBBY.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/NR_DQHASH.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/NR_DQUOTS.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/PERSISTENT_RESERVE_IN.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/PERSISTENT_RESERVE_OUT.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/PRELIM.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/REGTYPE.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/RES_PRF_CLASS.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/RHF_GUARANTEE_START_INIT.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/RHF_NO_LIBRARY_REPLACEMENT.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/RRQ.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/RTF_NOFORWARD.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/RTF_NOPMTUDISC.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/SARMAG.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/SEGSIZE.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/SEND_DIAGNOSTIC.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/SEND_VOLUME_TAG.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/SET_LIMITS.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/SET_WINDOW.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/SFD_CLOEXEC.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/SFD_NONBLOCK.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/SIGEV_NONE.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/SIGEV_SIGNAL.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/SIGEV_THREAD.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/SUBCMDMASK.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/SUBCMDSHIFT.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/SYMTYPE.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/TGEXEC.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/TGREAD.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/TGWRITE.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/TMAGLEN.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/TOEXEC.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/TOREAD.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/TOWRITE.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/TRANSIENT.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/TSGID.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/TSUID.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/TSVTX.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/TUEXEC.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/TUREAD.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/TUWRITE.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/TVERSLEN.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/WORD_BIT.S

This file was deleted.

2 changes: 0 additions & 2 deletions libc/sysv/consts/WRQ.S

This file was deleted.

0 comments on commit 9255113

Please sign in to comment.