Lines Matching defs:Gid
130 pub struct Gid(gid_t);
132 impl Gid {
133 /// Creates `Gid` from raw `gid_t`.
135 Gid(gid)
138 /// Returns Gid of calling process. This is practically a more Rusty alias for `getgid`.
144 /// Returns effective Gid of calling process. This is practically a more Rusty alias for `getegid`.
156 impl From<Gid> for gid_t {
157 fn from(gid: Gid) -> Self {
162 impl From<gid_t> for Gid {
164 Gid(gid)
168 impl fmt::Display for Gid {
698 fn chown_raw_ids(owner: Option<Uid>, group: Option<Gid>) -> (libc::uid_t, libc::gid_t) {
717 pub fn chown<P: ?Sized + NixPath>(path: &P, owner: Option<Uid>, group: Option<Gid>) -> Result<()> {
734 pub fn fchown(fd: RawFd, owner: Option<Uid>, group: Option<Gid>) -> Result<()> {
773 group: Option<Gid>,
1428 pub fn getgid() -> Gid {
1429 Gid(unsafe { libc::getgid() })
1438 pub fn getegid() -> Gid {
1439 Gid(unsafe { libc::getegid() })
1456 pub fn setegid(egid: Gid) -> Result<()> {
1476 pub fn setgid(gid: Gid) -> Result<()> {
1502 pub fn setfsgid(gid: Gid) -> Gid {
1504 Gid::from_raw(prev_fsgid as gid_t)
1519 pub fn getgroups() -> Result<Vec<Gid>> {
1542 let mut groups = Vec::<Gid>::with_capacity(Errno::result(ngroups)? as usize);
1544 // FIXME: On the platforms we currently support, the `Gid` struct has
1588 /// let gid = Gid::from_raw(34);
1599 pub fn setgroups(groups: &[Gid]) -> Result<()> {
1614 // FIXME: On the platforms we currently support, the `Gid` struct has the
1648 pub fn getgrouplist(user: &CStr, group: Gid) -> Result<Vec<Gid>> {
1654 let mut groups = Vec::<Gid>::with_capacity(min(ngroups_max, 8) as usize);
1715 /// let gid = Gid::from_raw(33);
1726 pub fn initgroups(user: &CStr, group: Gid) -> Result<()> {
2778 use super::{Uid, Gid};
2806 pub fn setresgid(rgid: Gid, egid: Gid, sgid: Gid) -> Result<()> {
2827 use super::{Uid, Gid};
2840 pub real: Gid,
2841 pub effective: Gid,
2842 pub saved: Gid
2870 /// - `Ok((Gid, Gid, Gid))`: tuple of real, effective and saved gids on success.
2880 Errno::result(res).map(|_| ResGid { real: Gid(rgid), effective: Gid(egid), saved: Gid(sgid) } )
2976 pub gid: Gid,
3025 gid: Gid::from_raw(pw.pw_gid),
3196 pub gid: Gid,
3208 gid: Gid::from_raw(gr.gr_gid),
3278 /// use nix::unistd::{Gid, Group};
3280 /// let res = Group::from_gid(Gid::from_raw(0)).unwrap().unwrap();
3283 pub fn from_gid(gid: Gid) -> Result<Option<Self>> {
3352 pub fn getpeereid(fd: RawFd) -> Result<(Uid, Gid)> {
3358 Errno::result(ret).map(|_| (Uid(uid), Gid(gid)))