| ... | @@ -32,6 +32,24 @@ pub const Kevent = extern struct { | ... | @@ -32,6 +32,24 @@ pub const Kevent = extern struct { |
| 32 | udata: usize, | 32 | udata: usize, |
| 33 | }; | 33 | }; |
| 34 | | 34 | |
| | 35 | // Modes and flags for dlopen() |
| | 36 | // include/dlfcn.h |
| | 37 | |
| | 38 | /// Bind function calls lazily. |
| | 39 | pub const RTLD_LAZY = 1; |
| | 40 | |
| | 41 | /// Bind function calls immediately. |
| | 42 | pub const RTLD_NOW = 2; |
| | 43 | |
| | 44 | /// Make symbols globally available. |
| | 45 | pub const RTLD_GLOBAL = 0x100; |
| | 46 | |
| | 47 | /// Opposite of RTLD_GLOBAL, and the default. |
| | 48 | pub const RTLD_LOCAL = 0x000; |
| | 49 | |
| | 50 | /// Trace loaded objects and exit. |
| | 51 | pub const RTLD_TRACE = 0x200; |
| | 52 | |
| 35 | pub const dl_phdr_info = extern struct { | 53 | pub const dl_phdr_info = extern struct { |
| 36 | dlpi_addr: std.elf.Addr, | 54 | dlpi_addr: std.elf.Addr, |
| 37 | dlpi_name: ?[*:0]const u8, | 55 | dlpi_name: ?[*:0]const u8, |
| ... | @@ -185,7 +203,17 @@ pub const libc_stat = extern struct { | ... | @@ -185,7 +203,17 @@ pub const libc_stat = extern struct { |
| 185 | | 203 | |
| 186 | pub const timespec = extern struct { | 204 | pub const timespec = extern struct { |
| 187 | tv_sec: time_t, | 205 | tv_sec: time_t, |
| 188 | tv_nsec: isize, | 206 | tv_nsec: c_long, |
| | 207 | }; |
| | 208 | |
| | 209 | pub const timeval = extern struct { |
| | 210 | tv_sec: time_t, |
| | 211 | tv_usec: c_long, |
| | 212 | }; |
| | 213 | |
| | 214 | pub const timezone = extern struct { |
| | 215 | tz_minuteswest: c_int, |
| | 216 | tz_dsttime: c_int, |
| 189 | }; | 217 | }; |
| 190 | | 218 | |
| 191 | pub const MAXNAMLEN = 255; | 219 | pub const MAXNAMLEN = 255; |
| ... | @@ -264,10 +292,13 @@ pub const AI_ADDRCONFIG = 64; | ... | @@ -264,10 +292,13 @@ pub const AI_ADDRCONFIG = 64; |
| 264 | | 292 | |
| 265 | pub const CTL_KERN = 1; | 293 | pub const CTL_KERN = 1; |
| 266 | pub const CTL_DEBUG = 5; | 294 | pub const CTL_DEBUG = 5; |
| | 295 | pub const CTL_HW = 6; |
| 267 | | 296 | |
| 268 | pub const KERN_PROC_ARGS = 55; | 297 | pub const KERN_PROC_ARGS = 55; |
| 269 | pub const KERN_PROC_ARGV = 1; | 298 | pub const KERN_PROC_ARGV = 1; |
| 270 | | 299 | |
| | 300 | pub const HW_NCPUONLINE = 25; |
| | 301 | |
| 271 | pub const PATH_MAX = 1024; | 302 | pub const PATH_MAX = 1024; |
| 272 | | 303 | |
| 273 | pub const STDIN_FILENO = 0; | 304 | pub const STDIN_FILENO = 0; |
| ... | @@ -450,6 +481,36 @@ pub const SOCK_SEQPACKET = 5; | ... | @@ -450,6 +481,36 @@ pub const SOCK_SEQPACKET = 5; |
| 450 | pub const SOCK_CLOEXEC = 0x8000; | 481 | pub const SOCK_CLOEXEC = 0x8000; |
| 451 | pub const SOCK_NONBLOCK = 0x4000; | 482 | pub const SOCK_NONBLOCK = 0x4000; |
| 452 | | 483 | |
| | 484 | pub const SO_DEBUG = 0x0001; |
| | 485 | pub const SO_ACCEPTCONN = 0x0002; |
| | 486 | pub const SO_REUSEADDR = 0x0004; |
| | 487 | pub const SO_KEEPALIVE = 0x0008; |
| | 488 | pub const SO_DONTROUTE = 0x0010; |
| | 489 | pub const SO_BROADCAST = 0x0020; |
| | 490 | pub const SO_USELOOPBACK = 0x0040; |
| | 491 | pub const SO_LINGER = 0x0080; |
| | 492 | pub const SO_OOBINLINE = 0x0100; |
| | 493 | pub const SO_REUSEPORT = 0x0200; |
| | 494 | pub const SO_TIMESTAMP = 0x0800; |
| | 495 | pub const SO_BINDANY = 0x1000; |
| | 496 | pub const SO_ZEROIZE = 0x2000; |
| | 497 | pub const SO_SNDBUF = 0x1001; |
| | 498 | pub const SO_RCVBUF = 0x1002; |
| | 499 | pub const SO_SNDLOWAT = 0x1003; |
| | 500 | pub const SO_RCVLOWAT = 0x1004; |
| | 501 | pub const SO_SNDTIMEO = 0x1005; |
| | 502 | pub const SO_RCVTIMEO = 0x1006; |
| | 503 | pub const SO_ERROR = 0x1007; |
| | 504 | pub const SO_TYPE = 0x1008; |
| | 505 | pub const SO_NETPROC = 0x1020; |
| | 506 | pub const SO_RTABLE = 0x1021; |
| | 507 | pub const SO_PEERCRED = 0x1022; |
| | 508 | pub const SO_SPLICE = 0x1023; |
| | 509 | pub const SO_DOMAIN = 0x1024; |
| | 510 | pub const SO_PROTOCOL = 0x1025; |
| | 511 | |
| | 512 | pub const SOL_SOCKET = 0xffff; |
| | 513 | |
| 453 | pub const PF_UNSPEC = AF_UNSPEC; | 514 | pub const PF_UNSPEC = AF_UNSPEC; |
| 454 | pub const PF_LOCAL = AF_LOCAL; | 515 | pub const PF_LOCAL = AF_LOCAL; |
| 455 | pub const PF_UNIX = AF_UNIX; | 516 | pub const PF_UNIX = AF_UNIX; |