mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
os: add getuid and geteuid (#10002)
This commit is contained in:
parent
4bc56dc0a2
commit
12c3f85507
@ -75,6 +75,10 @@ fn C.pclose(stream &C.FILE) int
|
||||
[trusted]
|
||||
fn C.getpid() int
|
||||
|
||||
fn C.getuid() int
|
||||
|
||||
fn C.geteuid() 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
|
||||
|
@ -332,6 +332,16 @@ pub fn getpid() int {
|
||||
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
|
||||
pub fn posix_set_permission_bit(path_s string, mode u32, enable bool) {
|
||||
mut s := C.stat{}
|
||||
|
Loading…
Reference in New Issue
Block a user