aboutsummaryrefslogtreecommitdiff
path: root/libc/src/unix/bsd/netbsdlike/openbsdlike/mod.rs
diff options
context:
space:
mode:
authorDaniel Mueller <deso@posteo.net>2018-12-10 21:00:27 -0800
committerDaniel Mueller <deso@posteo.net>2018-12-10 21:00:27 -0800
commite2604a756aaddcd5919ee2f1b9cc0055d200f846 (patch)
tree1ea1b9900db20d3aadbddbce18882d0c957247d7 /libc/src/unix/bsd/netbsdlike/openbsdlike/mod.rs
parent5875df6c958743cf86c75b2cb5fc2efe5ca0de43 (diff)
downloadnitrocli-e2604a756aaddcd5919ee2f1b9cc0055d200f846.tar.gz
nitrocli-e2604a756aaddcd5919ee2f1b9cc0055d200f846.tar.bz2
Update libc crate to 0.2.45
This change updates the libc crate to version 0.2.45. Import subrepo libc/:libc at f5636fc618f8e16968b3178196d73c94ad9f7b05
Diffstat (limited to 'libc/src/unix/bsd/netbsdlike/openbsdlike/mod.rs')
-rw-r--r--libc/src/unix/bsd/netbsdlike/openbsdlike/mod.rs57
1 files changed, 36 insertions, 21 deletions
diff --git a/libc/src/unix/bsd/netbsdlike/openbsdlike/mod.rs b/libc/src/unix/bsd/netbsdlike/openbsdlike/mod.rs
index 1f40e34..85f0a02 100644
--- a/libc/src/unix/bsd/netbsdlike/openbsdlike/mod.rs
+++ b/libc/src/unix/bsd/netbsdlike/openbsdlike/mod.rs
@@ -14,6 +14,7 @@ pub type pthread_cond_t = *mut ::c_void;
pub type pthread_condattr_t = *mut ::c_void;
pub type pthread_rwlock_t = *mut ::c_void;
pub type pthread_rwlockattr_t = *mut ::c_void;
+pub type caddr_t = *mut ::c_char;
s! {
pub struct dirent {
@@ -187,6 +188,20 @@ s! {
pub sdl_slen: ::c_uchar,
pub sdl_data: [::c_char; 24],
}
+
+ pub struct sockpeercred {
+ pub uid: ::uid_t,
+ pub gid: ::gid_t,
+ pub pid: ::pid_t,
+ }
+
+ pub struct arphdr {
+ pub ar_hrd: u16,
+ pub ar_pro: u16,
+ pub ar_hln: u8,
+ pub ar_pln: u8,
+ pub ar_op: u16,
+ }
}
pub const UT_NAMESIZE: usize = 32;
@@ -236,24 +251,6 @@ pub const SO_RTABLE: ::c_int = 0x1021;
pub const SO_PEERCRED: ::c_int = 0x1022;
pub const SO_SPLICE: ::c_int = 0x1023;
-// https://github.com/openbsd/src/blob/master/sys/net/if.h#L187
-pub const IFF_UP: ::c_int = 0x1; // interface is up
-pub const IFF_BROADCAST: ::c_int = 0x2; // broadcast address valid
-pub const IFF_DEBUG: ::c_int = 0x4; // turn on debugging
-pub const IFF_LOOPBACK: ::c_int = 0x8; // is a loopback net
-pub const IFF_POINTOPOINT: ::c_int = 0x10; // interface is point-to-point link
-pub const IFF_NOTRAILERS: ::c_int = 0x20; // avoid use of trailers
-pub const IFF_RUNNING: ::c_int = 0x40; // resources allocated
-pub const IFF_NOARP: ::c_int = 0x80; // no address resolution protocol
-pub const IFF_PROMISC: ::c_int = 0x100; // receive all packets
-pub const IFF_ALLMULTI: ::c_int = 0x200; // receive all multicast packets
-pub const IFF_OACTIVE: ::c_int = 0x400; // transmission in progress
-pub const IFF_SIMPLEX: ::c_int = 0x800; // can't hear own transmissions
-pub const IFF_LINK0: ::c_int = 0x1000; // per link layer defined bit
-pub const IFF_LINK1: ::c_int = 0x2000; // per link layer defined bit
-pub const IFF_LINK2: ::c_int = 0x4000; // per link layer defined bit
-pub const IFF_MULTICAST: ::c_int = 0x8000; // supports multicast
-
// sys/netinet/in.h
// Protocols (RFC 1700)
// NOTE: These are in addition to the constants defined in src/unix/mod.rs
@@ -320,6 +317,13 @@ pub const IPPROTO_MAX: ::c_int = 256;
/// Divert sockets
pub const IPPROTO_DIVERT: ::c_int = 258;
+pub const IP_RECVDSTADDR: ::c_int = 7;
+pub const IP_SENDSRCADDR: ::c_int = IP_RECVDSTADDR;
+
+// sys/netinet/in.h
+pub const TCP_MD5SIG: ::c_int = 0x04;
+pub const TCP_NOPUSH: ::c_int = 0x10;
+
pub const AF_ECMA: ::c_int = 8;
pub const AF_ROUTE: ::c_int = 17;
pub const AF_ENCAP: ::c_int = 28;
@@ -588,6 +592,7 @@ pub const CTL_MACHDEP: ::c_int = 7;
pub const CTL_DDB: ::c_int = 9;
pub const CTL_VFS: ::c_int = 10;
pub const CTL_MAXID: ::c_int = 11;
+pub const HW_NCPUONLINE: ::c_int = 25;
pub const KERN_OSTYPE: ::c_int = 1;
pub const KERN_OSRELEASE: ::c_int = 2;
pub const KERN_OSREV: ::c_int = 3;
@@ -662,7 +667,9 @@ pub const KERN_PROC_VMMAP: ::c_int = 80;
pub const KERN_GLOBAL_PTRACE: ::c_int = 81;
pub const KERN_CONSBUFSIZE: ::c_int = 82;
pub const KERN_CONSBUF: ::c_int = 83;
-pub const KERN_MAXID: ::c_int = 84;
+pub const KERN_AUDIO: ::c_int = 84;
+pub const KERN_CPUSTATS: ::c_int = 85;
+pub const KERN_MAXID: ::c_int = 86;
pub const KERN_PROC_ALL: ::c_int = 0;
pub const KERN_PROC_PID: ::c_int = 1;
pub const KERN_PROC_PGRP: ::c_int = 2;
@@ -694,6 +701,8 @@ pub const SOCK_CLOEXEC: ::c_int = 0x8000;
pub const SOCK_NONBLOCK: ::c_int = 0x4000;
pub const SOCK_DNS: ::c_int = 0x1000;
+pub const PTRACE_FORK: ::c_int = 0x0002;
+
pub const WCONTINUED: ::c_int = 8;
f! {
@@ -703,6 +712,10 @@ f! {
}
extern {
+ pub fn chflags(path: *const ::c_char, flags: ::c_uint) -> ::c_int;
+ pub fn fchflags(fd: ::c_int, flags: ::c_uint) -> ::c_int;
+ pub fn chflagsat(fd: ::c_int, path: *const ::c_char, flags: ::c_uint,
+ atflag: ::c_int) -> ::c_int;
pub fn dirfd(dirp: *mut ::DIR) -> ::c_int;
pub fn getnameinfo(sa: *const ::sockaddr,
salen: ::socklen_t,
@@ -731,10 +744,12 @@ extern {
newlen: ::size_t)
-> ::c_int;
pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int;
- pub fn pledge(promises: *const ::c_char,
- paths: *mut *const ::c_char) -> ::c_int;
pub fn setresgid(rgid: ::gid_t, egid: ::gid_t, sgid: ::gid_t) -> ::c_int;
pub fn setresuid(ruid: ::uid_t, euid: ::uid_t, suid: ::uid_t) -> ::c_int;
+ pub fn ptrace(request: ::c_int,
+ pid: ::pid_t,
+ addr: caddr_t,
+ data: ::c_int) -> ::c_int;
}
cfg_if! {