mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-13 07:23:39 +00:00
os: implement process related functions
This commit implements various process related functions like os.Getuid() and os.Getpid(). It also implements or improves this support in the syscall package if it isn't available yet.
This commit is contained in:
committed by
Ron Evans
parent
e65592599c
commit
75298bb84b
@@ -0,0 +1,37 @@
|
||||
// +build !baremetal,!wasi,!wasm
|
||||
|
||||
// This file assumes there is a libc available that runs on a real operating
|
||||
// system.
|
||||
|
||||
package syscall
|
||||
|
||||
func Getuid() int { return int(libc_getuid()) }
|
||||
func Geteuid() int { return int(libc_geteuid()) }
|
||||
func Getgid() int { return int(libc_getgid()) }
|
||||
func Getegid() int { return int(libc_getegid()) }
|
||||
func Getpid() int { return int(libc_getpid()) }
|
||||
func Getppid() int { return int(libc_getppid()) }
|
||||
|
||||
// uid_t getuid(void)
|
||||
//export getuid
|
||||
func libc_getuid() int32
|
||||
|
||||
// gid_t getgid(void)
|
||||
//export getgid
|
||||
func libc_getgid() int32
|
||||
|
||||
// uid_t geteuid(void)
|
||||
//export geteuid
|
||||
func libc_geteuid() int32
|
||||
|
||||
// gid_t getegid(void)
|
||||
//export getegid
|
||||
func libc_getegid() int32
|
||||
|
||||
// gid_t getpid(void)
|
||||
//export getpid
|
||||
func libc_getpid() int32
|
||||
|
||||
// gid_t getppid(void)
|
||||
//export getppid
|
||||
func libc_getppid() int32
|
||||
Reference in New Issue
Block a user