Skip to content

Commit 6499a3e

Browse files
Add missing consts from sys/sysctl.h
1 parent 652abf1 commit 6499a3e

File tree

1 file changed

+85
-0
lines changed
  • src/unix/bsd/freebsdlike/freebsd

1 file changed

+85
-0
lines changed

src/unix/bsd/freebsdlike/freebsd/mod.rs

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -866,13 +866,75 @@ pub const CTL_HW: ::c_int = 6;
866866
pub const CTL_MACHDEP: ::c_int = 7;
867867
pub const CTL_USER: ::c_int = 8;
868868
pub const CTL_P1003_1B: ::c_int = 9;
869+
870+
// sys/sysctl.h
871+
pub const CTL_MAXNAME: ::c_int = 24;
872+
873+
pub const CTLTYPE: ::c_int = 0xf;
874+
pub const CTLTYPE_NODE: ::c_int = 1;
875+
pub const CTLTYPE_INT: ::c_int = 2;
876+
pub const CTLTYPE_STRING: ::c_int = 3;
877+
pub const CTLTYPE_S64: ::c_int = 4;
878+
pub const CTLTYPE_OPAQUE: ::c_int = 5;
879+
pub const CTLTYPE_STRUCT: ::c_int = CTLTYPE_OPAQUE;
880+
pub const CTLTYPE_UINT: ::c_int = 6;
881+
pub const CTLTYPE_LONG: ::c_int = 7;
882+
pub const CTLTYPE_ULONG: ::c_int = 8;
883+
pub const CTLTYPE_U64: ::c_int = 9;
884+
pub const CTLTYPE_U8: ::c_int = 0xa;
885+
pub const CTLTYPE_U16: ::c_int = 0xb;
886+
pub const CTLTYPE_S8: ::c_int = 0xc;
887+
pub const CTLTYPE_S16: ::c_int = 0xd;
888+
pub const CTLTYPE_S32: ::c_int = 0xe;
889+
pub const CTLTYPE_U32: ::c_int = 0xf;
890+
891+
pub const CTLFLAG_RD: ::c_int = 0x80000000;
892+
pub const CTLFLAG_WR: ::c_int = 0x40000000;
893+
pub const CTLFLAG_RW: ::c_int = CTLFLAG_RD | CTLFLAG_WR;
894+
pub const CTLFLAG_DORMANT: ::c_int = 0x20000000;
895+
pub const CTLFLAG_ANYBODY: ::c_int = 0x10000000;
896+
pub const CTLFLAG_SECURE: ::c_int = 0x08000000;
897+
pub const CTLFLAG_PRISON: ::c_int = 0x04000000;
898+
pub const CTLFLAG_DYN: ::c_int = 0x02000000;
899+
pub const CTLFLAG_SKIP: ::c_int = 0x01000000;
900+
pub const CTLMASK_SECURE: ::c_int = 0x00F00000;
901+
pub const CTLFLAG_TUN: ::c_int = 0x00080000;
902+
pub const CTLFLAG_RDTUN: ::c_int = CTLFLAG_RD | CTLFLAG_TUN;
903+
pub const CTLFLAG_RWTUN: ::c_int = CTLFLAG_RW | CTLFLAG_TUN;
904+
pub const CTLFLAG_MPSAFE: ::c_int = 0x00040000;
905+
pub const CTLFLAG_VNET: ::c_int = 0x00020000;
906+
pub const CTLFLAG_DYING: ::c_int = 0x00010000;
907+
pub const CTLFLAG_CAPRD: ::c_int = 0x00008000;
908+
pub const CTLFLAG_CAPWR: ::c_int = 0x00004000;
909+
pub const CTLFLAG_STATS: ::c_int = 0x00002000;
910+
pub const CTLFLAG_NOFETCH: ::c_int = 0x00001000;
911+
pub const CTLFLAG_CAPRW: ::c_int = CTLFLAG_CAPRD | CTLFLAG_CAPWR;
912+
cfg_if! {
913+
if #[cfg(freebsd13)] {
914+
pub const CTLFLAG_NEEDGIANT: ::c_int = 0x00000800;
915+
}
916+
}
917+
918+
pub const CTLSHIFT_SECURE: ::c_int = 20;
919+
pub const CTLFLAG_SECURE1: ::c_int = CTLFLAG_SECURE | (0 << CTLSHIFT_SECURE);
920+
pub const CTLFLAG_SECURE2: ::c_int = CTLFLAG_SECURE | (1 << CTLSHIFT_SECURE);
921+
pub const CTLFLAG_SECURE3: ::c_int = CTLFLAG_SECURE | (2 << CTLSHIFT_SECURE);
922+
923+
pub const OID_AUTO: ::c_int = -1;
924+
869925
pub const CTL_SYSCTL_DEBUG: ::c_int = 0;
870926
pub const CTL_SYSCTL_NAME: ::c_int = 1;
871927
pub const CTL_SYSCTL_NEXT: ::c_int = 2;
872928
pub const CTL_SYSCTL_NAME2OID: ::c_int = 3;
873929
pub const CTL_SYSCTL_OIDFMT: ::c_int = 4;
874930
pub const CTL_SYSCTL_OIDDESCR: ::c_int = 5;
875931
pub const CTL_SYSCTL_OIDLABEL: ::c_int = 6;
932+
cfg_if! {
933+
if #[cfg(freebsd13)] {
934+
pub const CTL_SYSCTL_NEXTNOSKIP: ::c_int = 7;
935+
}
936+
}
937+
876938
pub const KERN_OSTYPE: ::c_int = 1;
877939
pub const KERN_OSRELEASE: ::c_int = 2;
878940
pub const KERN_OSREV: ::c_int = 3;
@@ -910,6 +972,12 @@ pub const KERN_LOGSIGEXIT: ::c_int = 34;
910972
pub const KERN_IOV_MAX: ::c_int = 35;
911973
pub const KERN_HOSTUUID: ::c_int = 36;
912974
pub const KERN_ARND: ::c_int = 37;
975+
cfg_if! {
976+
if #[cfg(any(freebsd12, freebsd13))] {
977+
pub const KERN_MAXPHYS: ::c_int = 38;
978+
}
979+
}
980+
913981
pub const KERN_PROC_ALL: ::c_int = 0;
914982
pub const KERN_PROC_PID: ::c_int = 1;
915983
pub const KERN_PROC_PGRP: ::c_int = 2;
@@ -937,13 +1005,22 @@ pub const KERN_PROC_PS_STRINGS: ::c_int = 38;
9371005
pub const KERN_PROC_UMASK: ::c_int = 39;
9381006
pub const KERN_PROC_OSREL: ::c_int = 40;
9391007
pub const KERN_PROC_SIGTRAMP: ::c_int = 41;
1008+
pub const KERN_PROC_CWD: ::c_int = 42;
1009+
pub const KERN_PROC_NFDS: ::c_int = 43;
1010+
cfg_if! {
1011+
if #[cfg(freebsd13)] {
1012+
pub const KERN_PROC_SIGFASTBLK: ::c_int = 44;
1013+
}
1014+
}
1015+
9401016
pub const KIPC_MAXSOCKBUF: ::c_int = 1;
9411017
pub const KIPC_SOCKBUF_WASTE: ::c_int = 2;
9421018
pub const KIPC_SOMAXCONN: ::c_int = 3;
9431019
pub const KIPC_MAX_LINKHDR: ::c_int = 4;
9441020
pub const KIPC_MAX_PROTOHDR: ::c_int = 5;
9451021
pub const KIPC_MAX_HDR: ::c_int = 6;
9461022
pub const KIPC_MAX_DATALEN: ::c_int = 7;
1023+
9471024
pub const HW_MACHINE: ::c_int = 1;
9481025
pub const HW_MODEL: ::c_int = 2;
9491026
pub const HW_NCPU: ::c_int = 3;
@@ -956,6 +1033,7 @@ pub const HW_DISKSTATS: ::c_int = 9;
9561033
pub const HW_FLOATINGPT: ::c_int = 10;
9571034
pub const HW_MACHINE_ARCH: ::c_int = 11;
9581035
pub const HW_REALMEM: ::c_int = 12;
1036+
9591037
pub const USER_CS_PATH: ::c_int = 1;
9601038
pub const USER_BC_BASE_MAX: ::c_int = 2;
9611039
pub const USER_BC_DIM_MAX: ::c_int = 3;
@@ -976,6 +1054,12 @@ pub const USER_POSIX2_SW_DEV: ::c_int = 17;
9761054
pub const USER_POSIX2_UPE: ::c_int = 18;
9771055
pub const USER_STREAM_MAX: ::c_int = 19;
9781056
pub const USER_TZNAME_MAX: ::c_int = 20;
1057+
cfg_if! {
1058+
if #[cfg(freebsd13)] {
1059+
pub const USER_LOCALBASE: ::c_int = 21;
1060+
}
1061+
}
1062+
9791063
pub const CTL_P1003_1B_ASYNCHRONOUS_IO: ::c_int = 1;
9801064
pub const CTL_P1003_1B_MAPPED_FILES: ::c_int = 2;
9811065
pub const CTL_P1003_1B_MEMLOCK: ::c_int = 3;
@@ -1001,6 +1085,7 @@ pub const CTL_P1003_1B_SEM_NSEMS_MAX: ::c_int = 22;
10011085
pub const CTL_P1003_1B_SEM_VALUE_MAX: ::c_int = 23;
10021086
pub const CTL_P1003_1B_SIGQUEUE_MAX: ::c_int = 24;
10031087
pub const CTL_P1003_1B_TIMER_MAX: ::c_int = 25;
1088+
10041089
pub const TIOCGPTN: ::c_uint = 0x4004740f;
10051090
pub const TIOCPTMASTER: ::c_uint = 0x2000741c;
10061091
pub const TIOCSIG: ::c_uint = 0x2004745f;

0 commit comments

Comments
 (0)