Skip to content

Commit 3151997

Browse files
committed
Auto merge of #2678 - devnexen:solarish_sysinfo, r=Amanieu
solarish systeminfo
2 parents ec88c37 + 65db99d commit 3151997

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

libc-test/build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -788,6 +788,7 @@ fn test_solarish(target: &str) {
788788
"sys/statvfs.h",
789789
"sys/stropts.h",
790790
"sys/shm.h",
791+
"sys/systeminfo.h",
791792
"sys/time.h",
792793
"sys/times.h",
793794
"sys/timex.h",

src/unix/solarish/illumos.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ pub const B3000000: ::speed_t = 29;
6262
pub const B3500000: ::speed_t = 30;
6363
pub const B4000000: ::speed_t = 31;
6464

65+
// sys/systeminfo.h
66+
pub const SI_ADDRESS_WIDTH: ::c_int = 520;
67+
6568
extern "C" {
6669
pub fn eventfd(init: ::c_uint, flags: ::c_int) -> ::c_int;
6770

src/unix/solarish/mod.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2290,6 +2290,25 @@ pub const PRIV_USER: ::c_uint = PRIV_DEBUG
22902290
| PRIV_AWARE_RESET
22912291
| PRIV_PFEXEC;
22922292

2293+
// sys/systeminfo.h
2294+
pub const SI_SYSNAME: ::c_int = 1;
2295+
pub const SI_HOSTNAME: ::c_int = 2;
2296+
pub const SI_RELEASE: ::c_int = 3;
2297+
pub const SI_VERSION: ::c_int = 4;
2298+
pub const SI_MACHINE: ::c_int = 5;
2299+
pub const SI_ARCHITECTURE: ::c_int = 6;
2300+
pub const SI_HW_SERIAL: ::c_int = 7;
2301+
pub const SI_HW_PROVIDER: ::c_int = 8;
2302+
pub const SI_SET_HOSTNAME: ::c_int = 258;
2303+
pub const SI_SET_SRPC_DOMAIN: ::c_int = 265;
2304+
pub const SI_PLATFORM: ::c_int = 513;
2305+
pub const SI_ISALIST: ::c_int = 514;
2306+
pub const SI_DHCP_CACHE: ::c_int = 515;
2307+
pub const SI_ARCHITECTURE_32: ::c_int = 516;
2308+
pub const SI_ARCHITECTURE_64: ::c_int = 517;
2309+
pub const SI_ARCHITECTURE_K: ::c_int = 518;
2310+
pub const SI_ARCHITECTURE_NATIVE: ::c_int = 519;
2311+
22932312
// As per sys/socket.h, header alignment must be 8 bytes on SPARC
22942313
// and 4 bytes everywhere else:
22952314
#[cfg(target_arch = "sparc64")]
@@ -2864,6 +2883,8 @@ extern "C" {
28642883

28652884
pub fn getpflags(flags: ::c_uint) -> ::c_uint;
28662885
pub fn setpflags(flags: ::c_uint, value: ::c_uint) -> ::c_int;
2886+
2887+
pub fn sysinfo(command: ::c_int, buf: *mut ::c_char, count: ::c_long) -> ::c_int;
28672888
}
28682889

28692890
#[link(name = "sendfile")]

0 commit comments

Comments
 (0)