xref: /drstd/dlibc/src/unix/header/fcntl/mod.rs (revision a1cd34728e2d4a5d4cf41974e4db28602cbb1b1c)
1 //! fcntl implementation for Redox, following http://pubs.opengroup.org/onlinepubs/7908799/xsh/fcntl.h.html
2 
3 pub use self::platform::*;
4 use crate::unix::platform;
5 
6 #[no_mangle]
creat(path: *const ::c_char, mode: ::mode_t) -> ::c_int7 pub unsafe extern "C" fn creat(path: *const ::c_char, mode: ::mode_t) -> ::c_int {
8     sys_open(path, O_WRONLY | O_CREAT | O_TRUNC, mode)
9 }
10 #[repr(C)]
11 #[derive(Copy, Clone)]
12 pub struct flock {
13     pub l_type: ::c_short,
14     pub l_whence: ::c_short,
15     pub l_start: ::off_t,
16     pub l_len: ::off_t,
17     pub l_pid: ::pid_t,
18 }
19 #[no_mangle]
sys_fcntl(fildes: ::c_int, cmd: ::c_int, arg: ::c_int) -> ::c_int20 pub extern "C" fn sys_fcntl(fildes: ::c_int, cmd: ::c_int, arg: ::c_int) -> ::c_int {
21     platform::pal::fcntl(fildes, cmd, arg)
22 }
23 
24 #[no_mangle]
sys_open( path: *const ::c_char, oflag: ::c_int, mode: ::mode_t, ) -> ::c_int25 pub unsafe extern "C" fn sys_open(
26     path: *const ::c_char,
27     oflag: ::c_int,
28     mode: ::mode_t,
29 ) -> ::c_int {
30     platform::pal::open(path, oflag, mode)
31 }
32 
33 #[no_mangle]
cbindgen_stupid_struct_user_for_fcntl(_a: flock)34 pub unsafe extern "C" fn cbindgen_stupid_struct_user_for_fcntl(_a: flock) {}
35