getuid {unix}R Documentation

Process Info

Description

Get or set attributes of the current process.

Usage

getuid()

getgid()

geteuid()

getegid()

getpid()

getppid()

getpgid()

getpriority()

setuid(uid)

seteuid(uid)

setgid(gid)

setegid(gid)

setpgid(pgid = 0)

setpriority(prio)

kill(pid, signal = SIGTERM)

Arguments

uid

User ID from ⁠/etc/passwd⁠.

gid

Group ID from ⁠/etc/group⁠.

pgid

Process Group ID. Default 0 sets pgid to the current pid.

prio

Priority level

pid

process ID (integer)

signal

a signal number (integer), defaults to tools::SIGTERM.

Details

Acronyms stand for:

An unprivileged (non-root) process cannot change it's uid and only lower process priority (higher value).

References

GETUID(2) GETPID(2) GETPGID(2) GETPRIORITY(2)

Examples

# Current User:
getuid()
# Current UserGroup:
getgid()
# Current UserGroup:
geteuid()
# Current UserGroup:
getegid()
# Process ID
getpid()
# parent PID:
getppid()
# Process group id:
getpgid()

# Detach process group
setpgid(0)
getpgid()
# Process priority:
getpriority()
# Decrease priority
setpriority(getpriority() + 1)

[Package unix version 1.5.8 Index]