Skip to content

Commit 43c316e

Browse files
committed
adding gethostid/sethostid to most unixes (redox still unimplemented at
the moment).
1 parent 3af2448 commit 43c316e

File tree

14 files changed

+28
-0
lines changed

14 files changed

+28
-0
lines changed

libc-test/semver/apple.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1649,6 +1649,7 @@ getgrgid_r
16491649
getgrnam
16501650
getgrnam_r
16511651
getgrouplist
1652+
gethostid
16521653
getifaddrs
16531654
getitimer
16541655
getline
@@ -1863,6 +1864,7 @@ sendmsg
18631864
setdomainname
18641865
setgrent
18651866
setgroups
1867+
sethostid
18661868
sethostname
18671869
setitimer
18681870
setpriority

libc-test/semver/dragonfly.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1219,6 +1219,7 @@ getgrgid_r
12191219
getgrnam
12201220
getgrnam_r
12211221
getgrouplist
1222+
gethostid
12221223
getifaddrs
12231224
getitimer
12241225
getline
@@ -1375,6 +1376,7 @@ sendmsg
13751376
setdomainname
13761377
setgrent
13771378
setgroups
1379+
sethostid
13781380
sethostname
13791381
setitimer
13801382
setpriority

libc-test/semver/freebsd.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1421,6 +1421,7 @@ getgrgid_r
14211421
getgrnam
14221422
getgrnam_r
14231423
getgrouplist
1424+
gethostid
14241425
getifaddrs
14251426
getitimer
14261427
getline
@@ -1643,6 +1644,7 @@ sendmsg
16431644
setdomainname
16441645
setgrent
16451646
setgroups
1647+
sethostid
16461648
sethostname
16471649
setitimer
16481650
setpriority

libc-test/semver/linux-gnu.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,7 @@ qsort_r
569569
reallocarray
570570
semid_ds
571571
seminfo
572+
sethostid
572573
setutxent
573574
setxattr
574575
sgetspent_r

libc-test/semver/linux.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2738,6 +2738,7 @@ getgrgid_r
27382738
getgrnam
27392739
getgrnam_r
27402740
getgrouplist
2741+
gethostid
27412742
getifaddrs
27422743
getline
27432744
getloadavg

libc-test/semver/netbsd.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1118,6 +1118,7 @@ getgrgid_r
11181118
getgrnam
11191119
getgrnam_r
11201120
getgrouplist
1121+
gethostid
11211122
getifaddrs
11221123
getitimer
11231124
getlastlogx
@@ -1282,6 +1283,7 @@ sendmsg
12821283
setdomainname
12831284
setgrent
12841285
setgroups
1286+
sethostid
12851287
sethostname
12861288
setitimer
12871289
setpriority

libc-test/semver/openbsd.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -936,6 +936,7 @@ getgrgid_r
936936
getgrnam
937937
getgrnam_r
938938
getgrouplist
939+
gethostid
939940
getifaddrs
940941
getitimer
941942
getline
@@ -1053,6 +1054,7 @@ sendmsg
10531054
setdomainname
10541055
setgrent
10551056
setgroups
1057+
sethostid
10561058
sethostname
10571059
setitimer
10581060
setpriority

src/unix/bsd/apple/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4414,6 +4414,9 @@ extern "C" {
44144414
/// `id` is of type [`uuid_t`].
44154415
pub fn gethostuuid(id: *mut u8, timeout: *const ::timespec) -> ::c_int;
44164416

4417+
pub fn gethostid() -> ::c_long;
4418+
pub fn sethostid(hostid: ::c_long);
4419+
44174420
pub fn CCRandomGenerateBytes(bytes: *mut ::c_void, size: ::size_t) -> ::CCRNGStatus;
44184421

44194422
pub fn _NSGetExecutablePath(buf: *mut ::c_char, bufsize: *mut u32) -> ::c_int;

src/unix/bsd/freebsdlike/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1643,6 +1643,8 @@ extern "C" {
16431643
pub fn explicit_bzero(s: *mut ::c_void, len: ::size_t);
16441644
// ISO/IEC 9899:2011 ("ISO C11") K.3.7.4.1
16451645
pub fn memset_s(s: *mut ::c_void, smax: ::size_t, c: ::c_int, n: ::size_t) -> ::c_int;
1646+
pub fn gethostid() -> ::c_long;
1647+
pub fn sethostid(hostid: ::c_long);
16461648
}
16471649

16481650
#[link(name = "rt")]

src/unix/bsd/netbsdlike/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -745,6 +745,8 @@ extern "C" {
745745

746746
extern "C" {
747747
pub fn reallocarray(ptr: *mut ::c_void, nmemb: ::size_t, size: ::size_t) -> *mut ::c_void;
748+
pub fn gethostid() -> ::c_long;
749+
pub fn sethostid(hostid: ::c_long) -> ::c_int;
748750
}
749751

750752
cfg_if! {

0 commit comments

Comments
 (0)