lockf implementation proposal
This commit is contained in:
@@ -63,7 +63,7 @@ fn dup_write<T>(fd: c_int, name: &str, t: &T) -> syscall::Result<usize> {
|
||||
pub unsafe extern "C" fn ioctl(fd: c_int, request: c_ulong, out: *mut c_void) -> c_int {
|
||||
match request {
|
||||
FIONBIO => {
|
||||
let mut flags = fcntl::sys_fcntl(fd, fcntl::F_GETFL, 0);
|
||||
let mut flags = fcntl::sys_fcntl(fd, fcntl::F_GETFL, 0usize);
|
||||
if flags < 0 {
|
||||
return -1;
|
||||
}
|
||||
@@ -72,7 +72,7 @@ pub unsafe extern "C" fn ioctl(fd: c_int, request: c_ulong, out: *mut c_void) ->
|
||||
} else {
|
||||
flags | fcntl::O_NONBLOCK
|
||||
};
|
||||
if fcntl::sys_fcntl(fd, fcntl::F_SETFL, flags) < 0 {
|
||||
if fcntl::sys_fcntl(fd, fcntl::F_SETFL, flags as c_ulonglong) < 0 {
|
||||
-1
|
||||
} else {
|
||||
0
|
||||
|
||||
Reference in New Issue
Block a user