interplane.Get Omega
Read in your language

aienux

Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.

Brought by drakestapleton

branch main Branches Tags History

aienux / vendor / libc / src / unix / newlib / vita / mod.rs

233 lines · 6506 bytes Raw Blame History
1use crate::off_t;
2use crate::prelude::*;
3
4pub type clock_t = c_long;
5
6pub type wchar_t = u32;
7
8pub type sigset_t = c_ulong;
9
10s! {
11 pub struct msghdr {
12 pub msg_name: *mut c_void,
13 pub msg_namelen: crate::socklen_t,
14 pub msg_iov: *mut crate::iovec,
15 pub msg_iovlen: c_int,
16 pub msg_control: *mut c_void,
17 pub msg_controllen: crate::socklen_t,
18 pub msg_flags: c_int,
19 }
20
21 pub struct sockaddr {
22 pub sa_len: u8,
23 pub sa_family: crate::sa_family_t,
24 pub sa_data: [c_char; 14],
25 }
26
27 pub struct sockaddr_in6 {
28 pub sin6_len: u8,
29 pub sin6_family: crate::sa_family_t,
30 pub sin6_port: crate::in_port_t,
31 pub sin6_flowinfo: u32,
32 pub sin6_addr: crate::in6_addr,
33 pub sin6_vport: crate::in_port_t,
34 pub sin6_scope_id: u32,
35 }
36
37 pub struct sockaddr_in {
38 pub sin_len: u8,
39 pub sin_family: crate::sa_family_t,
40 pub sin_port: crate::in_port_t,
41 pub sin_addr: crate::in_addr,
42 pub sin_vport: crate::in_port_t,
43 pub sin_zero: [u8; 6],
44 }
45
46 pub struct sockaddr_un {
47 pub ss_len: u8,
48 pub sun_family: crate::sa_family_t,
49 pub sun_path: [c_char; 108usize],
50 }
51
52 pub struct sockaddr_storage {
53 pub ss_len: u8,
54 pub ss_family: crate::sa_family_t,
55 __ss_pad1: Padding<[u8; 2]>,
56 __ss_align: i64,
57 __ss_pad2: Padding<[u8; 116]>,
58 }
59
60 pub struct sched_param {
61 pub sched_priority: c_int,
62 }
63
64 pub struct stat {
65 pub st_dev: crate::dev_t,
66 pub st_ino: crate::ino_t,
67 pub st_mode: crate::mode_t,
68 pub st_nlink: crate::nlink_t,
69 pub st_uid: crate::uid_t,
70 pub st_gid: crate::gid_t,
71 pub st_rdev: crate::dev_t,
72 pub st_size: off_t,
73 pub st_atime: crate::time_t,
74 pub st_mtime: crate::time_t,
75 pub st_ctime: crate::time_t,
76 pub st_blksize: crate::blksize_t,
77 pub st_blocks: crate::blkcnt_t,
78 pub st_spare4: [c_long; 2usize],
79 }
80
81 #[repr(align(8))]
82 pub struct dirent {
83 __offset: [u8; 88],
84 pub d_name: [c_char; 256usize],
85 __pad: Padding<[u8; 8]>,
86 }
87}
88
89pub const AF_UNIX: c_int = 1;
90pub const AF_INET6: c_int = 24;
91
92pub const SOCK_RAW: c_int = 3;
93pub const SOCK_RDM: c_int = 4;
94pub const SOCK_SEQPACKET: c_int = 5;
95
96pub const SOMAXCONN: c_int = 128;
97
98pub const FIONBIO: c_ulong = 1;
99
100pub const POLLIN: c_short = 0x0001;
101pub const POLLPRI: c_short = POLLIN;
102pub const POLLOUT: c_short = 0x0004;
103pub const POLLRDNORM: c_short = POLLIN;
104pub const POLLRDBAND: c_short = POLLIN;
105pub const POLLWRNORM: c_short = POLLOUT;
106pub const POLLWRBAND: c_short = POLLOUT;
107pub const POLLERR: c_short = 0x0008;
108pub const POLLHUP: c_short = 0x0010;
109pub const POLLNVAL: c_short = 0x0020;
110
111pub const RTLD_DEFAULT: *mut c_void = ptr::null_mut();
112
113pub const SOL_SOCKET: c_int = 0xffff;
114pub const SO_NONBLOCK: c_int = 0x1100;
115
116pub const MSG_OOB: c_int = 0x1;
117pub const MSG_PEEK: c_int = 0x2;
118pub const MSG_DONTROUTE: c_int = 0x4;
119pub const MSG_EOR: c_int = 0x8;
120pub const MSG_TRUNC: c_int = 0x10;
121pub const MSG_CTRUNC: c_int = 0x20;
122pub const MSG_WAITALL: c_int = 0x40;
123pub const MSG_DONTWAIT: c_int = 0x80;
124pub const MSG_BCAST: c_int = 0x100;
125pub const MSG_MCAST: c_int = 0x200;
126
127pub const UTIME_OMIT: c_long = -1;
128pub const AT_FDCWD: c_int = -2;
129
130pub const O_DIRECTORY: c_int = 0x200000;
131pub const O_NOFOLLOW: c_int = 0x100000;
132
133pub const AT_EACCESS: c_int = 1;
134pub const AT_SYMLINK_NOFOLLOW: c_int = 2;
135pub const AT_SYMLINK_FOLLOW: c_int = 4;
136pub const AT_REMOVEDIR: c_int = 8;
137
138pub const SIGHUP: c_int = 1;
139pub const SIGINT: c_int = 2;
140pub const SIGQUIT: c_int = 3;
141pub const SIGILL: c_int = 4;
142pub const SIGTRAP: c_int = 5;
143pub const SIGABRT: c_int = 6;
144pub const SIGEMT: c_int = 7;
145pub const SIGFPE: c_int = 8;
146pub const SIGKILL: c_int = 9;
147pub const SIGBUS: c_int = 10;
148pub const SIGSEGV: c_int = 11;
149pub const SIGSYS: c_int = 12;
150pub const SIGPIPE: c_int = 13;
151pub const SIGALRM: c_int = 14;
152pub const SIGTERM: c_int = 15;
153
154pub const EAI_BADFLAGS: c_int = -1;
155pub const EAI_NONAME: c_int = -2;
156pub const EAI_AGAIN: c_int = -3;
157pub const EAI_FAIL: c_int = -4;
158pub const EAI_NODATA: c_int = -5;
159pub const EAI_FAMILY: c_int = -6;
160pub const EAI_SOCKTYPE: c_int = -7;
161pub const EAI_SERVICE: c_int = -8;
162pub const EAI_ADDRFAMILY: c_int = -9;
163pub const EAI_MEMORY: c_int = -10;
164pub const EAI_SYSTEM: c_int = -11;
165pub const EAI_OVERFLOW: c_int = -12;
166
167pub const PTHREAD_STACK_MIN: size_t = 32 * 1024;
168
169pub const IP_HDRINCL: c_int = 2;
170
171extern "C" {
172 pub fn futimens(fd: c_int, times: *const crate::timespec) -> c_int;
173 pub fn writev(fd: c_int, iov: *const crate::iovec, iovcnt: c_int) -> ssize_t;
174 pub fn readv(fd: c_int, iov: *const crate::iovec, iovcnt: c_int) -> ssize_t;
175
176 pub fn sendmsg(s: c_int, msg: *const crate::msghdr, flags: c_int) -> ssize_t;
177 pub fn recvmsg(s: c_int, msg: *mut crate::msghdr, flags: c_int) -> ssize_t;
178
179 pub fn pthread_create(
180 native: *mut crate::pthread_t,
181 attr: *const crate::pthread_attr_t,
182 f: extern "C" fn(_: *mut c_void) -> *mut c_void,
183 value: *mut c_void,
184 ) -> c_int;
185
186 pub fn pthread_attr_getschedparam(
187 attr: *const crate::pthread_attr_t,
188 param: *mut sched_param,
189 ) -> c_int;
190
191 pub fn pthread_attr_setschedparam(
192 attr: *mut crate::pthread_attr_t,
193 param: *const sched_param,
194 ) -> c_int;
195
196 pub fn pthread_attr_getprocessorid_np(
197 attr: *const crate::pthread_attr_t,
198 processor_id: *mut c_int,
199 ) -> c_int;
200
201 pub fn pthread_attr_setprocessorid_np(
202 attr: *mut crate::pthread_attr_t,
203 processor_id: c_int,
204 ) -> c_int;
205
206 pub fn pthread_getschedparam(
207 native: crate::pthread_t,
208 policy: *mut c_int,
209 param: *mut crate::sched_param,
210 ) -> c_int;
211
212 pub fn pthread_setschedparam(
213 native: crate::pthread_t,
214 policy: c_int,
215 param: *const crate::sched_param,
216 ) -> c_int;
217
218 pub fn pthread_condattr_getclock(
219 attr: *const crate::pthread_condattr_t,
220 clock_id: *mut crate::clockid_t,
221 ) -> c_int;
222
223 pub fn pthread_condattr_setclock(
224 attr: *mut crate::pthread_condattr_t,
225 clock_id: crate::clockid_t,
226 ) -> c_int;
227
228 pub fn pthread_getprocessorid_np() -> c_int;
229
230 pub fn getentropy(buf: *mut c_void, buflen: size_t) -> c_int;
231
232 pub fn pipe2(fds: *mut c_int, flags: c_int) -> c_int;
233}