os: add getuid and geteuid (#10002)
parent
4bc56dc0a2
commit
12c3f85507
|
@ -75,6 +75,10 @@ fn C.pclose(stream &C.FILE) int
|
||||||
[trusted]
|
[trusted]
|
||||||
fn C.getpid() int
|
fn C.getpid() int
|
||||||
|
|
||||||
|
fn C.getuid() int
|
||||||
|
|
||||||
|
fn C.geteuid() int
|
||||||
|
|
||||||
fn C.system(cmd &char) int
|
fn C.system(cmd &char) int
|
||||||
|
|
||||||
fn C.posix_spawn(child_pid &int, path &char, file_actions voidptr, attrp voidptr, argv &&char, envp &&char) int
|
fn C.posix_spawn(child_pid &int, path &char, file_actions voidptr, attrp voidptr, argv &&char, envp &&char) int
|
||||||
|
|
|
@ -332,6 +332,16 @@ pub fn getpid() int {
|
||||||
return C.getpid()
|
return C.getpid()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[inline]
|
||||||
|
pub fn getuid() int {
|
||||||
|
return C.getuid()
|
||||||
|
}
|
||||||
|
|
||||||
|
[inline]
|
||||||
|
pub fn geteuid() int {
|
||||||
|
return C.geteuid()
|
||||||
|
}
|
||||||
|
|
||||||
// Turns the given bit on or off, depending on the `enable` parameter
|
// Turns the given bit on or off, depending on the `enable` parameter
|
||||||
pub fn posix_set_permission_bit(path_s string, mode u32, enable bool) {
|
pub fn posix_set_permission_bit(path_s string, mode u32, enable bool) {
|
||||||
mut s := C.stat{}
|
mut s := C.stat{}
|
||||||
|
|
Loading…
Reference in New Issue