syscalls_rust/
types.rs

1#![allow(non_camel_case_types)]
2
3use std::ffi::{c_char, c_int, c_long, c_short, c_uchar, c_uint, c_ulong, c_ushort};
4
5
6pub type umode_t = c_ushort;
7pub type nlink_t = u32;
8pub type off_t = c_long;
9
10pub type uid_t = c_uint;
11pub type gid_t = c_uint;
12
13pub type uintptr_t = c_ulong;
14pub type intptr_t = c_long;
15
16pub type size_t = c_ulong;
17pub type pid_t = c_int;
18
19pub type ssize_t = c_long;
20
21pub type u_char = c_uchar;
22pub type u_short = c_ushort;
23pub type u_int = c_uint;
24pub type u_long = c_ulong;
25pub type sa_family_t = c_ushort;
26pub type mode_t = c_ushort;
27
28
29#[repr(C)]
30#[derive(Debug)]
31pub struct sockaddr {
32	pub sa_family: sa_family_t,	/* address family, AF_xxx	*/
33	sa_data_min: [c_char; 14],		/* Minimum 14 bytes of protocol address	*/
34}
35
36
37#[repr(C)]
38#[derive(Debug)]
39pub struct Stat {
40	pub st_dev: c_uint,
41	pub st_ino: c_uint,
42	pub st_mode: c_uint,
43	pub st_nlink: c_uint,
44	pub st_uid: c_uint,
45	pub st_gid: c_uint,
46	pub st_rdev: c_uint,
47	pub st_size: c_long,
48	pub st_atime: c_ulong,
49	pub st_mtime: c_ulong,
50	pub st_ctime: c_ulong,
51	pub st_blksize: c_uint,
52	pub st_blocks: c_uint,
53	pub st_flags: c_uint,
54	pub st_gen: c_uint,
55}
56
57#[repr(C)]
58#[derive(Debug)]
59pub struct Pollfd {
60	pub fd: c_int,
61	pub events: c_short,
62	pub revents: c_short,
63}