Ruby 2.7.0p0(2019-12-25revision647ee6f091eafcce70ffb75ddf7e121e192ab217)

Data Structures | Macros | Typedefs | Functions | Variables
process.c File Reference
`#include "ruby/config.h"`
`#include "ruby/io.h"`
`#include "internal.h"`
`#include "ruby/thread.h"`
`#include "ruby/util.h"`
`#include "vm_core.h"`
`#include "hrtime.h"`
`#include <stdio.h>`
`#include <errno.h>`
`#include <signal.h>`
`#include <time.h>`
`#include <ctype.h>`
`#include "ruby/st.h"`
`#include <sys/stat.h>`
`#include "dln.h"`

Go to the source code of this file.

## Data Structures
struct | waitpid_state
struct | string_part
struct | open_struct
struct | run_exec_dup2_fd_pair
struct | spawn_args
struct | timetick

## Macros
#define | EXIT_SUCCESS 0
#define | EXIT_FAILURE 1
#define | MAXPATHLEN 1024
#define | WIFEXITED(w) (((w) & 0xff) == 0)
#define | WIFSIGNALED(w) (((w) & 0x7f) > 0 && (((w) & 0x7f) < 0x7f))
#define | WIFSTOPPED(w) (((w) & 0xff) == 0x7f)
#define | WEXITSTATUS(w) (((w) >> 8) & 0xff)
#define | WTERMSIG(w) ((w) & 0x7f)
#define | WSTOPSIG WEXITSTATUS
#define | p_uid_from_name p_uid_from_name
#define | p_gid_from_name p_gid_from_name
#define | PREPARE_GETPWNAM /* do nothing */
#define | FINISH_GETPWNAM /* do nothing */
#define | OBJ2UID1(id) NUM2UIDT(id)
#define | OBJ2UID(id) NUM2UIDT(id)
#define | p_uid_from_name rb_f_notimplement
#define | PREPARE_GETGRNAM /* do nothing */
#define | FINISH_GETGRNAM /* do nothing */
#define | OBJ2GID1(id) NUM2GIDT(id)
#define | OBJ2GID(id) NUM2GIDT(id)
#define | p_gid_from_name rb_f_notimplement
#define | id_exception idException
#define | ALWAYS_NEED_ENVP 0
#define | redirect_dup(oldfd) dup(oldfd)
#define | redirect_dup2(oldfd, newfd) dup2((oldfd), (newfd))
#define | redirect_cloexec_dup(oldfd) rb_cloexec_dup(oldfd)
#define | redirect_cloexec_dup2(oldfd, newfd) rb_cloexec_dup2((oldfd), (newfd))
#define | redirect_close(fd) close_unless_reserved(fd)
#define | parent_redirect_open(pathname, flags, perm) rb_cloexec_open((pathname), (flags), (perm))
#define | parent_redirect_close(fd) close_unless_reserved(fd)
#define | PST2INT(st) NUM2INT(pst_to_i(st))
#define | WAITPID_LOCK_ONLY ((struct waitpid_state *)-1)
#define | ruby_nocldwait 0
#define | WRITE_CONST(fd, str) (void)(write((fd),(str),sizeof(str)-1)<0)
#define | try_with_sh(err, prog, argv, envp) (void)0
#define | EXPORT_STR(str) (str)
#define | EXPORT_DUP(str) rb_str_dup(str)
#define | USE_SPAWNV 0
#define | P_NOWAIT _P_NOWAIT
#define | TO_BOOL(val, name) NIL_P(val) ? 0 : rb_bool_expected((val), name)
#define | ENVMATCH(n1, n2) (strcmp((n1), (n2)) == 0)
#define | CHILD_ERRMSG_BUFLEN 80
#define | ERRMSG(str) do { if (errmsg && 0 < errmsg_buflen) strlcpy(errmsg, (str), errmsg_buflen); } while (0)
#define | ERRMSG1(str, a) do { if (errmsg && 0 < errmsg_buflen) snprintf(errmsg, errmsg_buflen, (str), (a)); } while (0)
#define | ERRMSG2(str, a, b) do { if (errmsg && 0 < errmsg_buflen) snprintf(errmsg, errmsg_buflen, (str), (a), (b)); } while (0)
#define | rb_f_fork rb_f_notimplement
#define | proc_getpgrp rb_f_notimplement
#define | proc_setpgrp rb_f_notimplement
#define | proc_getpgid rb_f_notimplement
#define | proc_setpgid rb_f_notimplement
#define | proc_getsid rb_f_notimplement
#define | proc_setsid rb_f_notimplement
#define | proc_getpriority rb_f_notimplement
#define | proc_setpriority rb_f_notimplement
#define | proc_getrlimit rb_f_notimplement
#define | proc_setrlimit rb_f_notimplement
#define | p_sys_setuid rb_f_notimplement
#define | p_sys_setruid rb_f_notimplement
#define | p_sys_seteuid rb_f_notimplement
#define | p_sys_setreuid rb_f_notimplement
#define | p_sys_setresuid rb_f_notimplement
#define | proc_setuid rb_f_notimplement
#define | p_sys_setgid rb_f_notimplement
#define | p_sys_setrgid rb_f_notimplement
#define | p_sys_setegid rb_f_notimplement
#define | p_sys_setregid rb_f_notimplement
#define | p_sys_setresgid rb_f_notimplement
#define | p_sys_issetugid rb_f_notimplement
#define | proc_setgid rb_f_notimplement
#define | proc_getgroups rb_f_notimplement
#define | proc_setgroups rb_f_notimplement
#define | proc_initgroups rb_f_notimplement
#define | proc_getmaxgroups rb_f_notimplement
#define | proc_setmaxgroups rb_f_notimplement
#define | proc_daemon rb_f_notimplement
#define | proc_seteuid_m rb_f_notimplement
#define | proc_setegid_m rb_f_notimplement
#define | rb_proc_times rb_f_notimplement
#define | TIMETICK_INT_MIN LONG_MIN
#define | TIMETICK_INT_MAX LONG_MAX
#define | TIMETICK_INT2NUM(v) LONG2NUM(v)
#define | MUL_OVERFLOW_TIMETICK_P(a, b) MUL_OVERFLOW_LONG_P(a, b)
#define | NDIV(x, y) (-(-((x)+1)/(y))-1)
#define | DIV(n, d) ((n)<0 ? NDIV((n),(d)) : (n)/(d))
#define | RUBY_TIME_BASED_CLOCK_REALTIME ID2SYM(id_TIME_BASED_CLOCK_REALTIME)
#define | RUBY_CLOCK_BASED_CLOCK_PROCESS_CPUTIME_ID ID2SYM(id_CLOCK_BASED_CLOCK_PROCESS_CPUTIME_ID)
#define | rb_intern(str) rb_intern_const(str)

## Typedefs
typedef unsigned int | unsigned_clock_t
typedef void(* | sig_t) (int)
typedef long | timetick_int_t

## Functions
VALUE | rb_last_status_get (void)
void | rb_last_status_set (int status, rb_pid_t pid)
void | rb_last_status_clear (void)
void | rb_native_mutex_lock (rb_nativethread_lock_t *)
void | rb_native_mutex_unlock (rb_nativethread_lock_t *)
void | rb_native_cond_signal (rb_nativethread_cond_t *)
void | rb_native_cond_wait (rb_nativethread_cond_t *, rb_nativethread_lock_t *)
int | rb_sigwait_fd_get (const rb_thread_t *)
void | rb_sigwait_sleep (const rb_thread_t *, int fd, const rb_hrtime_t *)
void | rb_sigwait_fd_put (const rb_thread_t *, int fd)
void | rb_thread_sleep_interruptible (void)
void | rb_sigwait_fd_migrate (rb_vm_t *vm)
void | ruby_waitpid_all (rb_vm_t *vm)
rb_pid_t | ruby_waitpid_locked (rb_vm_t *vm, rb_pid_t pid, int *status, int options, rb_nativethread_cond_t *cond)
rb_pid_t | rb_waitpid (rb_pid_t pid, int *st, int flags)
VALUE | rb_detach_process (rb_pid_t pid)
int | rb_proc_exec (const char *str)
int | rb_execarg_addopt (VALUE execarg_obj, VALUE key, VALUE val)
VALUE | rb_execarg_extract_options (VALUE execarg_obj, VALUE opthash)
struct rb_execarg * | rb_execarg_get (VALUE execarg_obj)
VALUE | rb_execarg_new (int argc, const VALUE *argv, int accept_shell, int allow_exc_opt)
void | rb_execarg_setenv (VALUE execarg_obj, VALUE env)
void | rb_execarg_parent_start (VALUE execarg_obj)
void | rb_execarg_parent_end (VALUE execarg_obj)
VALUE | rb_f_exec (int argc, const VALUE *argv)
int | rb_execarg_run_options (const struct rb_execarg *eargp, struct rb_execarg *sargp, char *errmsg, size_t errmsg_buflen)
int | rb_exec_async_signal_safe (const struct rb_execarg *eargp, char *errmsg, size_t errmsg_buflen)
void | rb_exit (int status)
VALUE | rb_f_exit (int argc, const VALUE *argv)
VALUE | rb_f_abort (int argc, const VALUE *argv)
void | rb_syswait (rb_pid_t pid)
char * | rb_execarg_commandline (const struct rb_execarg *eargp, VALUE *prog)
rb_pid_t | rb_spawn_err (int argc, const VALUE *argv, char *errmsg, size_t errmsg_buflen)
rb_pid_t | rb_spawn (int argc, const VALUE *argv)
| CONSTFUNC (static timetick_int_t gcd_timetick_int(timetick_int_t, timetick_int_t))
void | InitVM_process (void)
void | Init_process (void)

## Variables
VALUE | rb_mProcess

## Macro Definition Documentation

## ◆ ALWAYS_NEED_ENVP

#define ALWAYS_NEED_ENVP 0

Definition at line 285 of file process.c.

## ◆ CHILD_ERRMSG_BUFLEN

#define CHILD_ERRMSG_BUFLEN 80

## ◆ DIV

#define DIV | ( |  | n,
|  |  | d
| ) |  | ((n)<0 ? NDIV((n),(d)) : (n)/(d))

Definition at line 7540 of file process.c.

## ◆ ENVMATCH

#define ENVMATCH | ( |  | n1,
|  |  | n2
| ) |  | (strcmp((n1), (n2)) == 0)

Definition at line 2293 of file process.c.

## ◆ ERRMSG

#define ERRMSG | ( |  | str | ) | do { if (errmsg && 0 < errmsg_buflen) strlcpy(errmsg, (str), errmsg_buflen); } while (0)

Definition at line 2985 of file process.c.

## ◆ ERRMSG1

#define ERRMSG1 | ( |  | str,
|  |  | a
| ) |  | do { if (errmsg && 0 < errmsg_buflen) snprintf(errmsg, errmsg_buflen, (str), (a)); } while (0)

Definition at line 2986 of file process.c.

## ◆ ERRMSG2

#define ERRMSG2 | ( |  | str,
|  |  | a,
|  |  | b
| ) |  | do { if (errmsg && 0 < errmsg_buflen) snprintf(errmsg, errmsg_buflen, (str), (a), (b)); } while (0)

Definition at line 2987 of file process.c.

## ◆ EXIT_FAILURE

#define EXIT_FAILURE 1

Definition at line 45 of file process.c.

## ◆ EXIT_SUCCESS

#define EXIT_SUCCESS 0

Definition at line 42 of file process.c.

## ◆ EXPORT_DUP

#define EXPORT_DUP | ( |  | str | ) | rb_str_dup(str)

Definition at line 1728 of file process.c.

## ◆ EXPORT_STR

#define EXPORT_STR | ( |  | str | ) | (str)

Definition at line 1727 of file process.c.

## ◆ FINISH_GETGRNAM

#define FINISH_GETGRNAM /* do nothing */

Definition at line 233 of file process.c.

## ◆ FINISH_GETPWNAM

#define FINISH_GETPWNAM /* do nothing */

Definition at line 190 of file process.c.

## ◆ id_exception

#define id_exception idException

Definition at line 253 of file process.c.

## ◆ MAXPATHLEN

#define MAXPATHLEN 1024

Definition at line 61 of file process.c.

## ◆ MUL_OVERFLOW_TIMETICK_P

#define MUL_OVERFLOW_TIMETICK_P | ( |  | a,
|  |  | b
| ) |  | MUL_OVERFLOW_LONG_P(a, b)

Definition at line 7442 of file process.c.

## ◆ NDIV

#define NDIV | ( |  | x,
|  |  | y
| ) |  | (-(-((x)+1)/(y))-1)

Definition at line 7539 of file process.c.

## ◆ OBJ2GID

#define OBJ2GID | ( |  | id | ) | NUM2GIDT(id)

Definition at line 235 of file process.c.

## ◆ OBJ2GID1

#define OBJ2GID1 | ( |  | id | ) | NUM2GIDT(id)

Definition at line 234 of file process.c.

## ◆ OBJ2UID

#define OBJ2UID | ( |  | id | ) | NUM2UIDT(id)

Definition at line 192 of file process.c.

## ◆ OBJ2UID1

#define OBJ2UID1 | ( |  | id | ) | NUM2UIDT(id)

Definition at line 191 of file process.c.

## ◆ p_gid_from_name [1/2]

#define p_gid_from_name p_gid_from_name

Definition at line 238 of file process.c.

## ◆ p_gid_from_name [2/2]

#define p_gid_from_name rb_f_notimplement

Definition at line 238 of file process.c.

## ◆ P_NOWAIT

#define P_NOWAIT _P_NOWAIT

Definition at line 1737 of file process.c.

## ◆ p_sys_issetugid

#define p_sys_issetugid rb_f_notimplement

Definition at line 6195 of file process.c.

## ◆ p_sys_setegid

#define p_sys_setegid rb_f_notimplement

Definition at line 6113 of file process.c.

## ◆ p_sys_seteuid

#define p_sys_seteuid rb_f_notimplement

Definition at line 5733 of file process.c.

## ◆ p_sys_setgid

#define p_sys_setgid rb_f_notimplement

Definition at line 6069 of file process.c.

## ◆ p_sys_setregid

#define p_sys_setregid rb_f_notimplement

Definition at line 6140 of file process.c.

## ◆ p_sys_setresgid

#define p_sys_setresgid rb_f_notimplement

Definition at line 6167 of file process.c.

## ◆ p_sys_setresuid

#define p_sys_setresuid rb_f_notimplement

Definition at line 5792 of file process.c.

## ◆ p_sys_setreuid

#define p_sys_setreuid rb_f_notimplement

Definition at line 5762 of file process.c.

## ◆ p_sys_setrgid

#define p_sys_setrgid rb_f_notimplement

Definition at line 6091 of file process.c.

## ◆ p_sys_setruid

#define p_sys_setruid rb_f_notimplement

Definition at line 5711 of file process.c.

## ◆ p_sys_setuid

#define p_sys_setuid rb_f_notimplement

Definition at line 5689 of file process.c.

## ◆ p_uid_from_name [1/2]

#define p_uid_from_name p_uid_from_name

Definition at line 195 of file process.c.

## ◆ p_uid_from_name [2/2]

#define p_uid_from_name rb_f_notimplement

Definition at line 195 of file process.c.

## ◆ parent_redirect_close

#define parent_redirect_close | ( |  | fd | ) | close_unless_reserved(fd)

Definition at line 413 of file process.c.

## ◆ parent_redirect_open

#define parent_redirect_open | ( |  | pathname,
|  |  | flags,
|  |  | perm
| ) |  | rb_cloexec_open((pathname), (flags), (perm))

Definition at line 412 of file process.c.

## ◆ PREPARE_GETGRNAM

#define PREPARE_GETGRNAM /* do nothing */

Definition at line 232 of file process.c.

## ◆ PREPARE_GETPWNAM

#define PREPARE_GETPWNAM /* do nothing */

Definition at line 189 of file process.c.

## ◆ proc_daemon

#define proc_daemon rb_f_notimplement

Definition at line 6566 of file process.c.

## ◆ proc_getgroups

#define proc_getgroups rb_f_notimplement

Definition at line 6356 of file process.c.

## ◆ proc_getmaxgroups

#define proc_getmaxgroups rb_f_notimplement

Definition at line 6456 of file process.c.

## ◆ proc_getpgid

#define proc_getpgid rb_f_notimplement

Definition at line 4969 of file process.c.

## ◆ proc_getpgrp

#define proc_getpgrp rb_f_notimplement

Definition at line 4916 of file process.c.

## ◆ proc_getpriority

#define proc_getpriority rb_f_notimplement

Definition at line 5119 of file process.c.

## ◆ proc_getrlimit

#define proc_getrlimit rb_f_notimplement

Definition at line 5407 of file process.c.

## ◆ proc_getsid

#define proc_getsid rb_f_notimplement

Definition at line 5025 of file process.c.

## ◆ proc_initgroups

#define proc_initgroups rb_f_notimplement

Definition at line 6436 of file process.c.

## ◆ proc_setegid_m

#define proc_setegid_m rb_f_notimplement

Definition at line 6953 of file process.c.

## ◆ proc_seteuid_m

#define proc_seteuid_m rb_f_notimplement

Definition at line 6823 of file process.c.

## ◆ proc_setgid

#define proc_setgid rb_f_notimplement

Definition at line 6253 of file process.c.

## ◆ proc_setgroups

#define proc_setgroups rb_f_notimplement

Definition at line 6405 of file process.c.

## ◆ proc_setmaxgroups

#define proc_setmaxgroups rb_f_notimplement

Definition at line 6488 of file process.c.

## ◆ proc_setpgid

#define proc_setpgid rb_f_notimplement

Definition at line 4994 of file process.c.

## ◆ proc_setpgrp

#define proc_setpgrp rb_f_notimplement

Definition at line 4944 of file process.c.

## ◆ proc_setpriority

#define proc_setpriority rb_f_notimplement

Definition at line 5150 of file process.c.

## ◆ proc_setrlimit

#define proc_setrlimit rb_f_notimplement

Definition at line 5483 of file process.c.

## ◆ proc_setsid

#define proc_setsid rb_f_notimplement

Definition at line 5083 of file process.c.

## ◆ proc_setuid

#define proc_setuid rb_f_notimplement

Definition at line 5851 of file process.c.

## ◆ PST2INT

#define PST2INT | ( |  | st | ) | NUM2INT(pst_to_i(st))

Definition at line 577 of file process.c.

## ◆ rb_f_fork

#define rb_f_fork rb_f_notimplement

Definition at line 4136 of file process.c.

## ◆ rb_intern

#define rb_intern | ( |  | str | ) | rb_intern_const(str)

## ◆ rb_proc_times

#define rb_proc_times rb_f_notimplement

Definition at line 7428 of file process.c.

## ◆ redirect_cloexec_dup

#define redirect_cloexec_dup | ( |  | oldfd | ) | rb_cloexec_dup(oldfd)

Definition at line 409 of file process.c.

## ◆ redirect_cloexec_dup2

#define redirect_cloexec_dup2 | ( |  | oldfd,
|  |  | newfd
| ) |  | rb_cloexec_dup2((oldfd), (newfd))

Definition at line 410 of file process.c.

## ◆ redirect_close

#define redirect_close | ( |  | fd | ) | close_unless_reserved(fd)

Definition at line 411 of file process.c.

## ◆ redirect_dup

#define redirect_dup | ( |  | oldfd | ) | dup(oldfd)

Definition at line 407 of file process.c.

## ◆ redirect_dup2

#define redirect_dup2 | ( |  | oldfd,
|  |  | newfd
| ) |  | dup2((oldfd), (newfd))

Definition at line 408 of file process.c.

## ◆ RUBY_CLOCK_BASED_CLOCK_PROCESS_CPUTIME_ID

#define RUBY_CLOCK_BASED_CLOCK_PROCESS_CPUTIME_ID ID2SYM(id_CLOCK_BASED_CLOCK_PROCESS_CPUTIME_ID)

## ◆ ruby_nocldwait

#define ruby_nocldwait 0

Definition at line 1025 of file process.c.

## ◆ RUBY_TIME_BASED_CLOCK_REALTIME

#define RUBY_TIME_BASED_CLOCK_REALTIME ID2SYM(id_TIME_BASED_CLOCK_REALTIME)

## ◆ TIMETICK_INT2NUM

#define TIMETICK_INT2NUM | ( |  | v | ) | LONG2NUM(v)

Definition at line 7441 of file process.c.

## ◆ TIMETICK_INT_MAX

#define TIMETICK_INT_MAX LONG_MAX

Definition at line 7440 of file process.c.

## ◆ TIMETICK_INT_MIN

#define TIMETICK_INT_MIN LONG_MIN

Definition at line 7439 of file process.c.

## ◆ TO_BOOL

#define TO_BOOL | ( |  | val,
|  |  | name
| ) |  | NIL_P(val) ? 0 : rb_bool_expected((val), name)

Definition at line 2011 of file process.c.

## ◆ try_with_sh

#define try_with_sh | ( |  | err,
|  |  | prog,
|  |  | argv,
|  |  | envp
| ) |  | (void)0

Definition at line 1593 of file process.c.

## ◆ USE_SPAWNV

#define USE_SPAWNV 0

Definition at line 1734 of file process.c.

## ◆ WAITPID_LOCK_ONLY

#define WAITPID_LOCK_ONLY ((struct waitpid_state *)-1)

Definition at line 941 of file process.c.

## ◆ WEXITSTATUS

#define WEXITSTATUS | ( |  | w | ) | (((w) >> 8) & 0xff)

Definition at line 111 of file process.c.

## ◆ WIFEXITED

#define WIFEXITED | ( |  | w | ) | (((w) & 0xff) == 0)

Definition at line 102 of file process.c.

## ◆ WIFSIGNALED

#define WIFSIGNALED | ( |  | w | ) | (((w) & 0x7f) > 0 && (((w) & 0x7f) < 0x7f))

Definition at line 105 of file process.c.

## ◆ WIFSTOPPED

#define WIFSTOPPED | ( |  | w | ) | (((w) & 0xff) == 0x7f)

Definition at line 108 of file process.c.

## ◆ WRITE_CONST

#define WRITE_CONST | ( |  | fd,
|  |  | str
| ) |  | (void)(write((fd),(str),sizeof(str)-1)<0)

Definition at line 1505 of file process.c.

## ◆ WSTOPSIG

#define WSTOPSIG WEXITSTATUS

Definition at line 117 of file process.c.

## ◆ WTERMSIG

#define WTERMSIG | ( |  | w | ) | ((w) & 0x7f)

Definition at line 114 of file process.c.

## Typedef Documentation

## ◆ sig_t

typedef void(* sig_t) (int)

Definition at line 250 of file process.c.

## ◆ timetick_int_t

typedef long timetick_int_t

Definition at line 7438 of file process.c.

## ◆ unsigned_clock_t

typedef unsigned int unsigned_clock_t

Definition at line 243 of file process.c.

## Function Documentation

## ◆ CONSTFUNC()

CONSTFUNC | ( | static timetick_int_t | gcd_timetick_inttimetick_int_t, timetick_int_t | ) |

## ◆ Init_process()

void Init_process | ( | void |  | ) |

Definition at line 8563 of file process.c.

References id_in, and rb_intern.

## ◆ InitVM_process()

void InitVM_process | ( | void |  | ) |

Definition at line 8136 of file process.c.

References ruby::backward::cxxanyargs::rb_define_virtual_variable().

## ◆ rb_detach_process()

VALUE rb_detach_process | ( | rb_pid_t | pid | ) |

Definition at line 1423 of file process.c.

References ruby::backward::cxxanyargs::rb_thread_create().

## ◆ rb_exec_async_signal_safe()

int rb_exec_async_signal_safe | ( | const struct rb_execarg * | eargp,
|  | char * | errmsg,
|  | size_t | errmsg_buflen
| ) |  |

Definition at line 3516 of file process.c.

References errno.

## ◆ rb_execarg_addopt()

int rb_execarg_addopt | ( | VALUE | execarg_obj,
|  | VALUE | key,
|  | VALUE | val
| ) |  |

Definition at line 2013 of file process.c.

References id, key, rb_execarg::new_pgroup_flag, rb_execarg::new_pgroup_given, NUM2PIDT, rb_execarg::pgroup_given, rb_execarg::pgroup_pgid, Qtrue, rb_check_id(), rb_eArgError, rb_execarg_get(), RB_GC_GUARD, rb_pid_t, rb_raise(), RTEST, ST_CONTINUE, ST_STOP, T_SYMBOL, TO_BOOL, and TYPE.

## ◆ rb_execarg_commandline()

char* rb_execarg_commandline | ( | const struct rb_execarg * | eargp,
|  | VALUE * | prog
| ) |  |

Definition at line 4317 of file process.c.

References argc, argv, ARGVSTR2ARGV, buf, rb_execarg::cmd, i, rb_execarg::invoke, str, and rb_execarg::use_shell.

## ◆ rb_execarg_extract_options()

VALUE rb_execarg_extract_options | ( | VALUE | execarg_obj,
|  | VALUE | opthash
| ) |  |

Definition at line 2279 of file process.c.

References Qnil, rb_hash_stlike_foreach(), and RHASH_EMPTY_P.

## ◆ rb_execarg_get()

struct rb_execarg* rb_execarg_get | ( | VALUE | execarg_obj | ) |

Definition at line 2608 of file process.c.

References TypedData_Get_Struct.

Referenced by rb_execarg_addopt(), rb_execarg_setenv(), and rb_f_exec().

## ◆ rb_execarg_new()

VALUE rb_execarg_new | ( | int | argc,
|  | const VALUE * | argv,
|  | int | accept_shell,
|  | int | allow_exc_opt
| ) |  |

Definition at line 2633 of file process.c.

References TypedData_Make_Struct.

Referenced by rb_f_exec().

## ◆ rb_execarg_parent_end()

void rb_execarg_parent_end | ( | VALUE | execarg_obj | ) |

Definition at line 2855 of file process.c.

## ◆ rb_execarg_parent_start()

void rb_execarg_parent_start | ( | VALUE | execarg_obj | ) |

Definition at line 2816 of file process.c.

References rb_protect().

## ◆ rb_execarg_run_options()

int rb_execarg_run_options | ( | const struct rb_execarg * | eargp,
|  | struct rb_execarg * | sargp,
|  | char * | errmsg,
|  | size_t | errmsg_buflen
| ) |  |

Definition at line 3385 of file process.c.

References MEMZERO, obj, rb_execarg::pgroup_given, Qfalse, Qnil, rb_execarg::redirect_fds, rb_execarg::rlimit_limits, rb_execarg::unsetenv_others_do, and rb_execarg::unsetenv_others_given.

## ◆ rb_execarg_setenv()

void rb_execarg_setenv | ( | VALUE | execarg_obj,
|  | VALUE | env
| ) |  |

Definition at line 2646 of file process.c.

References env, NIL_P, and rb_execarg_get().

## ◆ rb_exit()

void rb_exit | ( | int | status | ) |

Definition at line 4190 of file process.c.

References GET_EC, INT2NUM, rb_class_new_instance(), rb_eSystemExit, rb_exc_raise(), rb_str_new2, and ruby_stop().

Referenced by rb_f_abort().

## ◆ rb_f_abort()

VALUE rb_f_abort | ( | int | argc,
|  | const VALUE * | argv
| ) |  |

Definition at line 4277 of file process.c.

References argc, argv, EXIT_FAILURE, GET_EC, INT2NUM, NIL_P, Qnil, rb_check_arity, rb_class_new_instance(), rb_ec_error_print(), rb_ec_get_errinfo(), rb_eSystemExit, rb_exc_raise(), rb_exit(), rb_io_puts(), rb_stderr, StringValue(), and UNREACHABLE_RETURN.

## ◆ rb_f_exec()

VALUE rb_f_exec | ( | int | argc,
|  | const VALUE * | argv
| ) |  |

Definition at line 2882 of file process.c.

References argc, argv, CHILD_ERRMSG_BUFLEN, err, FALSE, mjit_enabled, mjit_finish(), rb_execarg_get(), rb_execarg_new(), and TRUE.

## ◆ rb_f_exit()

VALUE rb_f_exit | ( | int | argc,
|  | const VALUE * | argv
| ) |  |

Definition at line 4203 of file process.c.

References argc, and rb_check_arity.

## ◆ rb_last_status_clear()

void rb_last_status_clear | ( | void |  | ) |

Definition at line 554 of file process.c.

References GET_THREAD, and Qnil.

## ◆ rb_last_status_get()

VALUE rb_last_status_get | ( | void |  | ) |

Definition at line 518 of file process.c.

References GET_THREAD.

## ◆ rb_last_status_set()

void rb_last_status_set | ( | int | status,
|  | rb_pid_t | pid
| ) |  |

Definition at line 545 of file process.c.

References GET_THREAD, rb_thread_struct::last_status, and rb_obj_alloc().

## ◆ rb_native_cond_signal()

void rb_native_cond_signal | ( | rb_nativethread_cond_t * |  | ) |

## ◆ rb_native_cond_wait()

void rb_native_cond_wait | ( | rb_nativethread_cond_t * | ,
|  | rb_nativethread_lock_t * |
| ) |  |

## ◆ rb_native_mutex_lock()

void rb_native_mutex_lock | ( | rb_nativethread_lock_t * |  | ) |

Referenced by rb_sigwait_fd_migrate(), and ruby_waitpid_all().

## ◆ rb_native_mutex_unlock()

void rb_native_mutex_unlock | ( | rb_nativethread_lock_t * |  | ) |

## ◆ rb_proc_exec()

int rb_proc_exec | ( | const char * | str | ) |

Definition at line 1665 of file process.c.

References waitpid_state::ret.

## ◆ rb_sigwait_fd_get()

int rb_sigwait_fd_get | ( | const rb_thread_t * |  | ) |

## ◆ rb_sigwait_fd_migrate()

void rb_sigwait_fd_migrate | ( | rb_vm_t * | vm | ) |

Definition at line 998 of file process.c.

References rb_native_mutex_lock(), and rb_vm_struct::waitpid_lock.

## ◆ rb_sigwait_fd_put()

void rb_sigwait_fd_put | ( | const rb_thread_t * | ,
|  | int | fd
| ) |  |

## ◆ rb_sigwait_sleep()

void rb_sigwait_sleep | ( | const rb_thread_t * | ,
|  | int | fd,
|  | const rb_hrtime_t * |
| ) |  |

## ◆ rb_spawn()

rb_pid_t rb_spawn | ( | int | argc,
|  | const VALUE * | argv
| ) |  |

Definition at line 4441 of file process.c.

## ◆ rb_spawn_err()

rb_pid_t rb_spawn_err | ( | int | argc,
|  | const VALUE * | argv,
|  | char * | errmsg,
|  | size_t | errmsg_buflen
| ) |  |

Definition at line 4435 of file process.c.

## ◆ rb_syswait()

void rb_syswait | ( | rb_pid_t | pid | ) |

Definition at line 4308 of file process.c.

References rb_waitpid().

## ◆ rb_thread_sleep_interruptible()

void rb_thread_sleep_interruptible | ( | void |  | ) |

Definition at line 1328 of file thread.c.

References rb_thread_struct::ec, GET_THREAD, RUBY_VM_CHECK_INTS_BLOCKING, rb_thread_struct::status, and THREAD_STOPPED.

## ◆ rb_waitpid()

rb_pid_t rb_waitpid | ( | rb_pid_t | pid,
|  | int * | st,
|  | int | flags
| ) |  |

Definition at line 1213 of file process.c.

Referenced by rb_syswait().

## ◆ ruby_waitpid_all()

void ruby_waitpid_all | ( | rb_vm_t * | vm | ) |

Definition at line 1029 of file process.c.

References list_empty, rb_native_mutex_lock(), ruby_nocldwait, rb_vm_struct::waiting_grps, rb_vm_struct::waiting_pids, and rb_vm_struct::waitpid_lock.

Referenced by ruby_sigchld_handler().

## ◆ ruby_waitpid_locked()

rb_pid_t ruby_waitpid_locked | ( | rb_vm_t * | vm,
|  | rb_pid_t | pid,
|  | int * | status,
|  | int | options,
|  | rb_nativethread_cond_t * | cond
| ) |  |

Definition at line 1069 of file process.c.