Skip to content

Commit c40b6af

Browse files
committed
Auto merge of rust-lang#709 - wezm:setresuid, r=alexcrichton
Add setresgid & setresuid to FreeBSD and OpenBSD These functions are both present in [FreeBSD](https://www.freebsd.org/cgi/man.cgi?query=setresuid&apropos=0&sektion=0&manpath=FreeBSD+11.1-RELEASE+and+Ports&arch=default&format=html) and [OpenBSD](http://man.openbsd.org/setresuid).
2 parents 5e6853b + 81e4c5b commit c40b6af

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/unix/bsd/freebsdlike/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -955,6 +955,8 @@ extern {
955955
pub fn getutxline(ut: *const utmpx) -> *mut utmpx;
956956
pub fn pututxline(ut: *const utmpx) -> *mut utmpx;
957957
pub fn setutxent();
958+
pub fn setresgid(rgid: ::gid_t, egid: ::gid_t, sgid: ::gid_t) -> ::c_int;
959+
pub fn setresuid(ruid: ::uid_t, euid: ::uid_t, suid: ::uid_t) -> ::c_int;
958960
}
959961

960962
#[link(name = "util")]

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -608,6 +608,8 @@ extern {
608608
pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int;
609609
pub fn pledge(promises: *const ::c_char,
610610
paths: *mut *const ::c_char) -> ::c_int;
611+
pub fn setresgid(rgid: ::gid_t, egid: ::gid_t, sgid: ::gid_t) -> ::c_int;
612+
pub fn setresuid(ruid: ::uid_t, euid: ::uid_t, suid: ::uid_t) -> ::c_int;
611613
}
612614

613615
cfg_if! {

0 commit comments

Comments
 (0)