File tree Expand file tree Collapse file tree 1 file changed +7
-40
lines changed Expand file tree Collapse file tree 1 file changed +7
-40
lines changed Original file line number Diff line number Diff line change @@ -413,13 +413,13 @@ s! {
413413 pub mq_curmsgs: :: c_long,
414414 }
415415
416- pub struct FLock {
417- l_type: :: c_short,
418- l_whence: :: c_short,
419- l_start: :: c_long,
420- l_len: :: c_long,
421- l_pid: :: c_short,
422- l_xxx: :: c_short,
416+ pub struct flock {
417+ pub l_type: :: c_short,
418+ pub l_whence: :: c_short,
419+ pub l_start: :: c_long,
420+ pub l_len: :: c_long,
421+ pub l_pid: :: c_short,
422+ pub l_xxx: :: c_short,
423423 }
424424}
425425
@@ -955,10 +955,6 @@ pub const F_DUPFD_CLOEXEC: ::c_int = 14;
955955pub const F_RDLCK : :: c_int = 1 ;
956956pub const F_WRLCK : :: c_int = 2 ;
957957pub const F_UNLCK : :: c_int = 3 ;
958- pub const LOCK_SH : :: c_int = 1 ;
959- pub const LOCK_EX : :: c_int = 2 ;
960- pub const LOCK_NB : :: c_int = 4 ;
961- pub const LOCK_UN : :: c_int = 8 ;
962958
963959// signal.h
964960pub const SIG_DFL : sighandler_t = 0 as sighandler_t ;
@@ -2029,35 +2025,6 @@ pub unsafe fn posix_memalign(
20292025 }
20302026}
20312027
2032- pub unsafe fn flock ( fd : :: c_int , operation : :: c_int ) -> :: c_int {
2033- let lock_type = match operation & !LOCK_NB {
2034- LOCK_SH => F_RDLCK ,
2035- LOCK_EX => F_WRLCK ,
2036- LOCK_UN => F_UNLCK ,
2037- _ => {
2038- errnoSet ( EINVAL ) ;
2039- return ERROR ;
2040- }
2041- } ;
2042-
2043- let request = if operation & LOCK_NB != 0 {
2044- F_SETLK
2045- } else {
2046- F_SETLKW
2047- } ;
2048-
2049- let mut argument = FLock {
2050- l_type : lock_type as i16 ,
2051- l_whence : SEEK_SET as i16 ,
2052- l_start : 0 ,
2053- l_len : 0 ,
2054- l_pid : 0 ,
2055- l_xxx : 0 ,
2056- } ;
2057-
2058- return ioctl ( fd, request, core:: ptr:: addr_of_mut!( argument) ) ;
2059- }
2060-
20612028pub use ffi:: c_void;
20622029
20632030cfg_if ! {
You can’t perform that action at this time.
0 commit comments