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

Ruby 4.0.5p0 (2026-05-20 revision 64336ffd0ee9e1f4c05891695a3d7b49cb709721)

select.h
Go to the documentation of this file.
1#ifndef RBIMPL_INTERN_SELECT_H /*-*-C++-*-vi:se ft=cpp:*/
2#define RBIMPL_INTERN_SELECT_H
25#include "ruby/internal/config.h"
26
27#ifdef HAVE_SYS_TYPES_H
28# include <sys/types.h> /* for NFDBITS (BSD Net/2) */
29#endif
30
31#include "ruby/internal/dllexport.h"
32
33/* thread.c */
34#if defined(NFDBITS) && defined(HAVE_RB_FD_INIT)
35# include "ruby/internal/intern/select/largesize.h"
36#elif defined(_WIN32)
37# include "ruby/internal/intern/select/win32.h"
38#
39# define rb_fd_resize(n, f) ((void)(f))
40#else
41# include "ruby/internal/intern/select/posix.h"
42#
43# define rb_fd_resize(n, f) ((void)(f))
44#endif
45
46 RBIMPL_SYMBOL_EXPORT_BEGIN()
47
48struct timeval;
49
84int rb_thread_fd_select(int nfds, rb_fdset_t *rfds, rb_fdset_t *wfds, rb_fdset_t *efds, struct timeval *timeout);
85
86 RBIMPL_SYMBOL_EXPORT_END()
87
88#endif /* RBIMPL_INTERN_SELECT_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:74
RBIMPL_SYMBOL_EXPORT_BEGIN
#define RBIMPL_SYMBOL_EXPORT_BEGIN()
Shortcut macro equivalent to RUBY_SYMBOL_EXPORT_BEGIN extern "C" {.
Definition dllexport.h:65
win32.h
Public APIs to provide rb_fd_select().
largesize.h
Public APIs to provide rb_fd_select().
posix.h
Public APIs to provide rb_fd_select().
rb_thread_fd_select
int rb_thread_fd_select(int nfds, rb_fdset_t *rfds, rb_fdset_t *wfds, rb_fdset_t *efds, struct timeval *timeout)
Waits for multiple file descriptors at once.
Definition thread.c:4546
rb_fdset_t
The data structure which wraps the fd_set bitmap used by select(2).
Definition largesize.h:71
timeval
Definition missing.h:63