syscalls/types.rs
1#![allow(non_camel_case_types)]
2
3use std::ffi::{c_char, c_int, c_long, c_uchar, c_uint, c_ulong, c_ushort};
4
5// pub type s128 = __s128;
6// pub type u128 = __u128;
7
8// pub type __kernel_dev_t = u32;
9
10// pub type fd_set = __kernel_fd_set;
11// pub type dev_t = __kernel_dev_t;
12// pub type ino_t = __kernel_ulong_t;
13// pub type mode_t = __kernel_mode_t;
14pub type umode_t = c_ushort;
15pub type nlink_t = u32;
16pub type off_t = c_long;
17// pub type daddr_t = __kernel_daddr_t;
18// pub type key_t = __kernel_key_t;
19// pub type suseconds_t = __kernel_suseconds_t;
20// pub type timer_t = __kernel_timer_t;
21// pub type clockid_t = __kernel_clockid_t;
22// pub type mqd_t = __kernel_mqd_t;
23
24pub type uid_t = c_uint;
25pub type gid_t = c_uint;
26// pub type uid16_t = __kernel_uid16_t;
27// pub type gid16_t = __kernel_gid16_t;
28
29pub type uintptr_t = c_ulong;
30pub type intptr_t = c_long;
31
32pub type size_t = c_ulong;
33pub type pid_t = c_int;
34
35pub type ssize_t = c_long;
36
37pub type u_char = c_uchar;
38pub type u_short = c_ushort;
39pub type u_int = c_uint;
40pub type u_long = c_ulong;
41pub type sa_family_t = c_ushort;
42
43
44#[repr(C)]
45#[derive(Debug)]
46pub struct sockaddr {
47 pub sa_family: sa_family_t, /* address family, AF_xxx */
48 sa_data_min: [c_char; 14], /* Minimum 14 bytes of protocol address */
49}