Ruby: internal/process.h File Reference

Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)

Data Structures | Macros | Functions
process.h File Reference

Internal header for Process. More...

`#include "ruby/internal/config.h"`
`#include <stddef.h>`
`#include "ruby/ruby.h"`
`#include "internal/imemo.h"`
`#include "internal/warnings.h"`

Go to the source code of this file.

## Data Structures
struct | rb_execarg

## Macros
#define | RB_MAX_GROUPS (65536)

## Functions
rb_pid_t | rb_fork_ruby (int *status)
void | rb_last_status_clear (void)
int | rb_exec_async_signal_safe (const struct rb_execarg *e, char *errmsg, size_t errmsg_buflen)
rb_pid_t | rb_fork_async_signal_safe (int *status, int(*chfunc)(void *, char *, size_t), void *charg, VALUE fds, char *errmsg, size_t errmsg_buflen)
VALUE | rb_execarg_new (int argc, const VALUE *argv, int accept_shell, int allow_exc_opt)
struct rb_execarg * | rb_execarg_get (VALUE execarg_obj)
int | rb_execarg_addopt (VALUE execarg_obj, VALUE key, VALUE val)
void | rb_execarg_parent_start (VALUE execarg_obj)
void | rb_execarg_parent_end (VALUE execarg_obj)
int | rb_execarg_run_options (const struct rb_execarg *e, struct rb_execarg *s, char *errmsg, size_t errmsg_buflen)
VALUE | rb_execarg_extract_options (VALUE execarg_obj, VALUE opthash)
void | rb_execarg_setenv (VALUE execarg_obj, VALUE env)

## Detailed Description

Internal header for Process.

Author
  Ruby developers ruby-.nosp@m.core.nosp@m.@ruby.nosp@m.-lan.nosp@m.g.org

Copyright
  This file is a part of the programming language Ruby. Permission is hereby granted, to either redistribute and/or modify this file, provided that the conditions mentioned in the file COPYING are met. Consult the file for details.

Definition in file process.h.

## Macro Definition Documentation

## ◆ RB_MAX_GROUPS

#define RB_MAX_GROUPS (65536)

Definition at line 27 of file process.h.

## Function Documentation

## ◆ rb_exec_async_signal_safe()

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

Definition at line 3751 of file process.c.

## ◆ rb_execarg_addopt()

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

Definition at line 2240 of file process.c.

References rb_execarg::chdir_dir, rb_execarg::chdir_given, rb_execarg::close_others_do, rb_execarg::close_others_given, rb_execarg::exception_given, EXPORT_DUP, FilePathValue, rb_execarg::gid, rb_execarg::gid_given, id, id_exception, id_in, INT2FIX, key, mode_t, rb_execarg::new_pgroup_flag, rb_execarg::new_pgroup_given, NUM2MODET, NUM2PIDT, OBJ2GID, OBJ2UID, rb_execarg::pgroup_given, rb_execarg::pgroup_pgid, Qtrue, rb_check_id(), rb_eArgError, rb_eNotImpError, rb_execarg_get(), RB_GC_GUARD, rb_raise(), rb_str_encode_ospath(), RTEST, ST_CONTINUE, ST_STOP, T_ARRAY, T_FILE, T_FIXNUM, T_SYMBOL, TO_BOOL, TYPE, rb_execarg::uid, rb_execarg::uid_given, rb_execarg::umask_given, rb_execarg::umask_mask, rb_execarg::unsetenv_others_do, and rb_execarg::unsetenv_others_given.

## ◆ rb_execarg_extract_options()

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

Definition at line 2506 of file process.c.

References Qnil, rb_hash_stlike_foreach(), and RHASH_EMPTY_P.

Referenced by rb_io_popen().

## ◆ rb_execarg_get()

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

Definition at line 2837 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 2862 of file process.c.

References argc, argv, rb_execarg::exception_given, rb_eArgError, rb_raise(), and TypedData_Make_Struct.

Referenced by rb_f_exec(), and rb_io_popen().

## ◆ rb_execarg_parent_end()

void rb_execarg_parent_end | ( | VALUE | execarg_obj | ) |

Definition at line 3082 of file process.c.

References RB_GC_GUARD.

Referenced by rb_execarg_parent_start().

## ◆ rb_execarg_parent_start()

void rb_execarg_parent_start | ( | VALUE | execarg_obj | ) |

Definition at line 3043 of file process.c.

References rb_execarg_parent_end(), rb_jump_tag(), and rb_protect().

## ◆ rb_execarg_run_options()

int rb_execarg_run_options | ( | const struct rb_execarg * | e,
|  | struct rb_execarg * | s,
|  | char * | errmsg,
|  | size_t | errmsg_buflen
| ) |  |

Definition at line 3622 of file process.c.

References rb_execarg::chdir_dir, rb_execarg::chdir_given, rb_execarg::close_others_do, rb_execarg::close_others_maxhint, rb_execarg::dup2_tmpbuf, rb_execarg::env_modification, ERRMSG, rb_execarg::fd_close, rb_execarg::fd_dup2, rb_execarg::fd_dup2_child, rb_execarg::gid, rb_execarg::gid_given, key, mask, MEMZERO, mode_t, NIL_P, rb_execarg::pgroup_given, Qfalse, Qnil, RARRAY_AREF, RARRAY_LEN, rb_close_before_exec(), rb_dir_getwd_ospath(), rb_env_clear(), rb_warn(), rb_execarg::redirect_fds, rb_execarg::rlimit_limits, RSTRING_PTR, ruby_setenv(), setgid(), setuid(), StringValueCStr, rb_execarg::uid, rb_execarg::uid_given, rb_execarg::umask_given, rb_execarg::umask_mask, 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 2875 of file process.c.

References env, rb_execarg::env_modification, NIL_P, rb_execarg::path_env, Qfalse, and rb_execarg_get().

Referenced by rb_io_popen().

## ◆ rb_fork_async_signal_safe()

rb_pid_t rb_fork_async_signal_safe | ( | int * | status,
|  | int(*)(void *, char *, size_t) | chfunc,
|  | void * | charg,
|  | VALUE | fds,
|  | char * | errmsg,
|  | size_t | errmsg_buflen
| ) |  |

## ◆ rb_fork_ruby()

rb_pid_t rb_fork_ruby | ( | int * | status | ) |

## ◆ rb_last_status_clear()

void rb_last_status_clear | ( | void |  | ) |

Definition at line 666 of file process.c.

References Qnil.