In Files
- process.c
Files
- grammar.en.rdoc
- test.ja.rdoc
- contributing.rdoc
- contributors.rdoc
- dtrace_probes.rdoc
- extension.ja.rdoc
- extension.rdoc
- globals.rdoc
- keywords.rdoc
- maintainers.rdoc
- marshal.rdoc
- regexp.rdoc
- security.rdoc
- standard_library.rdoc
- syntax.rdoc
- assignment.rdoc
- calling_methods.rdoc
- control_expressions.rdoc
- exceptions.rdoc
- literals.rdoc
- methods.rdoc
- miscellaneous.rdoc
- modules_and_classes.rdoc
- precedence.rdoc
- refinements.rdoc
- README.ja.rdoc
- README.rdoc
Class/Module Index
- ArgumentError
- Array
- BasicObject
- Bignum
- Binding
- Class
- ClosedQueueError
- Comparable
- Complex
- Complex::compatible
- ConditionVariable
- Continuation
- Data
- Dir
- ENV
- EOFError
- Encoding
- Encoding::CompatibilityError
- Encoding::Converter
- Encoding::ConverterNotFoundError
- Encoding::InvalidByteSequenceError
- Encoding::UndefinedConversionError
- EncodingError
- Enumerable
- Enumerator
- Enumerator::Generator
- Enumerator::Lazy
- Enumerator::Yielder
- Errno
- Exception
- FalseClass
- Fiber
- FiberError
- File
- File::Constants
- File::Stat
- FileTest
- Fixnum
- Float
- FloatDomainError
- GC
- GC::Profiler
- Hash
- IO
- IO::EAGAINWaitReadable
- IO::EAGAINWaitWritable
- IO::EINPROGRESSWaitReadable
- IO::EINPROGRESSWaitWritable
- IO::EWOULDBLOCKWaitReadable
- IO::EWOULDBLOCKWaitWritable
- IO::WaitReadable
- IO::WaitWritable
- IOError
- IndexError
- Integer
- Interrupt
- Kernel
- KeyError
- LoadError
- LocalJumpError
- Marshal
- MatchData
- Math
- Math::DomainError
- Method
- Module
- NameError
- NilClass
- NoMemoryError
- NoMethodError
- NotImplementedError
- Numeric
- Object
- ObjectSpace
- ObjectSpace::WeakMap
- Proc
- Process
- Process::GID
- Process::Status
- Process::Sys
- Process::UID
- Process::Waiter
- Queue
- Random
- Random::Formatter
- Range
- RangeError
- Rational
- Rational::compatible
- Regexp
- RegexpError
- RubyVM
- RubyVM::Env
- RubyVM::InstructionSequence
- RuntimeError
- ScriptError
- SecurityError
- Signal
- SignalException
- SizedQueue
- StandardError
- StopIteration
- String
- Struct
- Symbol
- SyntaxError
- SystemCallError
- SystemExit
- SystemStackError
- Thread
- Thread::Backtrace::Location
- Thread::Mutex
- ThreadError
- ThreadGroup
- Time
- TracePoint
- TrueClass
- TypeError
- UnboundMethod
- UncaughtThrowError
- ZeroDivisionError
- fatal
- unknown
Process::Sys
The Process::Sys
module contains UID
and GID functions which provide direct bindings to
the system calls of the same names instead of the more-portable versions of
the same functionality found in the Process
,
Process::UID
, and Process::GID
modules.
Public Class Methods
Returns the effective group ID for this process. Not available on all platforms.
Process.egid #=> 500
static VALUE proc_getegid(VALUE obj) { rb_gid_t egid = getegid(); return GIDT2NUM(egid); }
Returns the effective user ID for this process.
Process.euid #=> 501
static VALUE proc_geteuid(VALUE obj) { rb_uid_t euid = geteuid(); return UIDT2NUM(euid); }
Returns the (real) group ID for this process.
Process.gid #=> 500
static VALUE proc_getgid(VALUE obj) { rb_gid_t gid = getgid(); return GIDT2NUM(gid); }
Returns the (real) user ID of this process.
Process.uid #=> 501
static VALUE proc_getuid(VALUE obj) { rb_uid_t uid = getuid(); return UIDT2NUM(uid); }
Returns true
if the process was created as a result of an
execve(2) system call which had either of the setuid or setgid bits set
(and extra privileges were given as a result) or if it has changed any of
its real, effective or saved user or group IDs since it began execution.
static VALUE p_sys_issetugid(VALUE obj) { if (issetugid()) { return Qtrue; } else { return Qfalse; } }
Set the effective group ID of the calling process to group. Not available on all platforms.
static VALUE p_sys_setegid(VALUE obj, VALUE id) { check_gid_switch(); if (setegid(OBJ2GID(id)) != 0) rb_sys_fail(0); return Qnil; }
Set the effective user ID of the calling process to user. Not available on all platforms.
static VALUE p_sys_seteuid(VALUE obj, VALUE id) { check_uid_switch(); if (seteuid(OBJ2UID(id)) != 0) rb_sys_fail(0); return Qnil; }
Set the group ID of the current process to group. Not available on all platforms.
static VALUE p_sys_setgid(VALUE obj, VALUE id) { check_gid_switch(); if (setgid(OBJ2GID(id)) != 0) rb_sys_fail(0); return Qnil; }
Sets the (group) real and/or effective group IDs of the current process to
rid and eid, respectively. A value of -1
for
either means to leave that ID unchanged. Not available on all platforms.
static VALUE p_sys_setregid(VALUE obj, VALUE rid, VALUE eid) { rb_gid_t rgid, egid; PREPARE_GETGRNAM; check_gid_switch(); rgid = OBJ2GID(rid); egid = OBJ2GID(eid); FINISH_GETGRNAM; if (setregid(rgid, egid) != 0) rb_sys_fail(0); return Qnil; }
Sets the (group) real, effective, and saved user IDs of the current process
to rid, eid, and sid respectively. A value of
-1
for any value means to leave that ID unchanged. Not
available on all platforms.
static VALUE p_sys_setresgid(VALUE obj, VALUE rid, VALUE eid, VALUE sid) { rb_gid_t rgid, egid, sgid; PREPARE_GETGRNAM; check_gid_switch(); rgid = OBJ2GID(rid); egid = OBJ2GID(eid); sgid = OBJ2GID(sid); FINISH_GETGRNAM; if (setresgid(rgid, egid, sgid) != 0) rb_sys_fail(0); return Qnil; }
Sets the (user) real, effective, and saved user IDs of the current process
to rid, eid, and sid respectively. A value of
-1
for any value means to leave that ID unchanged. Not
available on all platforms.
static VALUE p_sys_setresuid(VALUE obj, VALUE rid, VALUE eid, VALUE sid) { rb_uid_t ruid, euid, suid; PREPARE_GETPWNAM; check_uid_switch(); ruid = OBJ2UID1(rid); euid = OBJ2UID1(eid); suid = OBJ2UID1(sid); FINISH_GETPWNAM; if (setresuid(ruid, euid, suid) != 0) rb_sys_fail(0); return Qnil; }
Sets the (user) real and/or effective user IDs of the current process to
rid and eid, respectively. A value of -1
for
either means to leave that ID unchanged. Not available on all platforms.
static VALUE p_sys_setreuid(VALUE obj, VALUE rid, VALUE eid) { rb_uid_t ruid, euid; PREPARE_GETPWNAM; check_uid_switch(); ruid = OBJ2UID1(rid); euid = OBJ2UID1(eid); FINISH_GETPWNAM; if (setreuid(ruid, euid) != 0) rb_sys_fail(0); return Qnil; }
Set the real group ID of the calling process to group. Not available on all platforms.
static VALUE p_sys_setrgid(VALUE obj, VALUE id) { check_gid_switch(); if (setrgid(OBJ2GID(id)) != 0) rb_sys_fail(0); return Qnil; }