Ruby: include/ruby/internal/intern/process.h File Reference

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

Functions
process.h File Reference

Public APIs related to rb_mProcess. More...

`#include "ruby/internal/attr/noreturn.h"`
`#include "ruby/internal/config.h"`
`#include "ruby/internal/dllexport.h"`
`#include "ruby/internal/value.h"`

Go to the source code of this file.

## Functions
void | rb_last_status_set (int status, rb_pid_t pid)
VALUE | rb_last_status_get (void)
int | rb_proc_exec (const char *)
VALUE | rb_f_exec (int, const VALUE *)
rb_pid_t | rb_waitpid (rb_pid_t pid, int *status, int flags)
void | rb_syswait (rb_pid_t pid)
rb_pid_t | rb_spawn (int, const VALUE *)
rb_pid_t | rb_spawn_err (int, const VALUE *, char *, size_t)
VALUE | rb_proc_times (VALUE)
VALUE | rb_detach_process (rb_pid_t pid)

## Detailed Description

Public APIs related to rb_mProcess.

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.

Warning
  Symbols prefixed with either `RBIMPL` or `rbimpl` are implementation details. Don't take them as canon. They could rapidly appear then vanish. The name (path) of this header file is also an implementation detail. Do not expect it to persist at the place it is now. Developers are free to move it anywhere anytime at will.

Note
  To ruby-core: remember that this header can be possibly recursively included from extension libraries written in C++. Do not expect for instance `__VA_ARGS__` is always available. We assume C99 for ruby itself but we don't assume languages of extension libraries. They could be written in C++98.

Definition in file process.h.

## Function Documentation

## ◆ rb_detach_process()

VALUE rb_detach_process | ( | rb_pid_t | pid | ) |

Definition at line 1646 of file process.c.

References rb_process_status::pid, PIDT2NUM, ruby::backward::cxxanyargs::rb_thread_create(), and rb_thread_local_aset().

## ◆ rb_f_exec()

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

Definition at line 3109 of file process.c.

References argc, argv, CHILD_ERRMSG_BUFLEN, rb_execarg::cmd, rb_execarg::command_name, err, FALSE, rb_execarg::invoke, mjit_enabled, Qnil, rb_execarg_get(), rb_execarg_new(), RB_GC_GUARD, rb_jump_tag(), rb_protect(), rb_syserr_fail_str(), rb_execarg::sh, rb_execarg::shell_script, TRUE, UNREACHABLE_RETURN, and rb_execarg::use_shell.

## ◆ rb_last_status_get()

VALUE rb_last_status_get | ( | void |  | ) |

Definition at line 596 of file process.c.

## ◆ rb_last_status_set()

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

Definition at line 660 of file process.c.

References rb_process_status::pid, rb_process_status_new(), and rb_process_status::status.

## ◆ rb_proc_exec()

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

Definition at line 1891 of file process.c.

References Qfalse, and str.

## ◆ rb_proc_times()

VALUE rb_proc_times | ( | VALUE |  | ) |

## ◆ rb_spawn()

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

Definition at line 4676 of file process.c.

References argc, argv, and NULL.

## ◆ rb_spawn_err()

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

Definition at line 4670 of file process.c.

References argc, and argv.

## ◆ rb_syswait()

void rb_syswait | ( | rb_pid_t | pid | ) |

Definition at line 4539 of file process.c.

References rb_waitpid().

## ◆ rb_waitpid()

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

Definition at line 1443 of file process.c.

References rb_process_status::error, NIL_P, rb_process_status::pid, waitpid_state::pid, rb_process_status_wait(), RTYPEDDATA_DATA, rb_process_status::status, and waitpid_state::status.

Referenced by rb_syswait().