File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ pub type blkcnt_t = c_ulong;
66pub type blksize_t = c_long ;
77pub type clock_t = c_long ;
88pub type clockid_t = c_int ;
9- pub type dev_t = c_long ;
9+ pub type dev_t = c_ulonglong ;
1010pub type fsblkcnt_t = c_ulong ;
1111pub type fsfilcnt_t = c_ulong ;
1212pub type ino_t = c_ulonglong ;
@@ -1162,6 +1162,31 @@ safe_f! {
11621162 pub const fn WCOREDUMP ( status: c_int) -> bool {
11631163 ( status & 0x80 ) != 0
11641164 }
1165+
1166+ pub const fn makedev( major: c_uint, minor: c_uint) -> dev_t {
1167+ let major = major as dev_t;
1168+ let minor = minor as dev_t;
1169+ let mut dev = 0 ;
1170+ dev |= ( major & 0x00000fff ) << 8 ;
1171+ dev |= ( major & 0xfffff000 ) << 32 ;
1172+ dev |= ( minor & 0x000000ff ) << 0 ;
1173+ dev |= ( minor & 0xffffff00 ) << 12 ;
1174+ dev
1175+ }
1176+
1177+ pub const fn major( dev: dev_t) -> c_uint {
1178+ let mut major = 0 ;
1179+ major |= ( dev & 0x00000000000fff00 ) >> 8 ;
1180+ major |= ( dev & 0xfffff00000000000 ) >> 32 ;
1181+ major as c_uint
1182+ }
1183+
1184+ pub const fn minor( dev: dev_t) -> c_uint {
1185+ let mut minor = 0 ;
1186+ minor |= ( dev & 0x00000000000000ff ) >> 0 ;
1187+ minor |= ( dev & 0x00000ffffff00000 ) >> 12 ;
1188+ minor as c_uint
1189+ }
11651190}
11661191
11671192extern "C" {
You can’t perform that action at this time.
0 commit comments