Skip to content

Commit 9c979eb

Browse files
tgross35AkhilTThomas
authored andcommitted
Merge pull request rust-lang#4017 from tgross35/backport-watercress
[0.2] Backports
2 parents 1bc00dd + 313ec6c commit 9c979eb

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

src/unix/mod.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1536,6 +1536,10 @@ cfg_if! {
15361536
extern "C" {
15371537
pub fn adjtime(delta: *mut timeval, olddelta: *mut timeval) -> c_int;
15381538
}
1539+
} else if #[cfg(target_os = "solaris")] {
1540+
extern "C" {
1541+
pub fn adjtime(delta: *mut timeval, olddelta: *mut timeval) -> ::c_int;
1542+
}
15391543
}
15401544
}
15411545

@@ -1580,6 +1584,14 @@ cfg_if! {
15801584
}
15811585
}
15821586

1587+
cfg_if! {
1588+
if #[cfg(not(target_os = "solaris"))] {
1589+
extern "C" {
1590+
pub fn flock(fd: ::c_int, operation: ::c_int) -> ::c_int;
1591+
}
1592+
}
1593+
}
1594+
15831595
cfg_if! {
15841596
if #[cfg(not(any(target_env = "uclibc", target_os = "nto")))] {
15851597
extern "C" {

src/unix/solarish/solaris.rs

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,21 @@ s_no_extra_traits! {
9999
pub ut_syslen: c_short,
100100
pub ut_host: [c_char; 257],
101101
}
102+
103+
pub struct utmpx {
104+
pub ut_user: [::c_char; _UTMP_USER_LEN],
105+
pub ut_id: [::c_char; _UTMP_ID_LEN],
106+
pub ut_line: [::c_char; _UTMP_LINE_LEN],
107+
pub ut_pid: ::pid_t,
108+
pub ut_type: ::c_short,
109+
pub ut_exit: exit_status,
110+
pub ut_tv: ::timeval,
111+
pub ut_session: ::c_int,
112+
pub pad: [::c_int; 5],
113+
pub ut_syslen: ::c_short,
114+
pub ut_host: [::c_char; 257],
115+
}
116+
102117
}
103118

104119
cfg_if! {
@@ -202,6 +217,28 @@ pub const PRIV_USER: c_uint = PRIV_DEBUG
202217
| PRIV_TPD_KILLABLE
203218
| PRIV_PROC_TPD_RESET;
204219

220+
pub const _PC_LAST: ::c_int = 102;
221+
222+
pub const PRIV_PROC_SENSITIVE: ::c_uint = 0x0008;
223+
pub const PRIV_PFEXEC_AUTH: ::c_uint = 0x0200;
224+
pub const PRIV_PROC_TPD: ::c_uint = 0x0400;
225+
pub const PRIV_TPD_UNSAFE: ::c_uint = 0x0800;
226+
pub const PRIV_PROC_TPD_RESET: ::c_uint = 0x1000;
227+
pub const PRIV_TPD_KILLABLE: ::c_uint = 0x2000;
228+
229+
pub const PRIV_USER: ::c_uint = PRIV_DEBUG
230+
| PRIV_PROC_SENSITIVE
231+
| NET_MAC_AWARE
232+
| NET_MAC_AWARE_INHERIT
233+
| PRIV_XPOLICY
234+
| PRIV_AWARE_RESET
235+
| PRIV_PFEXEC
236+
| PRIV_PFEXEC_AUTH
237+
| PRIV_PROC_TPD
238+
| PRIV_TPD_UNSAFE
239+
| PRIV_TPD_KILLABLE
240+
| PRIV_PROC_TPD_RESET;
241+
205242
extern "C" {
206243
pub fn fexecve(fd: c_int, argv: *const *mut c_char, envp: *const *mut c_char) -> c_int;
207244

0 commit comments

Comments
 (0)