-
-
Notifications
You must be signed in to change notification settings - Fork 777
Expand file tree
/
Copy pathconsts.sh
More file actions
executable file
Β·1425 lines (1363 loc) Β· 128 KB
/
Copy pathconsts.sh
File metadata and controls
executable file
Β·1425 lines (1363 loc) Β· 128 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*bin/echo ' -*- mode:sh; indent-tabs-mode:nil; tab-width:8; coding:utf-8 -*-β
β vi: set noet ft=sh ts=8 sts=8 sw=8 fenc=utf-8 :vi β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ‘
β Copyright 2020 Justine Alexandra Roberts Tunney β
β β
β Permission to use, copy, modify, and/or distribute this software for β
β any purpose with or without fee is hereby granted, provided that the β
β above copyright notice and this permission notice appear in all copies. β
β β
β THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL β
β WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED β
β WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE β
β AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL β
β DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR β
β PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER β
β TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR β
β PERFORMANCE OF THIS SOFTWARE. β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ'>/dev/null #*/
dir=libc/sysv/consts
. libc/sysv/gen.sh
# The Fifth Bell System, Community Edition
# Β» catalogue of carnage
# mmap() flags
# the revolutionary praxis of malloc()
#
# group name GNU/Systemd GNU/Systemd (Aarch64) XNU's Not UNIX! MacOS (Arm64) FreeBSD OpenBSD NetBSD The New Technology Commentary
syscon mmap MAP_FILE 0 0 0 0 0 0 0 0 # consensus
syscon mmap MAP_SHARED 1 1 1 1 1 1 1 1 # forced consensus & faked nt
syscon mmap MAP_SHARED_VALIDATE 3 3 1 1 1 1 1 1 # weird linux thing
syscon mmap MAP_PRIVATE 2 2 2 2 2 2 2 2 # forced consensus & faked nt
syscon mmap MAP_TYPE 15 15 15 15 15 15 15 15 # mask for type of mapping
syscon mmap MAP_FIXED 0x00000010 0x00000010 0x00000010 0x00000010 0x00000010 0x00000010 0x00000010 0x00000010 # unix consensus; openbsd appears to forbid; faked nt
syscon mmap MAP_FIXED_NOREPLACE 0x08000000 0x08000000 0x00004000 0x00004000 0x08000000 0x08000000 0x08000000 0x08000000 # handled and defined by cosmo runtime; 0x100000 on linux 4.7+; MAP_FIXED|MAP_EXCL on FreeBSD
syscon mmap MAP_ANONYMOUS 0x00000020 0x00000020 0x00001000 0x00001000 0x00001000 0x00001000 0x00001000 0x00000020 # bsd consensus; faked nt
syscon mmap MAP_LOCKED 0x00002000 0x00002000 0 0 0 0 0 0
syscon mmap MAP_NORESERVE 0x00004000 0x00004000 0x00000040 0x00000040 0 0 0x00000040 0 # Linux calls it "reserve"; NT calls it "commit"? which is default?
syscon mmap MAP_POPULATE 0x00008000 0x00008000 0 0 0x00040000 0 0 0 # MAP_PREFAULT_READ on FreeBSD; can avoid madvise(MADV_WILLNEED) on private file mapping
syscon mmap MAP_NONBLOCK 0x00010000 0x00010000 0 0 0 0 0 0
syscon mmap MAP_SYNC 0x00080000 0x00080000 0 0 0 0 0 0 # perform synchronous page faults for mapping (Linux 4.15+)
syscon mmap MAP_HUGETLB 0x00040000 -1 -1 -1 -1 -1 -1 -1 # make it inherit across execve()
syscon mmap MAP_INHERIT -1 -1 -1 -1 -1 -1 0x00000080 -1 # make it inherit across execve()
syscon mmap MAP_HASSEMAPHORE 0 0 0x00000200 0x00000200 0x00000200 0 0x00000200 0 # does it matter on x86?
syscon mmap MAP_NOSYNC 0 0 0 0 0x00000800 0 0 0 # flush to physical media only when necessary rather than gratuitously; be sure to use write() rather than ftruncate() with this!
syscon mmap MAP_CONCEAL 0 0 0 0 0x00020000 0x00008000 0x00008000 0 # omit from core dumps; MAP_NOCORE on FreeBSD
syscon mmap MAP_JIT 0 0 0 0x00000800 0 0 0 0 # allocate region used for just-in-time compilation
syscon mmap MAP_NOCACHE 0 0 0x00000400 0x00000400 0 0 0 0 # don't cache pages for this mapping
syscon mmap MAP_NOEXTEND 0 0 0x00000100 0x00000100 0 0 0 0 # for MAP_FILE, don't change file size
syscon compat MAP_NOCORE 0 0 0 0 0x00020000 0x00008000 0x00008000 0 # use MAP_CONCEAL
syscon compat MAP_ANON 0x00000020 0x00000020 0x00001000 0x00001000 0x00001000 0x00001000 0x00001000 0x00000020 # bsd consensus; faked nt
syscon compat MAP_EXECUTABLE 0x00001000 0x00001000 0 0 0 0 0 0 # ignored
syscon compat MAP_DENYWRITE 0x00000800 0x00000800 0 0 0 0 0 0
syscon compat MAP_32BIT 0x00000040 0x00000040 0 0x00008000 0x00080000 0 0 0 # iffy
# mmap(), mprotect(), etc.
# digital restrictions management for the people
#
# group name GNU/Systemd GNU/Systemd (Aarch64) XNU's Not UNIX! MacOS (Arm64) FreeBSD OpenBSD NetBSD The New Technology Commentary
syscon mprot PROT_GUARD 0 0 0 0 0 0 0 0x100 # mmap, mprotect, unix consensus
# sigprocmask() flags
#
# group name GNU/Systemd GNU/Systemd (Aarch64) XNU's Not UNIX! MacOS (Arm64) FreeBSD OpenBSD NetBSD The New Technology Commentary
syscon misc SIG_BLOCK 0 0 1 1 1 1 1 0 # bsd consensus; faked nt
syscon misc SIG_UNBLOCK 1 1 2 2 2 2 2 1 # bsd consensus; faked nt
syscon misc SIG_SETMASK 2 2 3 3 3 3 3 2 # bsd consensus; faked nt
# lseek() whence
#
# group name GNU/Systemd GNU/Systemd (Aarch64) XNU's Not UNIX! MacOS (Arm64) FreeBSD OpenBSD NetBSD The New Technology Commentary
syscon splice SEEK_HOLE 4 4 3 3 4 -1 -1 -1 #
syscon splice SEEK_DATA 3 3 4 4 3 -1 -1 -1 #
# splice() flags
#
# group name GNU/Systemd GNU/Systemd (Aarch64) XNU's Not UNIX! MacOS (Arm64) FreeBSD OpenBSD NetBSD The New Technology Commentary
syscon splice SPLICE_F_MOVE 1 1 0 0 0 0 0 0 # can be safely ignored by polyfill; it's a hint
syscon splice SPLICE_F_NONBLOCK 2 2 0 0 0 0 0 0 # can be safely ignored by polyfill, since linux says it doesn't apply to underlying FDs
syscon splice SPLICE_F_MORE 4 4 0 0 0 0 0 0 # can be safely ignored by polyfill; it's a hint
syscon splice SPLICE_F_GIFT 8 8 0 0 0 0 0 0 # can probably be ignored by polyfill
# flock() flags
#
# group name GNU/Systemd GNU/Systemd (Aarch64) XNU's Not UNIX! MacOS (Arm64) FreeBSD OpenBSD NetBSD The New Technology Commentary
syscon lock LOCK_SH 1 1 1 1 1 1 1 0 # shared [unix consensus]; hard-coded into flock-nt.c too
syscon lock LOCK_EX 2 2 2 2 2 2 2 2 # exclusive [consensus!] a.k.a. kNtLockfileExclusiveLock
syscon lock LOCK_NB 4 4 4 4 4 4 4 1 # non-blocking [unix consensus] a.k.a. kNtLockfileFailImmediately
syscon lock LOCK_UN 8 8 8 8 8 8 8 8 # unlock [unix consensus & faked NT]; hard-coded into flock-nt.c too
# waitpid() / wait4() options
#
# group name GNU/Systemd GNU/Systemd (Aarch64) XNU's Not UNIX! MacOS (Arm64) FreeBSD OpenBSD NetBSD The New Technology Commentary
syscon waitpid WCONTINUED 8 8 0x10 0x10 4 8 16 8 #
# waitid() options
# no dice on openbsd >:\
#
# group name GNU/Systemd GNU/Systemd (Aarch64) XNU's Not UNIX! MacOS (Arm64) FreeBSD OpenBSD NetBSD The New Technology Commentary
syscon waitid WEXITED 4 4 4 4 0x10 0 32 0
syscon waitid WSTOPPED 2 2 8 8 2 0 2 0
syscon waitid WNOWAIT 0x01000000 0x01000000 0x20 0x20 8 0 0x10000 0
# fcntl() POSIX Advisory Locks
#
# group name GNU/Systemd GNU/Systemd (Aarch64) XNU's Not UNIX! MacOS (Arm64) FreeBSD OpenBSD NetBSD The New Technology Commentary
syscon fcntl F_SETLK 6 6 8 8 12 8 8 6 # polyfilled nt
syscon fcntl F_SETLKW 7 7 9 9 13 9 9 7 # polyfilled nt
syscon fcntl F_GETLK 5 5 7 7 11 7 7 5 # polyfilled nt
syscon fcntl F_RDLCK 0 0 1 1 1 1 1 0 # polyfilled nt; bsd consensus
syscon fcntl F_WRLCK 1 1 3 3 3 3 3 1 # polyfilled nt; bsd consensus
# openat(), fstatat(), linkat(), etc. magnums
#
# group name GNU/Systemd GNU/Systemd (Aarch64) XNU's Not UNIX! MacOS (Arm64) FreeBSD OpenBSD NetBSD The New Technology Commentary
syscon at AT_FDCWD -100 -100 -2 -2 -100 -100 -100 -100 # faked nt
syscon at AT_SYMLINK_NOFOLLOW 0x0100 0x0100 0x20 0x20 0x0200 2 0x200 0x0100 # faked nt
syscon at AT_SYMLINK_FOLLOW 0x0400 0x0400 0x40 0x40 0x0400 4 0x400 0x0400 # see linkat(2)
syscon at AT_REMOVEDIR 0x0200 0x0200 0x80 0x80 0x0800 8 0x800 0x0200 # faked nt
syscon at AT_EACCESS 0x0200 0x0200 0x10 0x10 0x0100 1 0x100 0 # performs check using effective uid/gid; unnecessary nt
# utimensat() special values
#
# group name GNU/Systemd GNU/Systemd (Aarch64) XNU's Not UNIX! MacOS (Arm64) FreeBSD OpenBSD NetBSD The New Technology Commentary
syscon utime UTIME_NOW 0x3fffffff 0x3fffffff -1 -1 -1 -2 0x3fffffff -2 # timespec::tv_sec may be this; polyfilled xnu/nt
syscon utime UTIME_OMIT 0x3ffffffe 0x3ffffffe -2 -2 -2 -1 0x3ffffffe -1 # timespec::tv_nsec may be this; polyfilled xnu/nt
# getauxval() keys
# libc/sysv/consts/auxv.h
#
# group name GNU/Systemd GNU/Systemd (Aarch64) XNU's Not UNIX! MacOS (Arm64) FreeBSD OpenBSD NetBSD The New Technology Commentary
syscon auxv AT_EXECFN 31 31 31 31 15 31 2014 31 # address of string containing first argument passed to execve() used when running program; AT_EXECPATH on FreeBSD
syscon auxv AT_SECURE 23 23 23 23 0 23 0 23
syscon auxv AT_RANDOM 25 25 25 25 16 25 0 25 # address of sixteen bytes of random data; AT_CANARY on FreeBSD whose AT_CANARYLEN should be 64
syscon auxv AT_HWCAP 16 16 16 16 25 16 0 16
syscon auxv AT_HWCAP2 26 26 26 26 26 26 0 26
syscon auxv AT_UID 11 11 11 11 0 11 2001 11
syscon auxv AT_EUID 12 12 12 12 0 12 2000 12
syscon auxv AT_GID 13 13 13 13 0 13 2003 13
syscon auxv AT_EGID 14 14 14 14 0 14 2002 14
syscon auxv AT_EXECFD 2 2 0 0 2 2 2 2 # file descriptor of program
syscon auxv AT_NOTELF 10 10 0 0 10 10 0 10
syscon auxv AT_OSRELDATE 0 0 0 0 18 0 0 0
syscon auxv AT_PLATFORM 15 15 0 0 0 15 0 15 # address of string with hardware platform for rpath interpretation
syscon auxv AT_CLKTCK 17 17 0 0 0 17 0 17
syscon auxv AT_DCACHEBSIZE 19 19 0 0 0 19 0 19
syscon auxv AT_ICACHEBSIZE 20 20 0 0 0 20 0 20
syscon auxv AT_UCACHEBSIZE 21 21 0 0 0 21 0 21
syscon auxv AT_BASE_PLATFORM 24 24 0 0 0 24 0 24
syscon auxv AT_SYSINFO_EHDR 33 33 0 0 0 33 0 33
syscon auxv AT_STACKBASE 0 0 0 0 0 0 13 0
syscon auxv AT_EXECPATH 31 31 31 31 15 31 2014 31 # FreeBSD name for AT_EXECFN
syscon auxv AT_MINSIGSTKSZ 51 51 0 0 0 51 0 51 # FreeBSD name for AT_EXECFN
syscon auxv AT_CANARY 0 0 0 0 16 0 0 0
syscon auxv AT_CANARYLEN 0 0 0 0 17 0 0 0
syscon auxv AT_NCPUS 0 0 0 0 19 0 0 0
syscon auxv AT_PAGESIZES 0 0 0 0 20 0 0 0
syscon auxv AT_PAGESIZESLEN 0 0 0 0 21 0 0 0
syscon auxv AT_TIMEKEEP 0 0 0 0 22 0 0 0
syscon auxv AT_STACKPROT 0 0 0 0 23 0 0 0
syscon auxv AT_EHDRFLAGS 0 0 0 0 24 0 0 0
syscon auxv AT_NO_AUTOMOUNT 0x0800 0x0800 0 0 0 0x0800 0 0x0800
# sigaction() codes
#
# group name GNU/Systemd GNU/Systemd (Aarch64) XNU's Not UNIX! MacOS (Arm64) FreeBSD OpenBSD NetBSD The New Technology Commentary
syscon sigact SA_NOCLDSTOP 1 1 8 8 8 8 8 1 # lets you set SIGCHLD handler that's only notified on exit/termination and not notified on SIGSTOP/SIGTSTP/SIGTTIN/SIGTTOU/SIGCONT lool; bsd consensus
syscon sigact SA_NOCLDWAIT 2 2 32 32 32 32 32 2 # changes SIGCHLD so the zombie is gone and you can't call wait(2) anymore; similar to SIGCHLD+SIG_IGN but may still deliver the SIGCHLD; bsd consensus
syscon sigact SA_SIGINFO 4 4 64 64 64 64 64 4 # asks kernel to provide ucontext_t argument, which has mutable cpu/fpu state of signalled process; and it is polyfilled by cosmopolitan; bsd consensus
syscon sigact SA_ONSTACK 0x08000000 0x08000000 1 1 1 1 1 0x08000000 # causes signal handler to be called on stack provided by sigaltstack(2); bsd consensus
syscon sigact SA_RESTART 0x10000000 0x10000000 2 2 2 2 2 0x10000000 # prevents signal delivery from triggering EINTR on i/o calls (e.g. read/write/open/wait/accept) but doesn't impact non-i/o blocking calls (e.g. poll, sigsuspend, nanosleep) which will still EINTR; bsd consensus
syscon sigact SA_NODEFER 0x40000000 0x40000000 16 16 16 16 16 0x40000000 # lets signal handler be reentrant (e.g. so you can longjmp() out of signal handler); bsd consensus
syscon sigact SA_RESETHAND 0x80000000 0x80000000 4 4 4 4 4 0x80000000 # causes signal handler to be called at most once and then set to SIG_DFL automatically; bsd consensus
# siginfo::si_code values
#
# The New Technology NT is polyfilled as Linux.
# Unsupported values are encoded as 0x80000000.
#
# NOTE: Some of these Windows constants are duplicated in sigcrashsig.c
#
# group name GNU/Systemd GNU/Systemd (Aarch64) XNU's Not UNIX! MacOS (Arm64) FreeBSD OpenBSD NetBSD The New Technology Commentary
syscon sicode SI_USER 0 0 0x010001 0x010001 0x010001 0 0 0 # sent by kill(2); openbsd defines si_code<=0 as originating from user
syscon sicode SI_QUEUE -1 -1 0x010002 0x010002 0x010002 -2 -1 -1 # sent by sigqueue(2)
syscon sicode SI_TIMER -2 -2 0x010003 0x010003 0x010003 -3 -2 -2 # sent by setitimer(2) or clock_settime(2)
syscon sicode SI_TKILL -6 -6 0x80000000 0x80000000 0x010007 -1 -5 -6 # sent by tkill(2) or tgkill(2) or thr_kill(2) or lwp_kill(2) or _lwp_kill(2); cries
syscon sicode SI_MESGQ -3 -3 0x010005 0x010005 0x010005 0x80000000 -4 -3 # sent by mq_notify(2); lool
syscon sicode SI_ASYNCIO -4 -4 0x010004 0x010004 0x010004 0x80000000 -3 -4 # aio completion; no thank you
syscon sicode SI_ASYNCNL -60 -60 0x80000000 0x80000000 0x80000000 0x80000000 0x80000000 0x80000000 # aio completion for dns; the horror
syscon sicode SI_KERNEL 128 128 0x80000000 0x80000000 0x010006 0x80000000 0x80000000 0x80 # wut; openbsd defines as si_code>0
syscon sicode SI_NOINFO 32767 32767 0x80000000 0x80000000 0 32767 32767 32767 # no signal specific info available
syscon sicode CLD_EXITED 1 1 1 1 1 1 1 1 # SIGCHLD; child exited; unix consensus
syscon sicode CLD_KILLED 2 2 2 2 2 2 2 2 # SIGCHLD; child terminated w/o core; unix consensus
syscon sicode CLD_DUMPED 3 3 3 3 3 3 3 3 # SIGCHLD; child terminated w/ core; unix consensus
syscon sicode CLD_TRAPPED 4 4 4 4 4 4 4 4 # SIGCHLD; traced child trapped; unix consensus
syscon sicode CLD_STOPPED 5 5 5 5 5 5 5 5 # SIGCHLD; child stopped; unix consensus
syscon sicode CLD_CONTINUED 6 6 6 6 6 6 6 6 # SIGCHLD; stopped child continued; unix consensus
syscon sicode TRAP_BRKPT 1 1 1 1 1 1 1 1 # SIGTRAP; process breakpoint; unix consensus
syscon sicode TRAP_TRACE 2 2 2 2 2 2 2 2 # SIGTRAP; process trace trap; unix consensus
syscon sicode SEGV_MAPERR 1 1 1 1 1 1 1 1 # SIGSEGV; address not mapped to object; unix consensus
syscon sicode SEGV_ACCERR 2 2 2 2 2 2 2 2 # SIGSEGV; invalid permissions for mapped object; unix consensus
syscon sicode SEGV_PKUERR -1 -1 -1 -1 100 -1 -1 -1 # SIGSEGV: x86: PKU violation
syscon sicode FPE_INTDIV 1 1 7 7 2 1 1 1 # SIGFPE; integer divide by zero
syscon sicode FPE_INTOVF 2 2 8 8 1 2 2 2 # SIGFPE; integer overflow
syscon sicode FPE_FLTDIV 3 3 1 1 3 3 3 3 # SIGFPE; floating point divide by zero
syscon sicode FPE_FLTOVF 4 4 2 2 4 4 4 4 # SIGFPE; floating point overflow
syscon sicode FPE_FLTUND 5 5 3 3 5 5 5 5 # SIGFPE; floating point underflow
syscon sicode FPE_FLTRES 6 6 4 4 6 6 6 6 # SIGFPE; floating point inexact
syscon sicode FPE_FLTINV 7 7 5 5 7 7 7 7 # SIGFPE; invalid floating point operation
syscon sicode FPE_FLTSUB 8 8 6 6 8 8 8 8 # SIGFPE; subscript out of range
syscon sicode ILL_ILLOPC 1 1 1 1 1 1 1 1 # SIGILL; illegal opcode; unix consensus
syscon sicode ILL_ILLOPN 2 2 4 4 2 2 2 2 # SIGILL; illegal operand
syscon sicode ILL_ILLADR 3 3 5 5 3 3 3 3 # SIGILL; illegal addressing mode
syscon sicode ILL_ILLTRP 4 4 2 2 4 4 4 4 # SIGILL; illegal trap
syscon sicode ILL_PRVOPC 5 5 3 3 5 5 5 5 # SIGILL; privileged opcode
syscon sicode ILL_PRVREG 6 6 6 6 6 6 6 6 # SIGILL; privileged register; unix consensus
syscon sicode ILL_COPROC 7 7 7 7 7 7 7 7 # SIGILL; coprocessor error; unix consensus
syscon sicode ILL_BADSTK 8 8 8 8 8 8 8 8 # SIGILL; internal stack error; unix consensus
syscon sicode BUS_ADRALN 1 1 1 1 1 1 1 1 # SIGBUS; invalid address alignment; unix consensus
syscon sicode BUS_ADRERR 2 2 2 2 2 2 2 2 # SIGBUS; non-existent physical address; unix consensus
syscon sicode BUS_OBJERR 3 3 3 3 3 3 3 3 # SIGBUS; object specific hardware error; unix consensus
syscon sicode BUS_OOMERR -1 -1 -1 -1 100 -1 -1 -1 # SIGBUS; Non-standard: No memory.
syscon sicode BUS_MCEERR_AR 4 4 0x80000000 0x80000000 0x80000000 0x80000000 0x80000000 0x80000000 # SIGBUS; Linux 2.6.32+
syscon sicode BUS_MCEERR_AO 5 5 0x80000000 0x80000000 0x80000000 0x80000000 0x80000000 0x80000000 # SIGBUS; Linux 2.6.32+
syscon sicode POLL_IN 1 1 1 1 1 1 1 1 # SIGIO; data input available; unix consensus
syscon sicode POLL_OUT 2 2 2 2 2 2 2 2 # SIGIO; output buffer available; unix consensus
syscon sicode POLL_MSG 3 3 3 3 3 3 3 3 # SIGIO; input message available; unix consensus
syscon sicode POLL_ERR 4 4 4 4 4 4 4 4 # SIGIO; i/o error; unix consensus
syscon sicode POLL_PRI 5 5 5 5 5 5 5 5 # SIGIO; high priority input available; unix consensus
syscon sicode POLL_HUP 6 6 6 6 6 6 6 6 # SIGIO; device disconnected; unix consensus
syscon sicode SYS_SECCOMP 1 1 -1 -1 -1 -1 -1 -1 # SIGSYS; seccomp triggered
syscon sicode SYS_USER_DISPATCH 2 2 -1 -1 -1 -1 -1 -1 # SIGSYS; syscall user dispatch triggered
# sigaltstack() values
#
# group name GNU/Systemd GNU/Systemd (Aarch64) XNU's Not UNIX! MacOS (Arm64) FreeBSD OpenBSD NetBSD The New Technology Commentary
syscon ss SS_ONSTACK 1 1 1 1 1 1 1 1 # unix consensus
syscon ss SS_DISABLE 2 2 4 4 4 4 4 2 # bsd consensus
# close_range() values
#
# group name GNU/Systemd GNU/Systemd (Aarch64) XNU's Not UNIX! MacOS (Arm64) FreeBSD OpenBSD NetBSD The New Technology Commentary
syscon close CLOSE_RANGE_UNSHARE 2 2 -1 -1 -1 -1 -1 -1 #
syscon close CLOSE_RANGE_CLOEXEC 4 4 -1 -1 -1 -1 -1 -1 #
# clock_{gettime,settime} timers
#
# Executive Summary
# - CLOCK_MONOTONIC shouldn't count suspended time
# - CLOCK_BOOTTIME is monotonic and should count suspended time
# - Only CLOCK_REALTIME and CLOCK_MONOTONIC can be used with futexes
# - CLOCK_MONOTONIC_RAW should fail with EINVAL if host lacks support
# - CLOCK_MONOTONIC and CLOCK_BOOTTIME should be relative to system boot time
# - COARSE can be CLK_TCK behind (~20ms) and will EINVAL on RHEL5 which isn't worth polyfilling
#
# FreeBSD defines the following rosetta stone
# Taken from freebsd/sys/compat/linux/linux_time.c
# - Linux CLOCK_MONOTONIC -> FreeBSD CLOCK_UPTIME [5]
# - Linux CLOCK_MONOTONIC_RAW -> FreeBSD CLOCK_UPTIME [5]
# - Linux CLOCK_REALTIME_COARSE -> FreeBSD CLOCK_REALTIME_FAST [10]
# - Linux CLOCK_MONOTONIC_COARSE -> FreeBSD CLOCK_UPTIME_FAST [8]
# - Linux CLOCK_BOOTTIME -> FreeBSD CLOCK_MONOTONIC [4]
#
# For MacOS we define the following mappings
# - Linux CLOCK_MONOTONIC -> MacOS CLOCK_UPTIME_RAW [8]
# - Linux CLOCK_MONOTONIC_RAW -> MacOS CLOCK_UPTIME_RAW [8]
# - Linux CLOCK_REALTIME_COARSE -> MacOS CLOCK_REALTIME [0]
# - Linux CLOCK_MONOTONIC_COARSE -> MacOS CLOCK_UPTIME_RAW_APPROX [9]
# - Linux CLOCK_BOOTTIME -> MacOS CLOCK_MONOTONIC [6]
#
# For OpenBSD we define the following mappings
# - Linux CLOCK_MONOTONIC -> OpenBSD CLOCK_UPTIME [5]
# - Linux CLOCK_MONOTONIC_RAW -> EINVAL because OpenBSD ntpd can adjfreq(2)
# - Linux CLOCK_REALTIME_COARSE -> OpenBSD CLOCK_REALTIME [0]
# - Linux CLOCK_MONOTONIC_COARSE -> OpenBSD CLOCK_UPTIME [5]
# - Linux CLOCK_BOOTTIME -> OpenBSD CLOCK_MONOTONIC [3]
#
# For NetBSD we define the following mappings
# - Linux CLOCK_MONOTONIC -> NetBSD CLOCK_MONOTONIC [3] TODO: suspend?
# - Linux CLOCK_MONOTONIC_RAW -> NetBSD CLOCK_MONOTONIC [3] NetBSD clock_gettime(2) says it isn't impacted by adjfreq(2)
# - Linux CLOCK_REALTIME_COARSE -> NetBSD CLOCK_REALTIME [0]
# - Linux CLOCK_MONOTONIC_COARSE -> NetBSD CLOCK_MONOTONIC [3]
# - Linux CLOCK_BOOTTIME -> NetBSD CLOCK_MONOTONIC [3] TODO: suspend?
#
# For Windows we define the following mappings
# - Linux CLOCK_REALTIME -> GetSystemTimePreciseAsFileTime()
# - Linux CLOCK_MONOTONIC -> QueryUnbiasedInterruptTimePrecise()
# - Linux CLOCK_MONOTONIC_RAW -> QueryUnbiasedInterruptTimePrecise()
# - Linux CLOCK_REALTIME_COARSE -> GetSystemTimeAsFileTime()
# - Linux CLOCK_MONOTONIC_COARSE -> QueryUnbiasedInterruptTime()
# - Linux CLOCK_BOOTTIME -> QueryInterruptTimePrecise()
#
# group name GNU/Systemd GNU/Systemd (Aarch64) XNU's Not UNIX! MacOS (Arm64) FreeBSD OpenBSD NetBSD The New Technology Commentary
syscon clock CLOCK_REALTIME 0 0 0 0 0 0 0 0 #
syscon clock CLOCK_MONOTONIC 1 1 8 8 5 5 3 1 #
syscon clock CLOCK_PROCESS_CPUTIME_ID 2 2 12 12 15 2 0x40000000 4 #
syscon clock CLOCK_THREAD_CPUTIME_ID 3 3 16 16 14 4 0x20000000 5 #
syscon clock CLOCK_MONOTONIC_RAW 4 4 127 8 5 127 3 1 # Linux 2.6.28+
syscon clock CLOCK_REALTIME_COARSE 5 5 0 0 10 0 0 2 # Linux 2.6.32+
syscon clock CLOCK_MONOTONIC_COARSE 6 6 9 9 8 5 3 6 # Linux 2.6.32+
syscon clock CLOCK_BOOTTIME 7 7 6 6 4 3 3 3 # Linux 2.6.39+
# poll()
#
# group name GNU/Systemd GNU/Systemd (Aarch64) XNU's Not UNIX! MacOS (Arm64) FreeBSD OpenBSD NetBSD The New Technology Commentary
syscon poll POLLIN 1 1 1 1 1 1 1 0x0300 # unix consensus; POLLRDNORM|POLLRDBAND on Windows
syscon poll POLLPRI 2 2 2 2 2 2 2 0x0400 # unix consensus
syscon poll POLLOUT 4 4 4 4 4 4 4 0x0010 # unix consensus; POLLWRNORM on Windows
syscon poll POLLERR 8 8 8 8 8 8 8 0x0001 # unix consensus
syscon poll POLLHUP 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x0002 # unix consensus
syscon poll POLLNVAL 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x0004 # unix consensus
syscon poll POLLRDBAND 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x0200 # unix consensus
syscon poll POLLRDNORM 0x40 0x40 0x40 0x40 0x40 0x40 0x40 0x0100 # unix consensus
syscon poll POLLWRBAND 0x0200 0x0200 0x0100 0x0100 0x0100 0x0100 0x0100 0x0020 # bsd consensus
syscon poll POLLWRNORM 0x0100 0x0100 4 4 4 4 4 0x0010 # bsd consensus
syscon poll POLLRDHUP 0x2000 0x2000 0x10 0x10 0x10 0x10 0x10 2 # bsd consensus (POLLHUP on non-Linux)
# {set,get}sockopt(fd, level=SOL_SOCKET, X, ...)
#
# Unsupported magic numbers are set to zero.
#
# group name GNU/Systemd GNU/Systemd (Aarch64) XNU's Not UNIX! MacOS (Arm64) FreeBSD OpenBSD NetBSD The New Technology Commentary
syscon so SOL_SOCKET 1 1 0xffff 0xffff 0xffff 0xffff 0xffff 0xffff # yes it's actually 0xffff; bsd+nt consensus (todo: what's up with ipproto_icmp overlap)
syscon so SO_DEBUG 1 1 1 1 1 1 1 1 # debugging is enabled; consensus
syscon so SO_TYPE 3 3 0x1008 0x1008 0x1008 0x1008 0x1008 0x1008 # bsd consensus
syscon so SO_ERROR 4 4 0x1007 0x1007 0x1007 0x1007 0x1007 0x1007 # takes int pointer and stores/clears the pending error code; bsd consensus
syscon so SO_ACCEPTCONN 30 30 2 2 2 2 2 2 # takes int pointer and stores boolean indicating if listen() was called on fd; bsd consensus
syscon so SO_REUSEPORT 15 15 512 512 512 512 512 0 # bsd consensus; no windows support
syscon so SO_REUSEADDR 2 2 4 4 4 4 4 -5 # SO_EXCLUSIVEADDRUSE on Windows (see third_party/python/Lib/test/support/__init__.py)
syscon so SO_KEEPALIVE 9 9 8 8 8 8 8 8 # bsd consensus
syscon so SO_DONTROUTE 5 5 16 16 16 16 16 16 # bsd consensus
syscon so SO_BROADCAST 6 6 32 32 32 32 32 32 # socket is configured for broadcast messages; bsd consensus
syscon so SO_USELOOPBACK 0 0 64 64 64 64 64 64 # bsd consensus
syscon so SO_LINGER 13 13 4224 4224 128 128 128 128 # takes struct linger; causes close() return value to actually mean something; SO_LINGER_SEC on XNU; bsd consensus
syscon so SO_OOBINLINE 10 10 256 256 256 256 256 256 # bsd consensus
syscon so SO_SNDBUF 7 7 0x1001 0x1001 0x1001 0x1001 0x1001 0x1001 # bsd consensus
syscon so SO_RCVBUF 8 8 0x1002 0x1002 0x1002 0x1002 0x1002 0x1002 # bsd consensus
syscon so SO_RCVTIMEO 20 20 0x1006 0x1006 0x1006 0x1006 0x100c 0x1006 # recv timeout; takes struct timeval (overrides SA_RESTART restoring EINTR behavior on recv/send/connect/accept/etc.; bsd consensus)
syscon so SO_SNDTIMEO 21 21 0x1005 0x1005 0x1005 0x1005 0x100b 0x1005 # send timeout; takes struct timeval; bsd consensus
syscon so SO_RCVLOWAT 18 18 0x1004 0x1004 0x1004 0x1004 0x1004 0x1004 # bsd consensus
syscon so SO_SNDLOWAT 19 19 0x1003 0x1003 0x1003 0x1003 0x1003 0x1003 # bsd consensus
# {set,get}sockopt(fd, level=SOL_TCP, X, ...)
# Β» most elite of all tuning groups
#
# @see https://www.kernel.org/doc/Documentation/networking/ip-sysctl.txt
# @see https://www.iana.org/assignments/tcp-parameters/tcp-parameters.txt
#
# group name GNU/Systemd GNU/Systemd (Aarch64) XNU's Not UNIX! MacOS (Arm64) FreeBSD OpenBSD NetBSD The New Technology Commentary
syscon tcp TCP_NODELAY 1 1 1 1 1 1 1 1 # strong consensus for disabling nagle's algorithm; so be sure to disable it by turning this on
syscon tcp TCP_CORK 3 3 4 4 4 16 4 0 # nagle's algorithm strikes again; TCP_NOPUSH on BSD; be sure to turn it off; protip: mmap+writev vs. write+sendfile; see also /proc/sys/net/ipv4/tcp_autocorking; netbsd is 4 but not implemented
syscon tcp TCP_MAXSEG 2 2 2 2 2 2 2 0 # reduces tcp segment size; see also tcp offloading
syscon tcp TCP_FASTOPEN 23 23 0x105 0x105 0x0401 0 0 15 # reduces roundtrips; for listener; Linux 3.7+ (c. 2012) / or is windows it 0x22? /proc/sys/net/ipv4/tcp_fastopen TODO(jart): MSG_FASTOPEN; XNU sources say 261 but not sure if that's true
syscon tcp TCP_FASTOPEN_CONNECT 30 30 0 0 0 0 0 0 # reduces roundtrips; for listener; Linux 3.7+ (c. 2012) / or is windows it 0x22? /proc/sys/net/ipv4/tcp_fastopen TODO(jart): MSG_FASTOPEN; XNU sources say 261 but not sure if that's true
syscon tcp TCP_KEEPIDLE 4 4 0 0 0x100 0 3 3 # start keepalives after this period
syscon tcp TCP_KEEPINTVL 5 5 0x101 0x101 0x200 0 5 17 # interval between keepalives
syscon tcp TCP_KEEPCNT 6 6 0x102 0x102 0x400 0 6 16 # number of keepalives before death
syscon tcp TCP_INFO 11 11 0x200 0x200 32 9 9 0 # get connection info
syscon tcp TCP_NOTSENT_LOWAT 25 25 513 513 0 0 0 0 # limit unset byte queue
syscon tcp TCP_MD5SIG 14 14 0 0 16 4 16 0 # what is it (rfc2385)
syscon tcp TCP_CONGESTION 13 13 0 0 64 0 0 0 # set traffic control
syscon tcp TCP_SYNCNT 7 7 0 0 0 0 0 0 # how hard to syn packet the enemy
syscon tcp TCP_ULP 31 31 0 0 0 0 0 0 # setsockopt(sock, IPPROTO_TCP, TCP_ULP, "tls", 4)
syscon tcp TCP_COOKIE_TRANSACTIONS 15 15 0 0 0 0 0 0 # defense against the syn packets
syscon tcp TCP_LINGER2 8 8 0 0 0 0 0 0 # orphaned fin-wait-2 lifetime cf. net.ipv4.tcp_fin_timeout see cloudflare blog
syscon tcp TCP_CC_INFO 26 26 0 0 0 0 0 0 # get congestion control info
syscon tcp TCP_MD5SIG_MAXKEYLEN 80 80 0 0 0 0 0 0 # what is it
syscon tcp TCP_TIMESTAMP 24 24 0 0 0 0 0 0 # what is it
syscon tcp TCP_USER_TIMEOUT 18 18 0 0 0 0 0 0 # what is it
syscon tcp TCP_QUICKACK 12 12 0 0 0 0 0 0 # disables optimization that lets kernel merge response data into ack packets
syscon tcp TCP_SAVE_SYN 27 27 0 0 0 0 0 0 # record syn packets
syscon tcp TCP_SAVED_SYN 28 28 0 0 0 0 0 0 # get recorded syn packets
syscon tcp TCP_THIN_DUPACK 17 17 0 0 0 0 0 0 # what is it
syscon tcp TCP_QUEUE_SEQ 21 21 0 0 0 0 0 0 # what is it
syscon tcp TCP_WINDOW_CLAMP 10 10 0 0 0 0 0 0 # what is it
syscon tcp TCP_DEFER_ACCEPT 9 9 0 0 0 0 0 0 # defer accept() until readable data has arrived
syscon tcp TCP_REPAIR 19 19 0 0 0 0 0 0 # what is it
syscon tcp TCP_REPAIR_OPTIONS 22 22 0 0 0 0 0 0 # what is it
syscon tcp TCP_REPAIR_QUEUE 20 20 0 0 0 0 0 0 # what is it
syscon tcp TCP_THIN_LINEAR_TIMEOUTS 16 16 0 0 0 0 0 0 # what is it
# IPPROTO_IP (or SOL_IP) socket options
#
# group name GNU/Systemd GNU/Systemd (Aarch64) XNU's Not UNIX! MacOS (Arm64) FreeBSD OpenBSD NetBSD The New Technology Commentary
syscon ip IP_TOS 1 1 3 3 3 3 3 3 # bsd consensus
syscon ip IP_TTL 2 2 4 4 4 4 4 4 # bsd consensus
syscon ip IP_MTU 14 14 0 0 0 0 0 73 # bsd consensus
syscon ip IP_HDRINCL 3 3 2 2 2 2 2 2 # bsd consensus
syscon ip IP_OPTIONS 4 4 1 1 1 1 1 1 # bsd consensus
syscon ip IP_RECVTTL 12 12 24 24 65 31 23 21
syscon ip IP_ADD_MEMBERSHIP 35 35 12 12 12 12 12 12 # bsd consensus
syscon ip IP_DROP_MEMBERSHIP 36 36 13 13 13 13 13 13 # bsd consensus
syscon ip IP_MULTICAST_IF 32 32 9 9 9 9 9 9 # bsd consensus
syscon ip IP_MULTICAST_LOOP 34 34 11 11 11 11 11 11 # bsd consensus
syscon ip IP_MULTICAST_TTL 33 33 10 10 10 10 10 10 # bsd consensus
syscon ip IP_PKTINFO 8 8 26 26 0 0 25 19
syscon ip IP_RECVTOS 13 13 0 0 68 0 0 40
# IPPROTO_IPV6 (or SOL_IPV6) socket options
#
# group name GNU/Systemd GNU/Systemd (Aarch64) XNU's Not UNIX! MacOS (Arm64) FreeBSD OpenBSD NetBSD The New Technology Commentary
syscon ipv6 IPV6_V6ONLY 26 26 27 27 27 27 27 27 # bsd consensus
syscon ipv6 IPV6_CHECKSUM 7 7 26 26 26 26 26 26 # bsd consensus
syscon ipv6 IPV6_JOIN_GROUP 20 20 12 12 12 12 12 12 # bsd consensus
syscon ipv6 IPV6_LEAVE_GROUP 21 21 13 13 13 13 13 13 # bsd consensus
syscon ipv6 IPV6_MULTICAST_HOPS 18 18 10 10 10 10 10 10 # bsd consensus
syscon ipv6 IPV6_MULTICAST_IF 17 17 9 9 9 9 9 9 # bsd consensus
syscon ipv6 IPV6_MULTICAST_LOOP 19 19 11 11 11 11 11 11 # bsd consensus
syscon ipv6 IPV6_UNICAST_HOPS 16 16 4 4 4 4 4 4 # bsd consensus
syscon ipv6 IPV6_RECVTCLASS 66 66 35 35 57 57 57 40
syscon ipv6 IPV6_TCLASS 67 67 36 36 61 61 61 39
syscon ipv6 IPV6_DONTFRAG 62 62 0 0 62 62 62 14
syscon ipv6 IPV6_HOPLIMIT 52 52 0 0 47 47 47 21
syscon ipv6 IPV6_HOPOPTS 54 54 0 0 49 49 49 1
syscon ipv6 IPV6_PKTINFO 50 50 0 0 46 46 46 19
syscon ipv6 IPV6_RECVRTHDR 56 56 0 0 38 38 38 38
syscon ipv6 IPV6_RTHDR 57 57 0 0 51 51 51 32
# IPPROTO_ICMPV6 (or SOL_ICMPV6) socket options
#
# group name GNU/Systemd GNU/Systemd (Aarch64) XNU's Not UNIX! MacOS (Arm64) FreeBSD OpenBSD NetBSD The New Technology Commentary
syscon icmp6 ICMP6_DST_UNREACH_NOROUTE 0 0 0 0 0 0 0 0 # consensus
syscon icmp6 ICMP6_PARAMPROB_HEADER 0 0 0 0 0 0 0 0 # consensus
syscon icmp6 ICMP6_TIME_EXCEED_TRANSIT 0 0 0 0 0 0 0 0 # consensus
syscon icmp6 ICMP6_DST_UNREACH_ADMIN 1 1 1 1 1 1 1 1 # consensus
syscon icmp6 ICMP6_PARAMPROB_NEXTHEADER 1 1 1 1 1 1 1 1 # consensus
syscon icmp6 ICMP6_TIME_EXCEED_REASSEMBLY 1 1 1 1 1 1 1 1 # consensus
syscon icmp6 ICMP6_DST_UNREACH 1 1 1 1 1 1 1 0 # unix consensus
syscon icmp6 ICMP6_FILTER 1 1 18 18 18 18 18 0 # bsd consensus
syscon icmp6 ICMP6_DST_UNREACH_BEYONDSCOPE 2 2 2 2 2 2 2 2 # consensus
syscon icmp6 ICMP6_PARAMPROB_OPTION 2 2 2 2 2 2 2 2 # consensus
syscon icmp6 ICMP6_PACKET_TOO_BIG 2 2 2 2 2 2 2 0 # unix consensus
syscon icmp6 ICMP6_DST_UNREACH_ADDR 3 3 3 3 3 3 3 3 # consensus
syscon icmp6 ICMP6_TIME_EXCEEDED 3 3 3 3 3 3 3 0 # unix consensus
syscon icmp6 ICMP6_DST_UNREACH_NOPORT 4 4 4 4 4 4 4 4 # consensus
syscon icmp6 ICMP6_PARAM_PROB 4 4 4 4 4 4 4 0 # unix consensus
syscon icmp6 ICMP6_RR_FLAGS_PREVDONE 8 8 8 8 8 8 8 0 # unix consensus
syscon icmp6 ICMP6_RR_FLAGS_SPECSITE 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0 # unix consensus
syscon icmp6 ICMP6_RR_PCOUSE_RAFLAGS_AUTO 0x10 0x10 0x40 0x40 0x40 0x40 0x40 0 # bsd consensus
syscon icmp6 ICMP6_RR_FLAGS_FORCEAPPLY 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0 # unix consensus
syscon icmp6 ICMP6_RR_PCOUSE_RAFLAGS_ONLINK 0x20 0x20 0x80 0x80 0x80 0x80 0x80 0 # bsd consensus
syscon icmp6 ICMP6_RR_FLAGS_REQRESULT 0x40 0x40 0x40 0x40 0x40 0x40 0x40 0 # unix consensus
syscon icmp6 ICMP6_RR_PCOUSE_FLAGS_DECRPLTIME 0x40 0x40 0x40 0x40 0x40 0x40 0x40 0 # unix consensus
syscon icmp6 ICMP6_INFOMSG_MASK 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 # consensus
syscon icmp6 ICMP6_ECHO_REQUEST 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0 # unix consensus
syscon icmp6 ICMP6_RR_FLAGS_TEST 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0 # unix consensus
syscon icmp6 ICMP6_RR_PCOUSE_FLAGS_DECRVLTIME 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0 # unix consensus
syscon icmp6 ICMP6_ECHO_REPLY 129 129 129 129 129 129 129 0 # unix consensus
syscon icmp6 ICMP6_ROUTER_RENUMBERING 138 138 138 138 138 138 138 0 # unix consensus
syscon icmp6 ICMP6_RR_RESULT_FLAGS_FORBIDDEN 0x0100 0x0100 0x0100 0x0100 0x0100 0x0100 0x0100 0 # unix consensus
syscon icmp6 ICMP6_RR_RESULT_FLAGS_OOB 0x0200 0x0200 0x0200 0x0200 0x0200 0x0200 0x0200 0 # unix consensus
syscon ipport IPPORT_USERRESERVED 5000 5000 5000 5000 5000 49151 5000 5000
# https://blog.cloudflare.com/know-your-scm_rights/
#
# group name GNU/Systemd GNU/Systemd (Aarch64) XNU's Not UNIX! MacOS (Arm64) FreeBSD OpenBSD NetBSD The New Technology Commentary
syscon scm SCM_RIGHTS 1 1 1 1 1 1 1 1 # unix consensus; faked nt
syscon scm SCM_TIMESTAMP 29 29 2 2 2 4 8 0
syscon scm SCM_CREDENTIALS 2 2 0 0 0 0 0 0
syscon scm SCM_TIMESTAMPING 37 37 0 0 0 0 0 0
syscon scm SCM_TIMESTAMPNS 35 35 0 0 0 0 0 0
syscon scm SCM_WIFI_STATUS 41 41 0 0 0 0 0 0
# clone() codes
#
# group name GNU/Systemd GNU/Systemd (Aarch64) XNU's Not UNIX! MacOS (Arm64) FreeBSD OpenBSD NetBSD The New Technology Commentary
syscon clone CLONE_VM 0x00000100 0x00000100 0x00000100 0x00000100 0x00000100 0x00000100 0x00000100 0x00000100 # intentionally symbolic so we can tell if clone() is being used to create threads
# ioctl() requests
#
# group name GNU/Systemd GNU/Systemd (Aarch64) XNU's Not UNIX! MacOS (Arm64) FreeBSD OpenBSD NetBSD The New Technology Commentary
syscon ioctl FIONBIO 0x5421 0x5421 0x8004667e 0x8004667e 0x8004667e 0x8004667e 0x8004667e 0x8004667e # BSD-The New Technology consensus; FIONBIO is traditional O_NONBLOCK; see F_SETFL for re-imagined api
syscon ioctl FIOASYNC 0x5452 0x5452 0x8004667d 0x8004667d 0x8004667d 0x8004667d 0x8004667d 0x8004667d # BSD-The New Technology consensus
syscon ioctl FIONREAD 0x541b 0x541b 0x4004667f 0x4004667f 0x4004667f 0x4004667f 0x4004667f 0x4004667f # BSD-The New Technology consensus; bytes waiting in FD's input buffer
syscon ioctl FIOCLEX 0x5451 0x5451 0x20006601 0x20006601 0x20006601 0x20006601 0x20006601 0x5451 # sets "close on exec" on file descriptor the fast way; faked nt
syscon ioctl FIONCLEX 0x5450 0x5450 0x20006602 0x20006602 0x20006602 0x20006602 0x20006602 0x5450 # clears "close on exec" on file descriptor the fast way; faked nt
#syscon ioctl FIONWRITE 0x0 0x0 0x0 0x0 0x40046677 0x0 0x0 -1 # [FreeBSD Generalization] bytes queued in FD's output buffer (same as TIOCOUTQ for TTY FDs; see also SO_SNDBUF)
#syscon ioctl FIONSPACE 0x0 0x0 0x0 0x0 0x40046676 0x0 0x0 -1 # [FreeBSD Generalization] capacity of FD's output buffer, e.g. equivalent to TIOCGSERIAL w/ UART
syscon ioctl SIOCGIFCONF 0x8912 0x8912 0xc00c6924 0xc00c6924 0xc0106924 0xc0106924 0xc0106924 0x8912
syscon ioctl SIOCADDMULTI 0x8931 0x8931 0x80206931 0x80206931 0x80206931 0x80206931 0x80206931 0x8931 # bsd consensus
syscon ioctl SIOCDELMULTI 0x8932 0x8932 0x80206932 0x80206932 0x80206932 0x80206932 0x80206932 0x8932 # bsd consensus
syscon ioctl SIOCDIFADDR 0x8936 0x8936 0x80206919 0x80206919 0x80206919 0x80206919 0x80206919 0x8936 # bsd consensus
syscon ioctl SIOCGIFADDR 0x8915 0x8915 0xc0206921 0xc0206921 0xc0206921 0xc0206921 0xc0206921 0x8915 # bsd consensus
syscon ioctl SIOCGIFBRDADDR 0x8919 0x8919 0xc0206923 0xc0206923 0xc0206923 0xc0206923 0xc0206923 0x8919 # bsd consensus
syscon ioctl SIOCGIFDSTADDR 0x8917 0x8917 0xc0206922 0xc0206922 0xc0206922 0xc0206922 0xc0206922 0x8917 # bsd consensus
syscon ioctl SIOCGIFFLAGS 0x8913 0x8913 0xc0206911 0xc0206911 0xc0206911 0xc0206911 0xc0206911 0x8913 # bsd consensus
syscon ioctl SIOCGIFMETRIC 0x891d 0x891d 0xc0206917 0xc0206917 0xc0206917 0xc0206917 0xc0206917 0x891d # bsd consensus
syscon ioctl SIOCGIFNETMASK 0x891b 0x891b 0xc0206925 0xc0206925 0xc0206925 0xc0206925 0xc0206925 0x891b # bsd consensus
syscon ioctl SIOCGPGRP 0x8904 0x8904 0x40047309 0x40047309 0x40047309 0x40047309 0x40047309 0x8904 # bsd consensus
syscon ioctl SIOCSIFADDR 0x8916 0x8916 0x8020690c 0x8020690c 0x8020690c 0x8020690c 0x8020690c 0x8916 # bsd consensus
syscon ioctl SIOCSIFBRDADDR 0x891a 0x891a 0x80206913 0x80206913 0x80206913 0x80206913 0x80206913 0x891a # bsd consensus
syscon ioctl SIOCSIFDSTADDR 0x8918 0x8918 0x8020690e 0x8020690e 0x8020690e 0x8020690e 0x8020690e 0x8918 # bsd consensus
syscon ioctl SIOCSIFFLAGS 0x8914 0x8914 0x80206910 0x80206910 0x80206910 0x80206910 0x80206910 0x8914 # bsd consensus
syscon ioctl SIOCSIFMETRIC 0x891e 0x891e 0x80206918 0x80206918 0x80206918 0x80206918 0x80206918 0x891e # bsd consensus
syscon ioctl SIOCSIFNETMASK 0x891c 0x891c 0x80206916 0x80206916 0x80206916 0x80206916 0x80206916 0x891c # bsd consensus
syscon ioctl SIOCSPGRP 0x8902 0x8902 0x80047308 0x80047308 0x80047308 0x80047308 0x80047308 0x8902 # bsd consensus
syscon ioctl SIOCGIFMTU 0x8921 0x8921 0xc0206933 0xc0206933 0xc0206933 0xc020697e 0xc020697e 0x8921
syscon ioctl SIOCSIFMTU 0x8922 0x8922 0x80206934 0x80206934 0x80206934 0x8020697f 0x8020697f 0x8922
syscon ioctl SIOCGIFINDEX 0x8933 0x8933 0 0 0xc0206920 0 0 0
syscon ioctl SIOCSIFNAME 0x8923 0x8923 0 0 0x80206928 0 0 0
syscon ioctl SIOCADDDLCI 0x8980 0x8980 0 0 0 0 0 0
syscon ioctl SIOCADDRT 0x890b 0x890b 0 0 0 0 0 0
syscon ioctl SIOCDARP 0x8953 0x8953 0 0 0 0 0 0
syscon ioctl SIOCDELDLCI 0x8981 0x8981 0 0 0 0 0 0
syscon ioctl SIOCDELRT 0x890c 0x890c 0 0 0 0 0 0
syscon ioctl SIOCDEVPRIVATE 0x89f0 0x89f0 0 0 0 0 0 0
syscon ioctl SIOCDRARP 0x8960 0x8960 0 0 0 0 0 0
syscon ioctl SIOCGARP 0x8954 0x8954 0 0 0 0 0 0
syscon ioctl SIOCGIFBR 0x8940 0x8940 0 0 0 0 0 0
syscon ioctl SIOCGIFCOUNT 0x8938 0x8938 0 0 0 0 0 0
syscon ioctl SIOCGIFENCAP 0x8925 0x8925 0 0 0 0 0 0
syscon ioctl SIOCGIFHWADDR 0x8927 0x8927 0 0 0 0 0 0
syscon ioctl SIOCGIFMAP 0x8970 0x8970 0 0 0 0 0 0
syscon ioctl SIOCGIFMEM 0x891f 0x891f 0 0 0 0 0 0
syscon ioctl SIOCGIFNAME 0x8910 0x8910 0 0 0 0 0 0
syscon ioctl SIOCGIFPFLAGS 0x8935 0x8935 0 0 0 0 0 0
syscon ioctl SIOCGIFSLAVE 0x8929 0x8929 0 0 0 0 0 0
syscon ioctl SIOCGIFTXQLEN 0x8942 0x8942 0 0 0 0 0 0
syscon ioctl SIOCGRARP 0x8961 0x8961 0 0 0 0 0 0
syscon ioctl SIOCGSTAMP 0x8906 0x8906 0 0 0 0 0 0
syscon ioctl SIOCGSTAMPNS 0x8907 0x8907 0 0 0 0 0 0
syscon ioctl SIOCPROTOPRIVATE 0x89e0 0x89e0 0 0 0 0 0 0
syscon ioctl SIOCRTMSG 0x890d 0x890d 0 0 0 0 0 0
syscon ioctl SIOCSARP 0x8955 0x8955 0 0 0 0 0 0
syscon ioctl SIOCSIFBR 0x8941 0x8941 0 0 0 0 0 0
syscon ioctl SIOCSIFENCAP 0x8926 0x8926 0 0 0 0 0 0
syscon ioctl SIOCSIFHWADDR 0x8924 0x8924 0 0 0 0 0 0
syscon ioctl SIOCSIFHWBROADCAST 0x8937 0x8937 0 0 0 0 0 0
syscon ioctl SIOCSIFLINK 0x8911 0x8911 0 0 0 0 0 0
syscon ioctl SIOCSIFMAP 0x8971 0x8971 0 0 0 0 0 0
syscon ioctl SIOCSIFMEM 0x8920 0x8920 0 0 0 0 0 0
syscon ioctl SIOCSIFPFLAGS 0x8934 0x8934 0 0 0 0 0 0
syscon ioctl SIOCSIFSLAVE 0x8930 0x8930 0 0 0 0 0 0
syscon ioctl SIOCSIFTXQLEN 0x8943 0x8943 0 0 0 0 0 0
syscon ioctl SIOCSRARP 0x8962 0x8962 0 0 0 0 0 0
syscon ioctl SIOGIFINDEX 0x8933 0x8933 0 0 0 0 0 0
# socket() address families
#
# group name GNU/Systemd GNU/Systemd (Aarch64) XNU's Not UNIX! MacOS (Arm64) FreeBSD OpenBSD NetBSD The New Technology Commentary
syscon af AF_UNSPEC 0 0 0 0 0 0 0 0 # consensus
syscon af AF_UNIX 1 1 1 1 1 1 1 1 # consensus
syscon af AF_LOCAL 1 1 1 1 1 1 1 1 # consensus
syscon af AF_INET 2 2 2 2 2 2 2 2 # consensus
syscon af AF_INET6 10 10 30 30 28 24 24 23
syscon af AF_IPX 4 4 23 23 23 23 23 6 # bsd consensus
syscon af AF_APPLETALK 5 5 0x10 0x10 0x10 0x10 0x10 0x10 # bsd consensus
syscon af AF_ROUTE 16 16 17 17 17 17 34 -1 # bsd consensus
syscon af AF_LINK -1 -1 18 18 18 18 18 -1
syscon af AF_SNA 22 22 11 11 11 11 11 11 # bsd consensus
syscon af AF_FILE 1 1 -1 -1 -1 -1 -1 -1
syscon af AF_AX25 3 3 -1 -1 -1 -1 -1 -1
syscon af AF_NETROM 6 6 -1 -1 -1 -1 -1 -1
syscon af AF_BRIDGE 7 7 -1 -1 -1 -1 -1 -1
syscon af AF_ATMPVC 8 8 -1 -1 -1 -1 -1 -1
syscon af AF_X25 9 9 -1 -1 -1 -1 -1 -1
syscon af AF_ROSE 11 11 -1 -1 -1 -1 -1 -1
syscon af AF_NETBEUI 13 13 -1 -1 -1 -1 -1 -1
syscon af AF_SECURITY 14 14 -1 -1 -1 -1 -1 -1
syscon af AF_KEY 15 15 -1 -1 -1 30 -1 -1
syscon af AF_NETLINK 16 16 -1 -1 -1 -1 -1 -1
syscon af AF_PACKET 17 17 -1 -1 -1 -1 -1 -1
syscon af AF_ASH 18 18 -1 -1 -1 -1 -1 -1
syscon af AF_ECONET 19 19 -1 -1 -1 -1 -1 -1
syscon af AF_ATMSVC 20 20 -1 -1 -1 -1 -1 -1
syscon af AF_RDS 21 21 -1 -1 -1 -1 -1 -1
syscon af AF_IRDA 23 23 -1 -1 -1 -1 -1 -1
syscon af AF_PPPOX 24 24 -1 -1 -1 -1 -1 -1
syscon af AF_WANPIPE 25 25 -1 -1 -1 -1 -1 -1
syscon af AF_LLC 26 26 -1 -1 -1 -1 -1 -1
syscon af AF_IB 27 27 -1 -1 -1 -1 -1 -1
syscon af AF_MPLS 28 28 -1 -1 -1 33 33 -1
syscon af AF_CAN 29 29 -1 -1 -1 -1 35 -1
syscon af AF_TIPC 30 30 -1 -1 -1 -1 -1 -1
syscon af AF_BLUETOOTH 31 31 -1 -1 36 0x20 31 -1
syscon af AF_IUCV 0x20 0x20 -1 -1 -1 -1 -1 -1
syscon af AF_RXRPC 33 33 -1 -1 -1 -1 -1 -1
syscon af AF_ISDN 34 34 28 28 26 26 26 -1
syscon af AF_PHONET 35 35 -1 -1 -1 -1 -1 -1
syscon af AF_IEEE802154 36 36 -1 -1 -1 -1 -1 -1
syscon af AF_CAIF 37 37 -1 -1 -1 -1 -1 -1
syscon af AF_ALG 38 38 -1 -1 -1 -1 -1 -1
syscon af AF_NFC 39 39 -1 -1 -1 -1 -1 -1
syscon af AF_VSOCK 40 40 -1 -1 -1 -1 -1 -1
syscon af AF_KCM 41 41 -1 -1 -1 -1 -1 -1
syscon af AF_MAX 42 42 40 40 42 36 37 35
syscon pf PF_UNIX 1 1 1 1 1 1 1 1 # consensus
syscon pf PF_UNSPEC 0 0 0 0 0 0 0 0 # consensus
syscon pf PF_APPLETALK 5 5 0x10 0x10 0x10 0x10 0x10 0x10 # bsd consensus
syscon pf PF_SNA 22 22 11 11 11 11 11 11 # bsd consensus
syscon pf PF_INET6 10 10 30 30 28 24 24 23
syscon pf PF_MAX 42 42 40 40 42 36 36 35
syscon pf PF_INET 2 2 2 2 2 2 2 2 # unix consensus
syscon pf PF_LOCAL 1 1 1 1 1 1 1 0 # unix consensus
syscon pf PF_IPX 4 4 23 23 23 23 23 0 # bsd consensus
syscon pf PF_ROUTE 0x10 0x10 17 17 17 17 17 0 # bsd consensus
syscon pf PF_ISDN 34 34 28 28 26 26 26 0
syscon pf PF_KEY 15 15 29 29 27 30 30 0
syscon pf PF_BLUETOOTH 31 31 0 0 36 0x20 0x20 0
syscon pf PF_MPLS 28 28 0 0 0 33 33 0
syscon pf PF_ALG 38 38 0 0 0 0 0 0
syscon pf PF_ASH 18 18 0 0 0 0 0 0
syscon pf PF_ATMPVC 8 8 0 0 0 0 0 0
syscon pf PF_ATMSVC 20 20 0 0 0 0 0 0
syscon pf PF_AX25 3 3 0 0 0 0 0 0
syscon pf PF_BRIDGE 7 7 0 0 0 0 0 0
syscon pf PF_CAIF 37 37 0 0 0 0 0 0
syscon af PF_CAN 29 29 0 0 0 0 35 0
syscon pf PF_ECONET 19 19 0 0 0 0 0 0
syscon pf PF_FILE 1 1 0 0 0 0 0 0
syscon pf PF_IB 27 27 0 0 0 0 0 0
syscon pf PF_IEEE802154 36 36 0 0 0 0 0 0
syscon pf PF_IRDA 23 23 0 0 0 0 0 0
syscon pf PF_IUCV 0x20 0x20 0 0 0 0 0 0
syscon pf PF_KCM 41 41 0 0 0 0 0 0
syscon pf PF_LLC 26 26 0 0 0 0 0 0
syscon pf PF_NETBEUI 13 13 0 0 0 0 0 0
syscon pf PF_NETLINK 0x10 0x10 0 0 0 0 0 0
syscon pf PF_NETROM 6 6 0 0 0 0 0 0
syscon pf PF_NFC 39 39 0 0 0 0 0 0
syscon pf PF_PACKET 17 17 0 0 0 0 0 0
syscon pf PF_PHONET 35 35 0 0 0 0 0 0
syscon pf PF_PPPOX 24 24 0 0 0 0 0 0
syscon pf PF_RDS 21 21 0 0 0 0 0 0
syscon pf PF_ROSE 11 11 0 0 0 0 0 0
syscon pf PF_RXRPC 33 33 0 0 0 0 0 0
syscon pf PF_SECURITY 14 14 0 0 0 0 0 0
syscon pf PF_TIPC 30 30 0 0 0 0 0 0
syscon pf PF_VSOCK 40 40 0 0 0 0 0 0
syscon pf PF_WANPIPE 25 25 0 0 0 0 0 0
syscon pf PF_X25 9 9 0 0 0 0 0 0
# msync() flags
#
# group name GNU/Systemd GNU/Systemd (Aarch64) XNU's Not UNIX! MacOS (Arm64) FreeBSD OpenBSD NetBSD The New Technology Commentary
syscon ms MS_SYNC 4 4 16 16 1 2 4 4 # faked nt; actually 0 on freebsd
syscon ms MS_ASYNC 1 1 1 1 2 1 1 1 # faked nt; actually 1 on freebsd
syscon ms MS_INVALIDATE 2 2 2 2 4 4 2 0 # actually 2 on freebsd
# statfs() flags
#
# group name GNU/Systemd GNU/Systemd (Aarch64) XNU's Not UNIX! MacOS (Arm64) FreeBSD OpenBSD NetBSD The New Technology Commentary
syscon statfs ST_RDONLY 1 1 1 1 1 1 1 0x00080000 # MNT_RDONLY on BSD, kNtFileReadOnlyVolume on NT
syscon statfs ST_NOSUID 2 2 8 8 8 8 8 0 # MNT_NOSUID on BSD
syscon statfs ST_NODEV 4 4 16 16 0 16 16 0 # MNT_NODEV on BSD
syscon statfs ST_NOEXEC 8 8 4 4 4 4 4 0 # MNT_NOEXEC on BSD
syscon statfs ST_SYNCHRONOUS 16 16 2 2 2 2 2 0 # MNT_SYNCHRONOUS on BSD
syscon statfs ST_NOATIME 0x0040 0x0040 0x10000000 0x10000000 0x10000000 0x00008000 0x04000000 0 # MNT_NOATIME on BSD
syscon statfs ST_RELATIME 0x1000 0x1000 0 0 0 0 0x00020000 0 # MNT_RELATIME on NetBSD
syscon statfs ST_APPEND 0x0100 0x0100 0 0 0 0 0 0 #
syscon statfs ST_IMMUTABLE 0x0200 0x0200 0 0 0 0 0 0 #
syscon statfs ST_MANDLOCK 0x0040 0x0040 0 0 0 0 0 0 #
syscon statfs ST_NODIRATIME 0x0800 0x0800 0 0 0 0 0 0 #
syscon statfs ST_WRITE 0x0080 0x0080 0 0 0 0 0 0 #
# sendfile() flags
#
# group name GNU/Systemd GNU/Systemd (Aarch64) XNU's Not UNIX! MacOS (Arm64) FreeBSD OpenBSD NetBSD The New Technology Commentary
syscon sf SF_NODISKIO 0 0 0 0 1 0 0 0
syscon sf SF_MNOWAIT 0 0 0 0 2 0 0 0
syscon sf SF_SYNC 0 0 0 0 4 0 0 0
# mount() flags
#
# group name GNU/Systemd GNU/Systemd (Aarch64) XNU's Not UNIX! MacOS (Arm64) FreeBSD OpenBSD NetBSD The New Technology Commentary
syscon mount MS_RDONLY 0x00000001 0x00000001 0x00000001 0x00000001 0x00000001 0x00000001 0x00000001 0x00000001 # consensus; MNT_RDONLY on bsd; faked nt
syscon mount MNT_RDONLY 0x00000001 0x00000001 0x00000001 0x00000001 0x00000001 0x00000001 0x00000001 0x00000001 # consensus; MS_RDONLY on linux; faked nt
syscon mount MS_NOSUID 0x00000002 0x00000002 0x00000008 0x00000008 0x00000008 0x00000008 0x00000008 0x00000001 # don't honor S_ISUID bit; bsd consensus; MNT_NOSUID on bsd; faked nt
syscon mount MNT_NOSUID 0 0 0x00000008 0x00000008 0x00000008 0x00000008 0x00000008 0x00000001 # don't honor S_ISUID bit; bsd consensus; appears incorrectly defined in linux headers; MS_NOSUID on linux; faked nt
syscon mount MS_NODEV 0x00000004 0x00000004 0x00000010 0x00000010 0x00000010 0x00000010 0x00000010 0x00000004 # disallow special files; bsd consensus; MNT_NODEV on bsd; faked nt
syscon mount MNT_NODEV 0x00000004 0x00000004 0x00000010 0x00000010 0x00000010 0x00000010 0x00000010 0x00000004 # disallow special files; bsd consensus; MS_NODEV on linux; faked nt
syscon mount MS_NOEXEC 0x00000008 0x00000008 0x00000004 0x00000004 0x00000004 0x00000004 0x00000004 0x00000008 # disallow program execution; bsd consensus; MNT_NOEXEC on bsd; faked nt
syscon mount MNT_NOEXEC 0x00000008 0x00000008 0x00000004 0x00000004 0x00000004 0x00000004 0x00000004 0x00000008 # disallow program execution; bsd consensus; MS_NOEXEC on linux; faked nt
syscon mount MS_SYNCHRONOUS 0x00000010 0x00000010 0x00000002 0x00000002 0x00000002 0x00000002 0x00000002 0x00000010 # bsd consensus; MNT_SYNCHRONOUS on bsd; faked nt
syscon mount MNT_SYNCHRONOUS 0x00000010 0x00000010 0x00000002 0x00000002 0x00000002 0x00000002 0x00000002 0x00000010 # bsd consensus; MS_SYNCHRONOUS on linux; faked nt
syscon mount MS_REMOUNT 0x00000020 0x00000020 0x00010000 0x00010000 0x00010000 0x00010000 0x00010000 0x00000020 # tune existing mounting; bsd consensus; MNT_UPDATE on bsd; faked nt
syscon mount MNT_UPDATE 0x00000020 0x00000020 0x00010000 0x00010000 0x00010000 0x00010000 0x00010000 0x00000020 # tune existing mounting; bsd consensus; MS_REMOUNT on linux; faked nt
syscon mount MS_MANDLOCK 0x00000040 0x00000040 0 0 0 0 0 0 #
syscon mount MS_DIRSYNC 0x00000080 0x00000080 0 0 0 0 0 0 #
syscon mount MS_NOATIME 0x00000400 0x00000400 0x10000000 0x10000000 0x10000000 0x00008000 0x04000000 0x00000400 # do not update access times; MNT_NOATIME on bsd
syscon mount MNT_NOATIME 0x00000400 0x00000400 0x10000000 0x10000000 0x10000000 0x00008000 0x04000000 0x00000400 # do not update access times; MS_NOATIME on linux
syscon mount MS_NODIRATIME 0x00000800 0x00000800 0 0 0 0 0 0 #
syscon mount MS_BIND 0x00001000 0x00001000 0 0 0 0 0 0 #
syscon mount MS_MOVE 0x00002000 0x00002000 0 0 0 0 0 0 #
syscon mount MS_REC 0x00004000 0x00004000 0 0 0 0 0 0 #
syscon mount MS_SILENT 0x00008000 0x00008000 0 0 0 0 0 0 #
syscon mount MS_POSIXACL 0x00010000 0x00010000 0 0 0 0 0 0 #
syscon mount MS_UNBINDABLE 0x00020000 0x00020000 0 0 0 0 0 0 #
syscon mount MS_PRIVATE 0x00040000 0x00040000 0 0 0 0 0 0 #
syscon mount MS_SLAVE 0x00080000 0x00080000 0 0 0 0 0 0 #
syscon mount MS_SHARED 0x00100000 0x00100000 0 0 0 0 0 0 #
syscon mount MS_RELATIME 0x00200000 0x00200000 0 0 0 0 0x00020000 0 # MNT_RELATIME on bsd
syscon mount MNT_RELATIME 0x00200000 0x00200000 0 0 0 0 0x00020000 0 # MS_RELATIME on linux
syscon mount MS_KERNMOUNT 0x00400000 0x00400000 0 0 0 0 0 0 #
syscon mount MS_I_VERSION 0x00800000 0x00800000 0 0 0 0 0 0 #
syscon mount MS_STRICTATIME 0x01000000 0x01000000 0x80000000 0x80000000 0 0 0 0 # enable strict update of file access time; MNT_STRICTATIME on bsd
syscon mount MNT_STRICTATIME 0x01000000 0x01000000 0x80000000 0x80000000 0 0 0 0 # enable strict update of file access time; MS_STRICTATIME on linux
syscon mount MS_LAZYTIME 0x02000000 0x02000000 0 0 0 0 0 0 #
syscon mount MS_ACTIVE 0x40000000 0x40000000 0 0 0 0 0 0 #
syscon mount MS_NOUSER 0x80000000 0x80000000 0 0 0 0 0 0 #
syscon mount MS_RMT_MASK 0x02800051 0x02800051 0 0 0 0 0 0 #
syscon mount MS_MGC_VAL 0xc0ed0000 0xc0ed0000 0 0 0 0 0 0 # Linux 2.3
syscon mount MS_MGC_MSK 0xffff0000 0xffff0000 0 0 0 0 0 0 # Linux 2.3
syscon mount MNT_ASYNC 0 0 0x00000040 0x00000040 0x00000040 0x00000040 0x00000040 0 # file system written asynchronously; bsd consensus
syscon mount MNT_RELOAD 0 0 0x00040000 0x00040000 0x00040000 0x00040000 0x00040000 0 # reload filesystem data; bsd consensus
syscon mount MNT_SUIDDIR 0 0 0 0 0x00100000 0 0 0 # special suid dir handling
syscon mount MNT_NOCLUSTERR 0 0 0 0 0x40000000 0 0 0 # disable cluster read
syscon mount MNT_NOCLUSTERW 0 0 0 0 0x80000000 0 0 0 # disable cluster write
syscon mount MNT_SNAPSHOT 0 0 0x40000000 0x40000000 0x01000000 0 0 0 # confusing
# limits
#
# group name GNU/Systemd GNU/Systemd (Aarch64) XNU's Not UNIX! MacOS (Arm64) FreeBSD OpenBSD NetBSD The New Technology Commentary
syscon limits NGROUPS_MAX 65536 65536 16 16 1023 16 16 0 #
syscon limits LINK_MAX 127 127 32767 32767 32767 32767 32767 64 # freebsd/windows are educated guesses
syscon limits MAX_CANON 255 255 1024 1024 255 255 255 255 # windows is guessed
syscon limits MAX_INPUT 255 255 1024 1024 255 255 255 255 # windows is guessed
syscon limits SOMAXCONN 4096 4096 128 128 128 128 128 2147483647 # maximum backlog for listen()
syscon limits _ARG_MAX 128*1024 128*1024 1024*1024 1024*1024 512*1024 512*1024 256*1024 32767*2 # bsd consensus
syscon limits _NAME_MAX 255 255 255 255 255 255 511 255 # probably higher on windows?
syscon limits _PATH_MAX 4096 4096 1024 1024 1024 1024 1024 1024 #
syscon limits _NSIG 64 64 32 32 128 32 64 64 # _SIG_MAXSIG on FreeBSD
syscon limits _MINSIGSTKSZ 2048 6144 8192 32768 6656 14336 8192 2048 # FreeBSD upscaled a bit for ARM
syscon limits _SIGSTKSZ 10240 10240 131072 131072 36864 28672 40960 10240 #
# unmount() flags
# a.k.a. umount2() on linux
#
# group name GNU/Systemd GNU/Systemd (Aarch64) XNU's Not UNIX! MacOS (Arm64) FreeBSD OpenBSD NetBSD The New Technology Commentary
syscon unmount MNT_FORCE 1 1 0x00080000 0x00080000 0x00080000 0x00080000 0x00080000 2 # force unmount or readonly
syscon unmount MNT_DETACH 2 2 0 0 0 0 0 0 # just detach from the tree
syscon unmount MNT_EXPIRE 4 4 0 0 0 0 0 0 # mark for expiry
syscon unmount UMOUNT_NOFOLLOW 8 8 0 0 0 0 0 0 # don't follow symlinks on unmount
syscon unmount MNT_BYFSID 0 0 0 0 0x08000000 0 0 0 # if used pass "FSID:val0:val1", where val0 and val1 are the contents of the fsid_t val[] array in decimal
# reboot() magnums
#
# group name GNU/Systemd GNU/Systemd (Aarch64) XNU's Not UNIX! MacOS (Arm64) FreeBSD OpenBSD NetBSD The New Technology Commentary
syscon reboot RB_AUTOBOOT 0x01234567 0x01234567 0 0 0 0 0 4 # reboots; SHUTDOWN_RESTART on NT
syscon reboot RB_POWER_OFF 0x4321fedc 0x4321fedc 0xffffffff 0xffffffff 0x4000 0x1000 0x808 8 # SHUTDOWN_POWEROFF on NT
syscon reboot RB_POWERDOWN 0x4321fedc 0x4321fedc 0xffffffff 0xffffffff 0x4000 0x1000 0x808 8 # openbsd/netbsd name
syscon reboot RB_POWEROFF 0x4321fedc 0x4321fedc 0xffffffff 0xffffffff 0x4000 0x1000 0x808 8 # freebsd name
syscon reboot RB_HALT_SYSTEM 0xcdef0123 0xcdef0123 8 8 8 8 8 16 # the processor is simply halted; SHUTDOWN_NOREBOOT on NT
syscon reboot RB_HALT 0xcdef0123 0xcdef0123 8 8 8 8 8 16 # the processor is simply halted; bsd name
syscon reboot RB_SW_SUSPEND 0xd000fce2 0xd000fce2 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xd000fce2 #
syscon reboot RB_KEXEC 0x45584543 0x45584543 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff #
syscon reboot RB_ENABLE_CAD 0x89abcdef 0x89abcdef 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff # enable control-alt-delete reboot
syscon reboot RB_DISABLE_CAD 0 0 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff # make control-alt-delete just eintr
syscon reboot RB_NOSYNC 0x20000000 0x20000000 4 4 4 4 4 0x20000000 # prevents implicit sync() beforehand; polyfilled linux; polyfilled on nt just in case
# send() / recv() flags
#
# group name GNU/Systemd GNU/Systemd (Aarch64) XNU's Not UNIX! MacOS (Arm64) FreeBSD OpenBSD NetBSD The New Technology Commentary
syscon msg MSG_OOB 1 1 1 1 1 1 1 1 # consensus
syscon msg MSG_PEEK 2 2 2 2 2 2 2 2 # consensus
syscon msg MSG_DONTROUTE 4 4 4 4 4 4 4 4 # consensus
syscon msg MSG_DONTWAIT 0x40 0x40 0x80 0x80 0x80 0x80 0x80 0x40 # send/sendto: manual non-blocking
syscon msg MSG_WAITALL 0x0100 0x0100 0x40 0x40 0x40 0x40 0x40 8 # bsd consensus
syscon msg MSG_NOSIGNAL 0x4000 0x4000 0x80000 0x80000 0x020000 0x0400 0x0400 0x10000000 # send/sendto: don't raise sigpipe on local shutdown
syscon msg MSG_TRUNC 0x20 0x20 0x10 0x10 0x10 0x10 0x10 0x0100 # bsd consensus
syscon msg MSG_CTRUNC 8 8 0x20 0x20 0x20 0x20 0x20 0x0200 # bsd consensus
syscon msg MSG_FASTOPEN 0x20000000 0x20000000 -1 -1 -1 -1 -1 -1 #
# getpriority() / setpriority() magnums (a.k.a. nice)
#
# group name GNU/Systemd GNU/Systemd (Aarch64) XNU's Not UNIX! MacOS (Arm64) FreeBSD OpenBSD NetBSD The New Technology Commentary
syscon prio PRIO_PROCESS 0 0 0 0 0 0 0 0 # consensus / poly nt
syscon prio PRIO_PGRP 1 1 1 1 1 1 1 1 # unix consensus / poly nt
syscon prio PRIO_USER 2 2 2 2 2 2 2 2 # unix consensus / poly nt
syscon prio PRIO_MIN -20 -20 -20 -20 -20 -20 -20 -20 # unix consensus / poly nt
syscon prio PRIO_MAX 20 20 20 20 20 20 20 20 # unix consensus / poly nt
# getrusage() who
#
# group name GNU/Systemd GNU/Systemd (Aarch64) XNU's Not UNIX! MacOS (Arm64) FreeBSD OpenBSD NetBSD The New Technology Commentary
syscon rusage RUSAGE_SELF 0 0 0 0 0 0 0 0 # unix consensus & faked nt
syscon rusage RUSAGE_THREAD 1 1 99 99 1 1 1 1 # faked nt & unavailable on xnu
syscon rusage RUSAGE_CHILDREN -1 -1 -1 -1 -1 -1 -1 -1 # unix consensus & unavailable on nt
syscon rusage RUSAGE_BOTH -2 -2 99 99 99 99 99 -2 # woop
# fast userspace mutexes
#
# group name GNU/Systemd GNU/Systemd (Aarch64) XNU's Not UNIX! MacOS (Arm64) FreeBSD OpenBSD NetBSD The New Technology Commentary
syscon futex FUTEX_WAIT 0 0 0 0 0 1 0 0
syscon futex FUTEX_WAKE 1 1 0 0 1 2 1 1
syscon futex FUTEX_REQUEUE 3 3 0 0 0 3 0 0
syscon futex FUTEX_PRIVATE_FLAG 128 128 0 0 128 128 0 0
# lio_listio() magnums
#
# group name GNU/Systemd GNU/Systemd (Aarch64) XNU's Not UNIX! MacOS (Arm64) FreeBSD OpenBSD NetBSD The New Technology Commentary
syscon lio LIO_WRITE 127 127 2 2 1 127 1 127
syscon lio LIO_NOWAIT 127 127 1 1 0 127 0 127
syscon lio LIO_READ 127 127 1 1 2 127 2 127
syscon lio LIO_WAIT 127 127 2 2 1 127 1 127
syscon lio LIO_NOP 127 127 0 0 0 127 0 127
# posix scheduling
#
# group name GNU/Systemd GNU/Systemd (Aarch64) XNU's Not UNIX! MacOS (Arm64) FreeBSD OpenBSD NetBSD The New Technology Commentary
syscon sched SCHED_OTHER 0 0 1 1 2 127 0 127 # standard round-robin time-sharing policy
syscon sched SCHED_FIFO 1 1 4 4 1 127 1 127 # [real-time] first-in, first-out policy
syscon sched SCHED_RR 2 2 2 2 3 127 2 127 # [real-time] round-robin policy
syscon sched SCHED_BATCH 3 3 127 127 2 127 0 127 # for "batch" style execution of processes; polyfilled as SCHED_OTHER on non-Linux
syscon sched SCHED_IDLE 5 5 127 127 2 127 0 127 # for running very low priority background jobs; polyfilled as SCHED_OTHER on non-Linux
syscon sched SCHED_DEADLINE 6 6 127 127 127 127 127 127 # can only be set by sched_setattr()
syscon sched SCHED_RESET_ON_FORK 0x40000000 0x40000000 0 0 0 0 0 0 # Can be ORed in to make sure the process is reverted back to SCHED_NORMAL on fork(); no-op on non-Linux
# Teletypewriter Control, e.g.
#
# TCSETS β About 70,800 results (0.31 seconds)
# = TCSETNOW β About 47,700 results (0.31 seconds)
# β TCSETA β About 12,600 results (0.32 seconds)
# = TIOCSETA β About 3,110 results (0.41 seconds)
#
# group name GNU/Systemd GNU/Systemd (Aarch64) XNU's Not UNIX! MacOS (Arm64) FreeBSD OpenBSD NetBSD The New Technology Commentary
syscon termios TCGETS 0x5401 0x5401 0x40487413 0x40487413 0x402c7413 0x402c7413 0x402c7413 0x5401 # Gets console settings; tcgetattr(tty, argp) β ioctl(tty, TCGETS, struct termios *argp); polyfilled NT
syscon termios TCSETS 0x5402 0x5402 0x80487414 0x80487414 0x802c7414 0x802c7414 0x802c7414 0x5402 # Sets console settings; = ioctl(tty, TCSETS, const struct termios *argp); polyfilled NT
syscon termios TIOCGWINSZ 0x5413 0x5413 1074295912 1074295912 1074295912 1074295912 1074295912 0x5413 # ioctl(tty, TIOCGWINSZ, struct winsize *argp); polyfilled NT
syscon termios TIOCSWINSZ 0x5414 0x5414 0x80087467 0x80087467 0x80087467 0x80087467 0x80087467 0x5414 # ioctl(tty, TIOCSWINSZ, const struct winsize *argp) (faked NT)
syscon termios TIOCINQ 0x541b 0x541b 0x4004667f 0x4004667f 0x4004667f 0x4004667f 0x4004667f 0x4004667f # [Linuxism] same as FIONREAD
syscon termios TIOCOUTQ 0x5411 0x5411 0x40047473 0x40047473 0x40047473 0x40047473 0x40047473 0 # get # bytes queued in TTY's output buffer ioctl(tty, TIOCSWINSZ, const struct winsize *argp)
syscon termios TIOCSPGRP 0x5410 0x5410 0x80047476 0x80047476 0x80047476 0x80047476 0x80047476 0 # tcsetpgrp(): set pgrp of tty
syscon termios TIOCCONS 0x541d 0x541d 0x80047462 0x80047462 0x80047462 0x80047462 0x80047462 0 # boop
syscon termios TIOCGETD 0x5424 0x5424 0x4004741a 0x4004741a 0x4004741a 0x4004741a 0x4004741a 0 # boop
syscon termios TIOCNOTTY 0x5422 0x5422 0x20007471 0x20007471 0x20007471 0x20007471 0x20007471 0 # boop
syscon termios TIOCNXCL 0x540d 0x540d 0x2000740e 0x2000740e 0x2000740e 0x2000740e 0x2000740e 0 # boop
syscon termios TIOCSCTTY 0x540e 0x540e 0x20007461 0x20007461 0x20007461 0x20007461 0x20007461 0 # makes terminal controlling terminal of calling process (see login_tty)
syscon termios TIOCSETD 0x5423 0x5423 0x8004741b 0x8004741b 0x8004741b 0x8004741b 0x8004741b 0 # boop
syscon termios TIOCSIG 0x40045436 0x40045436 0x2000745f 0x2000745f 0x2004745f 0x8004745f 0x8004745f 0 # boop
syscon termios TIOCSTI 0x5412 0x5412 0x80017472 0x80017472 0x80017472 0 0x80017472 0 # boop
# Teletypewriter Control Modes
#
# group name GNU/Systemd GNU/Systemd (Aarch64) XNU's Not UNIX! MacOS (Arm64) FreeBSD OpenBSD NetBSD The New Technology Commentary
syscon termios CS5 0b0000000000000000 0b0000000000000000 0b000000000000000000 0b000000000000000000 0b000000000000000000 0b0000000000000000 0b0000000000000000 0b0000000000000000 # termios.c_cflag; consensus
syscon termios CS6 0b0000000000010000 0b0000000000010000 0b000000000100000000 0b000000000100000000 0b000000000100000000 0b0000000100000000 0b0000000100000000 0b0000000000010000 # termios.c_cflag; 6-bit characters
syscon termios CS7 0b0000000000100000 0b0000000000100000 0b000000001000000000 0b000000001000000000 0b000000001000000000 0b0000001000000000 0b0000001000000000 0b0000000000100000 # termios.c_cflag; 7-bit characters
syscon termios CS8 0b0000000000110000 0b0000000000110000 0b000000001100000000 0b000000001100000000 0b000000001100000000 0b0000001100000000 0b0000001100000000 0b0000000000110000 # termios.c_cflag; 8-bit characters
syscon termios CSIZE 0b0000000000110000 0b0000000000110000 0b000000001100000000 0b000000001100000000 0b000000001100000000 0b0000001100000000 0b0000001100000000 0b0000000000110000 # termios.c_cflag; mask for CSπ₯ flags
syscon termios CSTOPB 0b0000000001000000 0b0000000001000000 0b000000010000000000 0b000000010000000000 0b000000010000000000 0b0000010000000000 0b0000010000000000 0b0000000001000000 # termios.c_cflag; bsd consensus
syscon termios CREAD 0b0000000010000000 0b0000000010000000 0b000000100000000000 0b000000100000000000 0b000000100000000000 0b0000100000000000 0b0000100000000000 0b0000000010000000 # termios.c_cflag; bsd consensus
syscon termios PARENB 0b0000000100000000 0b0000000100000000 0b000001000000000000 0b000001000000000000 0b000001000000000000 0b0001000000000000 0b0001000000000000 0b0000000100000000 # termios.c_cflag
syscon termios PARODD 0b0000001000000000 0b0000001000000000 0b000010000000000000 0b000010000000000000 0b000010000000000000 0b0010000000000000 0b0010000000000000 0b0000001000000000 # termios.c_cflag
syscon termios HUPCL 0b0000010000000000 0b0000010000000000 0b000100000000000000 0b000100000000000000 0b000100000000000000 0b0100000000000000 0b0100000000000000 0b0000010000000000 # termios.c_cflag; bsd consensus
syscon termios CLOCAL 0b0000100000000000 0b0000100000000000 0b001000000000000000 0b001000000000000000 0b001000000000000000 0b1000000000000000 0b1000000000000000 0b0000100000000000 # termios.c_cflag; consensus
syscon termios CMSPAR 0x40000000 0x40000000 0 0 0 0 0 0 # termios.c_cflag; not in POSIX
syscon termios CRTSCTS 0x80000000 0x80000000 0x00030000 0x00030000 0x00030000 0x00010000 0x00010000 0x80000000 # termios.c_cflag
# Teletypewriter Local Modes
#
# group name GNU/Systemd GNU/Systemd (Aarch64) XNU's Not UNIX! MacOS (Arm64) FreeBSD OpenBSD NetBSD The New Technology Commentary
syscon termios ISIG 0b0000000000000001 0b0000000000000001 0b0000000010000000 0b0000000010000000 0b0000000010000000 0b0000000010000000 0b0000000010000000 0b0000000000000001 # termios.c_lflag|=ISIG makes Ctrl-C, Ctrl-\, etc. generate signals
syscon termios ICANON 0b0000000000000010 0b0000000000000010 0b0000000100000000 0b0000000100000000 0b0000000100000000 0b0000000100000000 0b0000000100000000 0b0000000000000010 # termios.c_lflag&=~ICANON disables 1960's version of gnu readline (see also VMIN)
syscon termios XCASE 0b0000000000000100 0b0000000000000100 0 0 0 16777216 0 0b0000000000000100 # termios.c_lflag
syscon termios ECHO 0b0000000000001000 0b0000000000001000 0b0000000000001000 0b0000000000001000 0b0000000000001000 0b0000000000001000 0b0000000000001000 0b0000000000001000 # termios.c_lflag&=~ECHO is for passwords and raw mode
syscon termios ECHOE 0b0000000000010000 0b0000000000010000 0b0000000000000010 0b0000000000000010 0b0000000000000010 0b0000000000000010 0b0000000000000010 0b0000000000010000 # termios.c_lflag
syscon termios ECHOK 0b0000000000100000 0b0000000000100000 0b0000000000000100 0b0000000000000100 0b0000000000000100 0b0000000000000100 0b0000000000000100 0b0000000000100000 # termios.c_lflag
syscon termios ECHONL 0b0000000001000000 0b0000000001000000 0b0000000000010000 0b0000000000010000 0b0000000000010000 0b0000000000010000 0b0000000000010000 0b0000000001000000 # termios.c_lflag
syscon termios NOFLSH 0b0000000010000000 0b0000000010000000 2147483648 2147483648 2147483648 2147483648 2147483648 0b0000000010000000 # termios.c_lflag|=NOFLSH means don't flush on INT/QUIT/SUSP
syscon termios TOSTOP 0b0000000100000000 0b0000000100000000 4194304 4194304 4194304 4194304 4194304 0b0000000100000000 # termios.c_lflag|=TOSTOP raises SIGTTOU to process group if background job tries to write to controlling terminal
syscon termios ECHOCTL 0b0000001000000000 0b0000001000000000 0b0000000001000000 0b0000000001000000 0b0000000001000000 0b0000000001000000 0b0000000001000000 0b0000001000000000 # termios.c_lflag|=ECHOCTL prints ^π₯ codes for monotonic motion
syscon termios ECHOPRT 0b0000010000000000 0b0000010000000000 0b0000000000100000 0b0000000000100000 0b0000000000100000 0b0000000000100000 0b0000000000100000 0b0000010000000000 # termios.c_lflag|=ECHOPRT includes the parity bit
syscon termios ECHOKE 0b0000100000000000 0b0000100000000000 0b0000000000000001 0b0000000000000001 0b0000000000000001 0b0000000000000001 0b0000000000000001 0b0000100000000000 # termios.c_lflag
syscon termios FLUSHO 0b0001000000000000 0b0001000000000000 8388608 8388608 8388608 8388608 8388608 0b0001000000000000 # termios.c_lflag
syscon termios PENDIN 0b0100000000000000 0b0100000000000000 536870912 536870912 536870912 536870912 536870912 0b0100000000000000 # termios.c_lflag
syscon termios IEXTEN 0b1000000000000000 0b1000000000000000 0b0000010000000000 0b0000010000000000 0b0000010000000000 0b0000010000000000 0b0000010000000000 0b1000000000000000 # termios.c_lflag&=~IEXTEN disables platform input processing magic
syscon termios EXTPROC 65536 65536 0b0000100000000000 0b0000100000000000 0b0000100000000000 0b0000100000000000 0b0000100000000000 65536 # termios.c_lflag
# Teletypewriter Input Modes
#
# group name GNU/Systemd GNU/Systemd (Aarch64) XNU's Not UNIX! MacOS (Arm64) FreeBSD OpenBSD NetBSD The New Technology Commentary
syscon termios IGNBRK 0b0000000000000001 0b0000000000000001 0b0000000000000001 0b0000000000000001 0b0000000000000001 0b0000000000000001 0b0000000000000001 0b0000000000000001 # termios.c_iflag it's complicated, uart only? UNIXCONSENSUS
syscon termios BRKINT 0b0000000000000010 0b0000000000000010 0b0000000000000010 0b0000000000000010 0b0000000000000010 0b0000000000000010 0b0000000000000010 0b0000000000000010 # termios.c_iflag it's complicated, uart only? UNIXCONSENSUS
syscon termios IGNPAR 0b0000000000000100 0b0000000000000100 0b0000000000000100 0b0000000000000100 0b0000000000000100 0b0000000000000100 0b0000000000000100 0b0000000000000100 # termios.c_iflag|=IGNPAR ignores parity and framing errors; see PARMRK UNIXCONSENSUS
syscon termios PARMRK 0b0000000000001000 0b0000000000001000 0b0000000000001000 0b0000000000001000 0b0000000000001000 0b0000000000001000 0b0000000000001000 0b0000000000001000 # termios.c_iflag|=PARMRK passes-through parity bit UNIXCONSENSUS
syscon termios INPCK 0b0000000000010000 0b0000000000010000 0b0000000000010000 0b0000000000010000 0b0000000000010000 0b0000000000010000 0b0000000000010000 0b0000000000010000 # termios.c_iflag|=INPCK enables parity checking UNIXCONSENSUS
syscon termios ISTRIP 0b0000000000100000 0b0000000000100000 0b0000000000100000 0b0000000000100000 0b0000000000100000 0b0000000000100000 0b0000000000100000 0b0000000000100000 # termios.c_iflag|=ISTRIP automates read(1)&0x7f UNIXCONSENSUS
syscon termios INLCR 0b0000000001000000 0b0000000001000000 0b0000000001000000 0b0000000001000000 0b0000000001000000 0b0000000001000000 0b0000000001000000 0b0000000001000000 # termios.c_iflag|=INLCR maps \n β \r input UNIXCONSENSUS
syscon termios IGNCR 0b0000000010000000 0b0000000010000000 0b0000000010000000 0b0000000010000000 0b0000000010000000 0b0000000010000000 0b0000000010000000 0b0000000010000000 # termios.c_iflag|=IGNCR maps \r β β
input UNIXCONSENSUS
syscon termios ICRNL 0b0000000100000000 0b0000000100000000 0b0000000100000000 0b0000000100000000 0b0000000100000000 0b0000000100000000 0b0000000100000000 0b0000000100000000 # termios.c_iflag|=ICRNL maps \r β \n input UNIXCONSENSUS
syscon termios IUCLC 0b0000001000000000 0b0000001000000000 0 0 0 0b0001000000000000 0 0b0000001000000000 # termios.c_iflag|=IUCLC maps A-Z β a-z input
syscon termios IXON 0b0000010000000000 0b0000010000000000 0b0000001000000000 0b0000001000000000 0b0000001000000000 0b0000001000000000 0b0000001000000000 0b0000010000000000 # termios.c_iflag|=IXON enables flow rida
syscon termios IXANY 0b0000100000000000 0b0000100000000000 0b0000100000000000 0b0000100000000000 0b0000100000000000 0b0000100000000000 0b0000100000000000 0b0000100000000000 # termios.c_iflag|=IXANY typing will un-stuck teletype UNIXCONSENSUS
syscon termios IXOFF 0b0001000000000000 0b0001000000000000 0b0000010000000000 0b0000010000000000 0b0000010000000000 0b0000010000000000 0b0000010000000000 0b0001000000000000 # termios.c_iflag|=IXOFF disables annoying display freeze keys
syscon termios IMAXBEL 0b0010000000000000 0b0010000000000000 0b0010000000000000 0b0010000000000000 0b0010000000000000 0b0010000000000000 0b0010000000000000 0b0010000000000000 # termios.c_iflag|=IMAXBEL rings when queue full UNIXCONSENSUS
syscon termios IUTF8 0b0100000000000000 0b0100000000000000 0b0100000000000000 0b0100000000000000 0 0 0 0b0100000000000000 # termios.c_iflag|=IUTF8 helps w/ rubout on UTF-8 input
# Teletypewriter Output Modes
#
# group name GNU/Systemd GNU/Systemd (Aarch64) XNU's Not UNIX! MacOS (Arm64) FreeBSD OpenBSD NetBSD The New Technology Commentary
syscon termios OPOST 0b0000000000000001 0b0000000000000001 0b000000000000000001 0b000000000000000001 0b000000000000000001 0b0000000000000001 0b0000000000000001 0b0000000000000001 # termios.c_oflag&=~OPOST disables output processing magic, e.g. MULTICS newlines
syscon termios OLCUC 0b0000000000000010 0b0000000000000010 0 0 0 0b0000000000100000 0 0b0000000000000010 # termios.c_oflag|=OLCUC maps a-z β A-Z output (SHOUTING)
syscon termios ONLCR 0b0000000000000100 0b0000000000000100 0b000000000000000010 0b000000000000000010 0b000000000000000010 0b0000000000000010 0b0000000000000010 0b0000000000000100 # termios.c_oflag|=ONLCR map \n β \r\n output (MULTICS newline) and requires OPOST
syscon termios OCRNL 0b0000000000001000 0b0000000000001000 0b000000000000010000 0b000000000000010000 0b000000000000010000 0b0000000000010000 0b0000000000010000 0b0000000000001000 # termios.c_oflag|=OCRNL maps \r β \n output
syscon termios ONOCR 0b0000000000010000 0b0000000000010000 0b000000000000100000 0b000000000000100000 0b000000000000100000 0b0000000001000000 0b0000000001000000 0b0000000000010000 # termios.c_oflag|=ONOCR maps \r β β
output iff column 0
syscon termios ONLRET 0b0000000000100000 0b0000000000100000 0b000000000001000000 0b000000000001000000 0b000000000001000000 0b0000000010000000 0b0000000010000000 0b0000000000100000 # termios.c_oflag|=ONLRET maps \r β β
output
syscon termios OFILL 0b0000000001000000 0b0000000001000000 0b000000000010000000 0b000000000010000000 0 0 0 0b0000000001000000 # termios.c_oflag
syscon termios OFDEL 0b0000000010000000 0b0000000010000000 0b100000000000000000 0b100000000000000000 0 0 0 0b0000000010000000 # termios.c_oflag
syscon termios NLDLY 0b0000000100000000 0b0000000100000000 0b000000001100000000 0b000000001100000000 0b000000001100000000 0 0 0b0000000100000000 # (termios.c_oflag & NLDLY) β {NL0,NL1,NL2,NL3}
syscon termios NL1 0b0000000100000000 0b0000000100000000 0b000000000100000000 0b000000000100000000 0b000000000100000000 0 0b000000000100000000 0b0000000100000000 # (termios.c_oflag & NLDLY) == NL1
syscon termios NL2 0 0 0b000000001000000000 0b000000001000000000 0b000000001000000000 0 0b000000001000000000 0 # (termios.c_oflag & NLDLY) == NL2
syscon termios NL3 0 0 0b000000001100000000 0b000000001100000000 0b000000001100000000 0 0b000000001100000000 0 # (termios.c_oflag & NLDLY) == NL3
syscon termios CRDLY 0b0000011000000000 0b0000011000000000 0b000011000000000000 0b000011000000000000 0b000011000000000000 0 0 0b0000011000000000 # (termios.c_oflag & CRDLY) β {CR0,CR1,CR2,CR3}
syscon termios CR1 0b0000001000000000 0b0000001000000000 0b000001000000000000 0b000001000000000000 0b000001000000000000 0 0b000001000000000000 0b0000001000000000 # (termios.c_oflag & CRDLY) == CR1
syscon termios CR2 0b0000010000000000 0b0000010000000000 0b000010000000000000 0b000010000000000000 0b000010000000000000 0 0b000000010000000000 0b0000010000000000 # (termios.c_oflag & CRDLY) == CR2
syscon termios CR3 0b0000011000000000 0b0000011000000000 0b000011000000000000 0b000011000000000000 0b000011000000000000 0 0b000000011000000000 0b0000011000000000 # (termios.c_oflag & CRDLY) == CR3
syscon termios TABDLY 0b0001100000000000 0b0001100000000000 0b000000110000000100 0b000000110000000100 0b000000000000000100 0 0 0b0001100000000000 # (termios.c_oflag & TABDLY) β {TAB0,TAB1,TAB2,TAB3,XTABS}
syscon termios TAB1 0b0000100000000000 0b0000100000000000 0b000000010000000000 0b000000010000000000 0b000000010000000000 0 0b000000010000000000 0b0000100000000000 # (termios.c_oflag & TABDLY) == TAB1
syscon termios TAB2 0b0001000000000000 0b0001000000000000 0b000000100000000000 0b000000100000000000 0b000000100000000000 0 0b000000100000000000 0b0001000000000000 # (termios.c_oflag & TABDLY) == TAB2
syscon termios TAB3 0b0001100000000000 0b0001100000000000 0b000000000000000100 0b000000000000000100 0b000000000000000100 0 0b000000000000000100 0b0001100000000000 # (termios.c_oflag & TABDLY) == TAB3
syscon termios XTABS 0b0001100000000000 0b0001100000000000 0b000000110000000000 0b000000110000000000 0b000000110000000000 0 0b000000110000000000 0b0001100000000000 # (termios.c_oflag & TABDLY) == XTABS
syscon termios BSDLY 0b0010000000000000 0b0010000000000000 0b001000000000000000 0b001000000000000000 0b001000000000000000 0 0 0b0010000000000000 # termios.c_oflag
syscon termios BS1 0b0010000000000000 0b0010000000000000 0b001000000000000000 0b001000000000000000 0b001000000000000000 0 0 0b0010000000000000 # termios.c_oflag
syscon termios VTDLY 0b0100000000000000 0b0100000000000000 0b010000000000000000 0b010000000000000000 0b010000000000000000 0 0 0b0100000000000000 # termios.c_oflag
syscon termios VT1 0b0100000000000000 0b0100000000000000 0b010000000000000000 0b010000000000000000 0b010000000000000000 0 0 0b0100000000000000 # termios.c_oflag
syscon termios FFDLY 0b1000000000000000 0b1000000000000000 0b000100000000000000 0b000100000000000000 0b000100000000000000 0 0 0b1000000000000000 # termios.c_oflag
syscon termios FF1 0b1000000000000000 0b1000000000000000 0b000100000000000000 0b000100000000000000 0b000100000000000000 0 0 0b1000000000000000 # termios.c_oflag
# Teletypewriter Special Control Character Assignments
#
# group name GNU/Systemd GNU/Systemd (Aarch64) XNU's Not UNIX! MacOS (Arm64) FreeBSD OpenBSD NetBSD The New Technology Commentary
syscon termios VMIN 6+1 6+1 16 16 16 16 16 6+1 # termios.c_cc[VMIN]=π₯ in non-canonical mode can be set to 0 for non-blocking reads, 1 for single character raw mode reads, or higher to buffer
syscon termios VTIME 5+1 5+1 17 17 17 17 17 5+1 # termios.c_cc[VTIME]=π₯ sets non-canonical read timeout to π₯Γπ·πΆπΆms which is needed when entering escape sequences manually with the escape key
syscon termios VINTR 0+1 0+1 8 8 8 8 8 0+1 # termios.c_cc[VINTR]=π₯
syscon termios VQUIT 1+1 1+1 9 9 9 9 9 1+1 # termios.c_cc[VQUIT]=π₯
syscon termios VERASE 2+1 2+1 3 3 3 3 3 2+1 # termios.c_cc[VERASE]=π₯
syscon termios VKILL 3+1 3+1 5 5 5 5 5 3+1 # termios.c_cc[VKILL]=π₯
syscon termios VEOF 4+1 4+1 0 0 0 0 0 4+1 # termios.c_cc[VEOF]=π₯
syscon termios VSWTC 7+1 7+1 0 0 0 0 0 7+1 # termios.c_cc[VSWTC]=π₯
syscon termios VSTART 8+1 8+1 12 12 12 12 12 8+1 # termios.c_cc[VSTART]=π₯
syscon termios VSTOP 9+1 9+1 13 13 13 13 13 9+1 # termios.c_cc[VSTOP]=π₯
syscon termios VSUSP 10+1 10+1 10 10 10 10 10 10+1 # termios.c_cc[VSUSP]=π₯ defines suspend, i.e. Ctrl-Z (a.k.a. β, ^Z, SUB, 26, 032, 0x1A, ord('Z')^0b01000000); unix consensus
syscon termios VEOL 11+1 11+1 1 1 1 1 1 11+1 # termios.c_cc[VEOL]=π₯
syscon termios VREPRINT 12+1 12+1 6 6 6 6 6 12+1 # termios.c_cc[VREPRINT]=π₯
syscon termios VDISCARD 13+1 13+1 15 15 15 15 15 13+1 # termios.c_cc[VDISCARD]=π₯
syscon termios VWERASE 14+1 14+1 4 4 4 4 4 14+1 # termios.c_cc[VWERASE]=π₯
syscon termios VLNEXT 15+1 15+1 14 14 14 14 14 15+1 # termios.c_cc[VLNEXT]=π₯
syscon termios VEOL2 16+1 16+1 2 2 2 2 2 16+1 # termios.c_cc[VEOL2]=π₯
syscon termios _POSIX_VDISABLE 0 0 255 255 255 255 255 0 # termios.c_cc tombstone value
# tcflush() magic numbers
#
# group name GNU/Systemd GNU/Systemd (Aarch64) XNU's Not UNIX! MacOS (Arm64) FreeBSD OpenBSD NetBSD The New Technology Commentary
syscon termios TCIFLUSH 0 0 1 1 1 1 1 0 # see tcflush; FREAD on BSD; faked nt
syscon termios TCOFLUSH 1 1 2 2 2 2 2 1 # see tcflush; FWRITE on BSD; faked nt
syscon termios TCIOFLUSH 2 2 3 3 3 3 3 2 # see tcflush; FREAD|FWRITE on BSD; faked nt
# Pseudoteletypewriter Control
#
# group name GNU/Systemd GNU/Systemd (Aarch64) XNU's Not UNIX! MacOS (Arm64) FreeBSD OpenBSD NetBSD The New Technology Commentary
syscon pty TIOCPKT 0x5420 0x5420 0x80047470 0x80047470 0x80047470 0x80047470 0x80047470 -1 # boop
syscon pty TIOCPKT_DATA 0 0 0 0 0 0 0 0 # consensus
syscon pty TIOCPKT_FLUSHREAD 1 1 1 1 1 1 1 1 # unix consensus
syscon pty TIOCPKT_FLUSHWRITE 2 2 2 2 2 2 2 2 # unix consensus
syscon pty TIOCPKT_STOP 4 4 4 4 4 4 4 4 # unix consensus
syscon pty TIOCPKT_START 8 8 8 8 8 8 8 8 # unix consensus
syscon pty TIOCPKT_NOSTOP 16 16 16 16 16 16 16 16 # unix consensus
syscon pty TIOCPKT_DOSTOP 32 32 32 32 32 32 32 32 # unix consensus
syscon pty TIOCPKT_IOCTL 64 64 64 64 64 64 64 64 # unix consensus
# Modem Control
#
# group name GNU/Systemd GNU/Systemd (Aarch64) XNU's Not UNIX! MacOS (Arm64) FreeBSD OpenBSD NetBSD The New Technology Commentary
syscon modem TIOCMGET 0x5415 0x5415 0x4004746a 0x4004746a 0x4004746a 0x4004746a 0x4004746a -1 # get status of modem bits; ioctl(fd, TIOCMGET, int *argp)
syscon modem TIOCMSET 0x5418 0x5418 0x8004746d 0x8004746d 0x8004746d 0x8004746d 0x8004746d -1 # set status of modem bits; ioctl(fd, TIOCMSET, const int *argp)
syscon modem TIOCMBIC 0x5417 0x5417 0x8004746b 0x8004746b 0x8004746b 0x8004746b 0x8004746b -1 # clear indicated modem bits; ioctl(fd, TIOCMBIC, int *argp)
syscon modem TIOCMBIS 0x5416 0x5416 0x8004746c 0x8004746c 0x8004746c 0x8004746c 0x8004746c -1 # set indicated modem bits; ioctl(fd, TIOCMBIS, int *argp)
syscon modem TIOCM_LE 0b0000000000000001 0b0000000000000001 0b0000000000000001 0b0000000000000001 0b0000000000000001 0b0000000000000001 0b0000000000000001 0b0000000000000001 # consensus
syscon modem TIOCM_DTR 0b0000000000000010 0b0000000000000010 0b0000000000000010 0b0000000000000010 0b0000000000000010 0b0000000000000010 0b0000000000000010 0b0000000000000010 # consensus
syscon modem TIOCM_RTS 0b0000000000000100 0b0000000000000100 0b0000000000000100 0b0000000000000100 0b0000000000000100 0b0000000000000100 0b0000000000000100 0b0000000000000100 # consensus
syscon modem TIOCM_ST 0b0000000000001000 0b0000000000001000 0b0000000000001000 0b0000000000001000 0b0000000000001000 0b0000000000001000 0b0000000000001000 0b0000000000001000 # consensus
syscon modem TIOCM_SR 0b0000000000010000 0b0000000000010000 0b0000000000010000 0b0000000000010000 0b0000000000010000 0b0000000000010000 0b0000000000010000 0b0000000000010000 # consensus
syscon modem TIOCM_CTS 0b0000000000100000 0b0000000000100000 0b0000000000100000 0b0000000000100000 0b0000000000100000 0b0000000000100000 0b0000000000100000 0b0000000000100000 # consensus
syscon modem TIOCM_CAR 0b0000000001000000 0b0000000001000000 0b0000000001000000 0b0000000001000000 0b0000000001000000 0b0000000001000000 0b0000000001000000 0b0000000001000000 # consensus
syscon modem TIOCM_CD 0b0000000001000000 0b0000000001000000 0b0000000001000000 0b0000000001000000 0b0000000001000000 0b0000000001000000 0b0000000001000000 0b0000000001000000 # boop
syscon modem TIOCM_RI 0b0000000010000000 0b0000000010000000 0b0000000010000000 0b0000000010000000 0b0000000010000000 0b0000000010000000 0b0000000010000000 0b0000000010000000 # boop
syscon modem TIOCM_RNG 0b0000000010000000 0b0000000010000000 0b0000000010000000 0b0000000010000000 0b0000000010000000 0b0000000010000000 0b0000000010000000 0b0000000010000000 # boop
syscon modem TIOCM_DSR 0b0000000100000000 0b0000000100000000 0b0000000100000000 0b0000000100000000 0b0000000100000000 0b0000000100000000 0b0000000100000000 0b0000000100000000 # consensus
syscon modem TIOCM_DCD 0 0 0 0 0x40 0 0 -1 # wut
syscon modem TIOCMODG 0 0 0x40047403 0x40047403 0 0x4004746a 0x4004746a -1 # wut
syscon modem TIOCMODS 0 0 0x80047404 0x80047404 0 0x8004746d 0x8004746d -1 # wut
syscon modem TIOCMSDTRWAIT 0 0 0x8004745b 0x8004745b 0x8004745b 0 0 -1 # wut
# ioctl(SIOCGIFFLAGS) Network Interface Flags
#
# group name GNU/Systemd GNU/Systemd (Aarch64) XNU's Not UNIX! MacOS (Arm64) FreeBSD OpenBSD NetBSD The New Technology Commentary
syscon iff IFF_UP 1 1 1 1 1 1 1 1 # unix consensus
syscon iff IFF_BROADCAST 2 2 2 2 2 2 2 2 # valid broadcast address set; consensus
syscon iff IFF_DEBUG 4 4 4 4 4 4 4 4 # faked nt; consensus
syscon iff IFF_LOOPBACK 8 8 8 8 8 8 8 4 # is loopback device; consensus
syscon iff IFF_MULTICAST 0x1000 0x1000 0x8000 0x8000 0x8000 0x8000 0x8000 0x1000 # supports multicast; faked nt; bsd consensus
syscon iff IFF_ALLMULTI 0x0200 0x0200 0x0200 0x0200 0x0200 0x0200 0x0200 0x0200 # receive all multicast packets; faked nt; unix consensus
syscon iff IFF_NOARP 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 # faked nt as linux; unix consensus
syscon iff IFF_POINTOPOINT 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 # point-to-point; faked nt as linux; unix consensus
syscon iff IFF_PROMISC 0x100 0x100 0x100 0x100 0x100 0x100 0x100 0 # in packet capture mode; unix consensus
syscon iff IFF_RUNNING 0x40 0x40 0x40 0x40 0x40 0x40 0x40 0 # unix consensus (mostly for bsd compatibility?)