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

Ruby 3.2.5p208 (2024-07-26 revision 31d0f1a2e7dbfb60731d1f05b868e1d578cda493)

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
23#include "ruby/internal/attr/nonnull.h"
24#include "ruby/internal/attr/noreturn.h"
25#include "ruby/internal/config.h" /* rb_pid_t is defined here. */
26#include "ruby/internal/dllexport.h"
27#include "ruby/internal/value.h"
28
29 RBIMPL_SYMBOL_EXPORT_BEGIN()
30
31/* process.c */
32
33
40void rb_last_status_set(int status, rb_pid_t pid);
41
49 VALUE rb_last_status_get(void);
50
51 RBIMPL_ATTR_NONNULL(())
61int rb_proc_exec(const char *cmd);
62
63 RBIMPL_ATTR_NORETURN()
171 VALUE rb_f_exec(int argc, const VALUE *argv);
172
190rb_pid_t rb_waitpid(rb_pid_t pid, int *status, int flags);
191
200void rb_syswait(rb_pid_t pid);
201
221rb_pid_t rb_spawn(int argc, const VALUE *argv);
222
240rb_pid_t rb_spawn_err(int argc, const VALUE *argv, char *errbuf, size_t buflen);
241
253 VALUE rb_proc_times(VALUE _);
254
269 VALUE rb_detach_process(rb_pid_t pid);
270
271 RBIMPL_SYMBOL_EXPORT_END()
272
273#endif /* RBIMPL_INTERN_PROCESS_H */
dllexport.h
Tweaking visibility of C variables/functions.
RBIMPL_SYMBOL_EXPORT_END
#define RBIMPL_SYMBOL_EXPORT_END()
Counterpart of RBIMPL_SYMBOL_EXPORT_BEGIN.
Definition dllexport.h:106
RBIMPL_SYMBOL_EXPORT_BEGIN
#define RBIMPL_SYMBOL_EXPORT_BEGIN()
Shortcut macro equivalent to RUBY_SYMBOL_EXPORT_BEGIN extern "C" {.
Definition dllexport.h:97
rb_proc_exec
int rb_proc_exec(const char *cmd)
Executes a shell command.
Definition process.c:1881
rb_last_status_get
VALUE rb_last_status_get(void)
Queries the "last status", or the $?.
Definition process.c:622
rb_waitpid
rb_pid_t rb_waitpid(rb_pid_t pid, int *status, int flags)
Waits for a process, with releasing GVL.
Definition process.c:1434
rb_spawn_err
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:4773
rb_syswait
void rb_syswait(rb_pid_t pid)
This is a shorthand of rb_waitpid without status and flags.
Definition process.c:4642
rb_f_exec
VALUE rb_f_exec(int argc, const VALUE *argv)
Replaces the current process by running the given external command.
Definition process.c:3098
rb_spawn
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:4779
rb_last_status_set
void rb_last_status_set(int status, rb_pid_t pid)
Sets the "last status", or the $?.
Definition process.c:686
rb_detach_process
VALUE rb_detach_process(rb_pid_t pid)
"Detaches" a subprocess.
Definition process.c:1637
nonnull.h
Defines RBIMPL_ATTR_NONNULL.
RBIMPL_ATTR_NONNULL
#define RBIMPL_ATTR_NONNULL(list)
Wraps (or simulates) __attribute__((nonnull))
Definition nonnull.h:30
noreturn.h
Defines RBIMPL_ATTR_NORETURN.
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
value.h
Defines VALUE and ID.
VALUE
uintptr_t VALUE
Type that represents a Ruby object.
Definition value.h:40