Skip to content

Commit 10761b1

Browse files
committed
Auto merge of #2329 - devnexen:getsethostid_unix, r=JohnTitor
adding gethostid/sethostid to most unixes (redox still unimplemented at the moment).
2 parents 95304c4 + 43c316e commit 10761b1

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
@@ -1379,6 +1380,7 @@ sendmsg
13791380
setdomainname
13801381
setgrent
13811382
setgroups
1383+
sethostid
13821384
sethostname
13831385
setitimer
13841386
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
@@ -1647,6 +1648,7 @@ sendmsg
16471648
setdomainname
16481649
setgrent
16491650
setgroups
1651+
sethostid
16501652
sethostname
16511653
setitimer
16521654
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
@@ -1122,6 +1122,7 @@ getgrgid_r
11221122
getgrnam
11231123
getgrnam_r
11241124
getgrouplist
1125+
gethostid
11251126
getifaddrs
11261127
getitimer
11271128
getlastlogx
@@ -1290,6 +1291,7 @@ sendmsg
12901291
setdomainname
12911292
setgrent
12921293
setgroups
1294+
sethostid
12931295
sethostname
12941296
setitimer
12951297
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
@@ -1055,6 +1056,7 @@ sendmsg
10551056
setdomainname
10561057
setgrent
10571058
setgroups
1059+
sethostid
10581060
sethostname
10591061
setitimer
10601062
setpriority

src/unix/bsd/apple/mod.rs

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

4461+
pub fn gethostid() -> ::c_long;
4462+
pub fn sethostid(hostid: ::c_long);
4463+
44614464
pub fn CCRandomGenerateBytes(bytes: *mut ::c_void, size: ::size_t) -> ::CCRNGStatus;
44624465

44634466
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
@@ -1645,6 +1645,8 @@ extern "C" {
16451645
pub fn explicit_bzero(s: *mut ::c_void, len: ::size_t);
16461646
// ISO/IEC 9899:2011 ("ISO C11") K.3.7.4.1
16471647
pub fn memset_s(s: *mut ::c_void, smax: ::size_t, c: ::c_int, n: ::size_t) -> ::c_int;
1648+
pub fn gethostid() -> ::c_long;
1649+
pub fn sethostid(hostid: ::c_long);
16481650
}
16491651

16501652
#[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! {

src/unix/linux_like/linux/gnu/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1339,6 +1339,8 @@ extern "C" {
13391339
) -> ::c_int;
13401340
pub fn pthread_getname_np(thread: ::pthread_t, name: *mut ::c_char, len: ::size_t) -> ::c_int;
13411341
pub fn pthread_setname_np(thread: ::pthread_t, name: *const ::c_char) -> ::c_int;
1342+
1343+
pub fn sethostid(hostid: ::c_long) -> ::c_int;
13421344
}
13431345

13441346
extern "C" {

src/unix/linux_like/linux/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3837,6 +3837,8 @@ extern "C" {
38373837
new_value: *const ::itimerspec,
38383838
old_value: *mut ::itimerspec,
38393839
) -> ::c_int;
3840+
3841+
pub fn gethostid() -> ::c_long;
38403842
}
38413843

38423844
cfg_if! {

src/unix/linux_like/linux/uclibc/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,8 @@ extern "C" {
287287
iovcnt: ::c_int,
288288
offset: ::off64_t,
289289
) -> ::ssize_t;
290+
291+
pub fn sethostid(hostid: ::c_long) -> ::c_int;
290292
}
291293

292294
cfg_if! {

src/unix/solarish/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2659,6 +2659,9 @@ extern "C" {
26592659
pub fn p_online(processorid: ::processorid_t, flag: ::c_int) -> ::c_int;
26602660

26612661
pub fn getexecname() -> *const ::c_char;
2662+
2663+
pub fn gethostid() -> ::c_long;
2664+
pub fn sethostid(hostid: ::c_long) -> ::c_int;
26622665
}
26632666

26642667
mod compat;

0 commit comments

Comments
 (0)