Ruby 4.1.0dev (2026-08-15 revision 3349f4107d268658fdf8cc6b979fbb1c923e597f)
process.h
Go to the documentation of this file.
1#ifndef RBIMPL_INTERN_PROCESS_H /*-*-C++-*-vi:se ft=cpp:*/
2#define RBIMPL_INTERN_PROCESS_H
25#include "ruby/internal/config.h" /* rb_pid_t is defined here. */
27#include "ruby/internal/value.h"
28
30
31/* process.c */
32
33
44VALUE rb_process_status_for(rb_pid_t pid, int status, int error);
45
53VALUE rb_process_status_wait(rb_pid_t pid, int flags);
54
62void rb_last_status_set(int status, rb_pid_t pid);
63
72
83int rb_proc_exec(const char *cmd);
84
193VALUE rb_f_exec(int argc, const VALUE *argv);
194
212rb_pid_t rb_waitpid(rb_pid_t pid, int *status, int flags);
213
222void rb_syswait(rb_pid_t pid);
223
243rb_pid_t rb_spawn(int argc, const VALUE *argv);
244
262rb_pid_t rb_spawn_err(int argc, const VALUE *argv, char *errbuf, size_t buflen);
263
275VALUE rb_proc_times(VALUE _);
276
291VALUE rb_detach_process(rb_pid_t pid);
292
294
295#endif /* RBIMPL_INTERN_PROCESS_H */
Tweaking visibility of C variables/functions.
#define RBIMPL_SYMBOL_EXPORT_END()
Counterpart of RBIMPL_SYMBOL_EXPORT_BEGIN.
Definition dllexport.h:74
#define RBIMPL_SYMBOL_EXPORT_BEGIN()
Shortcut macro equivalent to RUBY_SYMBOL_EXPORT_BEGIN extern "C" {.
Definition dllexport.h:65
Defines RBIMPL_ATTR_NONNULL.
#define RBIMPL_ATTR_NONNULL(list)
Wraps (or simulates) __attribute__((nonnull))
Definition nonnull.h:30
int rb_proc_exec(const char *cmd)
Executes a shell command.
Definition process.c:1679
VALUE rb_last_status_get(void)
Queries the "last status", or the $?.
Definition process.c:605
rb_pid_t rb_waitpid(rb_pid_t pid, int *status, int flags)
Waits for a process, with releasing GVL.
Definition process.c:1161
VALUE rb_process_status_for(rb_pid_t pid, int status, int error)
Returns the Ruby value representing a waitpid(2) outcome.
Definition process.c:639
rb_pid_t rb_spawn_err(int argc, const VALUE *argv, char *errbuf, size_t buflen)
Identical to rb_spawn(), except you can additionally know the detailed situation in case of abnormal ...
Definition process.c:4621
void rb_syswait(rb_pid_t pid)
This is a shorthand of rb_waitpid without status and flags.
Definition process.c:4492
VALUE rb_f_exec(int argc, const VALUE *argv)
Replaces the current process by running the given external command.
Definition process.c:2900
rb_pid_t rb_spawn(int argc, const VALUE *argv)
Identical to rb_f_exec(), except it spawns a child process instead of replacing the current one.
Definition process.c:4627
VALUE rb_process_status_wait(rb_pid_t pid, int flags)
Wait for the specified process to terminate, reap it, and return its status.
Definition process.c:1089
void rb_last_status_set(int status, rb_pid_t pid)
Sets the "last status", or the $?.
Definition process.c:676
VALUE rb_detach_process(rb_pid_t pid)
"Detaches" a subprocess.
Definition process.c:1445
Defines RBIMPL_ATTR_NORETURN.
#define RBIMPL_ATTR_NORETURN()
Wraps (or simulates) [[noreturn]]
Definition noreturn.h:38
#define _(args)
This was a transition path from K&R to ANSI.
Definition stdarg.h:35
Defines VALUE and ID.
uintptr_t VALUE
Type that represents a Ruby object.
Definition value.h:40