Skip to content

Commit 122f95d

Browse files
committed
Auto merge of #2292 - devnexen:netbsd_libutil_upd, r=Amanieu
netbsd adding couple of handy helpers from lb=ibutil
2 parents dc576de + b9d89c7 commit 122f95d

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

libc-test/build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -943,6 +943,7 @@ fn test_netbsd(target: &str) {
943943
"semaphore.h",
944944
"signal.h",
945945
"string.h",
946+
"sys/endian.h",
946947
"sys/extattr.h",
947948
"sys/file.h",
948949
"sys/ioctl.h",

libc-test/semver/netbsd.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,8 +1088,13 @@ freeifaddrs
10881088
freelocale
10891089
fsid_t
10901090
futimes
1091+
getbootfile
1092+
getbyteorder
1093+
getdiskrawname
1094+
getdistcookedname
10911095
getdomainname
10921096
getdtablesize
1097+
getfsspecname
10931098
getgrent
10941099
getgrent_r
10951100
getgrgid

src/unix/bsd/netbsdlike/netbsd/mod.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1453,6 +1453,9 @@ pub const TIME_OOP: ::c_int = 3;
14531453
pub const TIME_WAIT: ::c_int = 4;
14541454
pub const TIME_ERROR: ::c_int = 5;
14551455

1456+
pub const LITTLE_ENDIAN: ::c_int = 1234;
1457+
pub const BIG_ENDIAN: ::c_int = 4321;
1458+
14561459
cfg_if! {
14571460
if #[cfg(any(target_arch = "sparc", target_arch = "sparc64",
14581461
target_arch = "x86", target_arch = "x86_64"))] {
@@ -2258,6 +2261,24 @@ extern "C" {
22582261
val: u64,
22592262
max: ::size_t,
22602263
) -> ::c_int;
2264+
2265+
pub fn getbootfile() -> *const ::c_char;
2266+
pub fn getbyteorder() -> ::c_int;
2267+
pub fn getdiskrawname(
2268+
buf: *mut ::c_char,
2269+
buflen: ::size_t,
2270+
name: *const ::c_char,
2271+
) -> *const ::c_char;
2272+
pub fn getdiskcookedname(
2273+
buf: *mut ::c_char,
2274+
buflen: ::size_t,
2275+
name: *const ::c_char,
2276+
) -> *const ::c_char;
2277+
pub fn getfsspecname(
2278+
buf: *mut ::c_char,
2279+
buflen: ::size_t,
2280+
spec: *const ::c_char,
2281+
) -> *const ::c_char;
22612282
}
22622283

22632284
cfg_if! {

0 commit comments

Comments
 (0)