Ruby 1.9.2p136(2010-12-25revision30365)

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

Data Structures | Defines | Typedefs | Functions

# include/ruby/win32.h File Reference

`#include <winsock2.h>`
`#include <ws2tcpip.h>`
`#include <stdio.h>`
`#include <stdlib.h>`
`#include <string.h>`
`#include <direct.h>`
`#include <process.h>`
`#include <time.h>`
`#include <math.h>`
`#include <signal.h>`
`#include <sys/stat.h>`
`#include <sys/types.h>`
`#include <utime.h>`
`#include <io.h>`
`#include <malloc.h>`
`#include <float.h>`
`#include <errno.h>`
Include dependency graph for win32.h:

Go to the source code of this file.

## Data Structures
struct | iovec
struct | msghdr
struct | tms
## Defines
#define | NT 1
#define | _INTPTR_T_DEFINED
#define | _UINTPTR_T_DEFINED
#define | mode_t int
#define | rb_w32_iswinnt() TRUE
#define | rb_w32_iswin95() FALSE
#define | WNOHANG -1
#define | getc(_stream) rb_w32_getc(_stream)
#define | getchar() rb_w32_getc(stdin)
#define | putc(_c, _stream) rb_w32_putc(_c, _stream)
#define | putchar(_c) rb_w32_putc(_c, stdout)
#define | stat(path, st) rb_w32_stat(path,st)
#define | fstat(fd, st) rb_w32_fstat(fd,st)
#define | access(path, mode) rb_w32_access(path,mode)
#define | strcasecmp _stricmp
#define | strncasecmp _strnicmp
#define | fsync _commit
#define | NtInitialize ruby_sysinit
#define | isnan(x) _isnan(x)
#define | copysign(a, b) _copysign(a, b)
#define | S_IRUSR 0400
#define | S_IRGRP 0040
#define | S_IROTH 0004
#define | S_IWUSR 0200
#define | S_IWGRP 0020
#define | S_IWOTH 0002
#define | S_IXUSR 0100
#define | S_IXGRP 0010
#define | S_IXOTH 0001
#define | SUFFIX
#define | ftruncate rb_w32_ftruncate
#define | PIPE_BUF 1024
#define | LOCK_SH 1
#define | LOCK_EX 2
#define | LOCK_NB 4
#define | LOCK_UN 8
#define | SIGINT 2
#define | SIGKILL 9
#define | EWOULDBLOCK WSAEWOULDBLOCK
#define | EINPROGRESS WSAEINPROGRESS
#define | EALREADY WSAEALREADY
#define | ENOTSOCK WSAENOTSOCK
#define | EDESTADDRREQ WSAEDESTADDRREQ
#define | EMSGSIZE WSAEMSGSIZE
#define | EPROTOTYPE WSAEPROTOTYPE
#define | ENOPROTOOPT WSAENOPROTOOPT
#define | EPROTONOSUPPORT WSAEPROTONOSUPPORT
#define | ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT
#define | EOPNOTSUPP WSAEOPNOTSUPP
#define | EPFNOSUPPORT WSAEPFNOSUPPORT
#define | EAFNOSUPPORT WSAEAFNOSUPPORT
#define | EADDRINUSE WSAEADDRINUSE
#define | EADDRNOTAVAIL WSAEADDRNOTAVAIL
#define | ENETDOWN WSAENETDOWN
#define | ENETUNREACH WSAENETUNREACH
#define | ENETRESET WSAENETRESET
#define | ECONNABORTED WSAECONNABORTED
#define | ECONNRESET WSAECONNRESET
#define | ENOBUFS WSAENOBUFS
#define | EISCONN WSAEISCONN
#define | ENOTCONN WSAENOTCONN
#define | ESHUTDOWN WSAESHUTDOWN
#define | ETOOMANYREFS WSAETOOMANYREFS
#define | ETIMEDOUT WSAETIMEDOUT
#define | ECONNREFUSED WSAECONNREFUSED
#define | ELOOP WSAELOOP
#define | EHOSTDOWN WSAEHOSTDOWN
#define | EHOSTUNREACH WSAEHOSTUNREACH
#define | EPROCLIM WSAEPROCLIM
#define | EUSERS WSAEUSERS
#define | EDQUOT WSAEDQUOT
#define | ESTALE WSAESTALE
#define | EREMOTE WSAEREMOTE
#define | F_SETFL 1
#define | O_NONBLOCK 1
#define | FD_SET(f, s) rb_w32_fdset(f, s)
#define | FD_CLR(f, s) rb_w32_fdclr(f, s)
#define | FD_ISSET(f, s) rb_w32_fdisset(f, s)
## Typedefs
typedef int | intptr_t
typedef unsigned int | uintptr_t
typedef uintptr_t(* | asynchronous_func_t )(uintptr_t self, int argc, uintptr_t *argv)
## Functions
int | rb_w32_stat (const char *, struct stat *)
int | rb_w32_fstat (int, struct stat *)
int | rb_w32_cmdvector (const char *, char ***)
rb_pid_t | rb_w32_pipe_exec (const char *, const char *, int, int *, int *)
int | flock (int fd, int oper)
int | rb_w32_has_cancel_io (void)
int | rb_w32_is_socket (int)
int WSAAPI | rb_w32_accept (int, struct sockaddr *, int *)
int WSAAPI | rb_w32_bind (int, const struct sockaddr *, int)
int WSAAPI | rb_w32_connect (int, const struct sockaddr *, int)
void | rb_w32_fdset (int, fd_set *)
void | rb_w32_fdclr (int, fd_set *)
int | rb_w32_fdisset (int, fd_set *)
int WSAAPI | rb_w32_select (int, fd_set *, fd_set *, fd_set *, struct timeval *)
int WSAAPI | rb_w32_getpeername (int, struct sockaddr *, int *)
int WSAAPI | rb_w32_getsockname (int, struct sockaddr *, int *)
int WSAAPI | rb_w32_getsockopt (int, int, int, char *, int *)
int WSAAPI | rb_w32_ioctlsocket (int, long, u_long *)
int WSAAPI | rb_w32_listen (int, int)
int WSAAPI | rb_w32_recv (int, char *, int, int)
int WSAAPI | rb_w32_recvfrom (int, char *, int, int, struct sockaddr *, int *)
int WSAAPI | rb_w32_send (int, const char *, int, int)
int WSAAPI | rb_w32_sendto (int, const char *, int, int, const struct sockaddr *, int)
int | recvmsg (int, struct msghdr *, int)
int | sendmsg (int, const struct msghdr *, int)
int WSAAPI | rb_w32_setsockopt (int, int, int, const char *, int)
int WSAAPI | rb_w32_shutdown (int, int)
int WSAAPI | rb_w32_socket (int, int, int)
SOCKET | rb_w32_get_osfhandle (int)
struct hostent *WSAAPI | rb_w32_gethostbyaddr (const char *, int, int)
struct hostent *WSAAPI | rb_w32_gethostbyname (const char *)
int WSAAPI | rb_w32_gethostname (char *, int)
struct protoent *WSAAPI | rb_w32_getprotobyname (const char *)
struct protoent *WSAAPI | rb_w32_getprotobynumber (int)
struct servent *WSAAPI | rb_w32_getservbyname (const char *, const char *)
struct servent *WSAAPI | rb_w32_getservbyport (int, const char *)
int | rb_w32_socketpair (int, int, int, int *)
char * | rb_w32_getcwd (char *, int)
char * | rb_w32_getenv (const char *)
int | rb_w32_rename (const char *, const char *)
int | rb_w32_urename (const char *, const char *)
char ** | rb_w32_get_environ (void)
void | rb_w32_free_environ (char **)
int | rb_w32_map_errno (DWORD)
int | chown (const char *, int, int)
int | rb_w32_uchown (const char *, int, int)
int | link (const char *, const char *)
int | rb_w32_ulink (const char *, const char *)
int | gettimeofday (struct timeval *, struct timezone *)
rb_pid_t | waitpid (rb_pid_t, int *, int)
rb_pid_t | rb_w32_spawn (int, const char *, const char *)
rb_pid_t | rb_w32_aspawn (int, const char *, char *const *)
int | kill (int, int)
int | fcntl (int, int,...)
rb_pid_t | rb_w32_getpid (void)
rb_pid_t | rb_w32_getppid (void)
int | rb_w32_isatty (int)
int | rb_w32_uchdir (const char *)
int | rb_w32_mkdir (const char *, int)
int | rb_w32_umkdir (const char *, int)
int | rb_w32_rmdir (const char *)
int | rb_w32_urmdir (const char *)
int | rb_w32_unlink (const char *)
int | rb_w32_uunlink (const char *)
int | rb_w32_uchmod (const char *, int)
int | rb_w32_stati64 (const char *, struct stati64 *)
int | rb_w32_ustati64 (const char *, struct stati64 *)
int | rb_w32_access (const char *, int)
int | rb_w32_uaccess (const char *, int)
static int | finite (double x)
static double | scalb (double a, long b)
int | truncate (const char *path, off_t length)
int | ftruncate (int fd, off_t length)
int | fseeko (FILE *stream, off_t offset, int whence)
off_t | ftello (FILE *stream)
int | ioctl (int, int,...)
rb_uid_t | getuid (void)
rb_uid_t | geteuid (void)
rb_gid_t | getgid (void)
rb_gid_t | getegid (void)
int | setuid (rb_uid_t)
int | setgid (rb_gid_t)
char * | rb_w32_strerror (int)
int | rb_w32_times (struct tms *)
HANDLE | GetCurrentThreadHandle (void)
int | rb_w32_sleep (unsigned long msec)
int | rb_w32_putc (int, FILE *)
int | rb_w32_getc (FILE *)
int | rb_w32_open (const char *, int,...)
int | rb_w32_uopen (const char *, int,...)
int | rb_w32_wopen (const WCHAR *, int,...)
int | rb_w32_close (int)
int | rb_w32_fclose (FILE *)
int | rb_w32_pipe (int[2])
size_t | rb_w32_read (int, void *, size_t)
size_t | rb_w32_write (int, const void *, size_t)
int | rb_w32_utime (const char *, const struct utimbuf *)
int | rb_w32_uutime (const char *, const struct utimbuf *)
long | rb_w32_write_console (unsigned long, int)
int WINAPI | rb_w32_Sleep (unsigned long msec)
int | rb_w32_wait_events_blocking (HANDLE *events, int num, DWORD timeout)
uintptr_t | rb_w32_asynchronize (asynchronous_func_t func, uintptr_t self, int argc, uintptr_t *argv, uintptr_t intrval)

## Define Documentation

#define _INTPTR_T_DEFINED

Definition at line 83 of file win32.h.

#define _UINTPTR_T_DEFINED

Definition at line 91 of file win32.h.

#define access | ( |  | path,
|  |  | mode
| ) |  | rb_w32_access(path,mode)

Definition at line 194 of file win32.h.

Referenced by access_internal(), eaccess(), path_check_0(), rb_file_identical_p(), and rb_w32_wopen().

#define copysign | ( |  | a,
|  |  | b
| ) |  | _copysign(a, b)

Definition at line 312 of file win32.h.

#define EADDRINUSE WSAEADDRINUSE

Definition at line 458 of file win32.h.

Referenced by rb_w32_strerror().

#define EADDRNOTAVAIL WSAEADDRNOTAVAIL

Definition at line 461 of file win32.h.

#define EAFNOSUPPORT WSAEAFNOSUPPORT

Definition at line 455 of file win32.h.

Referenced by socketpair_internal().

#define EALREADY WSAEALREADY

Definition at line 425 of file win32.h.

Referenced by rsock_connect().

#define ECONNABORTED WSAECONNABORTED

Definition at line 473 of file win32.h.

Referenced by rsock_s_accept_nonblock().

#define ECONNREFUSED WSAECONNREFUSED

Definition at line 497 of file win32.h.

#define ECONNRESET WSAECONNRESET

Definition at line 476 of file win32.h.

Referenced by ruby_close(), ruby_getpeername(), ruby_getsockname(), and ruby_shutdown().

#define EDESTADDRREQ WSAEDESTADDRREQ

Definition at line 431 of file win32.h.

#define EDQUOT WSAEDQUOT

Definition at line 517 of file win32.h.

#define EHOSTDOWN WSAEHOSTDOWN

Definition at line 504 of file win32.h.

#define EHOSTUNREACH WSAEHOSTUNREACH

Definition at line 507 of file win32.h.

#define EINPROGRESS WSAEINPROGRESS

Definition at line 422 of file win32.h.

Referenced by rb_w32_connect(), rsock_connect(), and sock_connect_nonblock().

#define EISCONN WSAEISCONN

Definition at line 482 of file win32.h.

Referenced by rsock_connect().

#define ELOOP WSAELOOP

Definition at line 500 of file win32.h.

Referenced by realpath_rec().

#define EMSGSIZE WSAEMSGSIZE

Definition at line 434 of file win32.h.

#define ENETDOWN WSAENETDOWN

Definition at line 464 of file win32.h.

#define ENETRESET WSAENETRESET

Definition at line 470 of file win32.h.

#define ENETUNREACH WSAENETUNREACH

Definition at line 467 of file win32.h.

#define ENOBUFS WSAENOBUFS

Definition at line 479 of file win32.h.

#define ENOPROTOOPT WSAENOPROTOOPT

Definition at line 440 of file win32.h.

#define ENOTCONN WSAENOTCONN

Definition at line 485 of file win32.h.

#define ENOTSOCK WSAENOTSOCK

Definition at line 428 of file win32.h.

#define EOPNOTSUPP WSAEOPNOTSUPP

Definition at line 449 of file win32.h.

#define EPFNOSUPPORT WSAEPFNOSUPPORT

Definition at line 452 of file win32.h.

#define EPROCLIM WSAEPROCLIM

Definition at line 511 of file win32.h.

#define EPROTONOSUPPORT WSAEPROTONOSUPPORT

Definition at line 443 of file win32.h.

#define EPROTOTYPE WSAEPROTOTYPE

Definition at line 437 of file win32.h.

Referenced by socketpair_internal().

#define EREMOTE WSAEREMOTE

Definition at line 523 of file win32.h.

#define ESHUTDOWN WSAESHUTDOWN

Definition at line 488 of file win32.h.

#define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT

Definition at line 446 of file win32.h.

#define ESTALE WSAESTALE

Definition at line 520 of file win32.h.

#define ETIMEDOUT WSAETIMEDOUT

Definition at line 494 of file win32.h.

#define ETOOMANYREFS WSAETOOMANYREFS

Definition at line 491 of file win32.h.

#define EUSERS WSAEUSERS

Definition at line 514 of file win32.h.

#define EWOULDBLOCK WSAEWOULDBLOCK

Definition at line 419 of file win32.h.

#define F_SETFL 1

Definition at line 526 of file win32.h.

Referenced by fcntl(), Init_fcntl(), make_fd_nonblock(), rb_io_ctl(), and rb_io_set_nonblock().

#define FD_CLR | ( |  | f,
|  |  | s
| ) |  | rb_w32_fdclr(f, s)

Definition at line 533 of file win32.h.

#define FD_ISSET | ( |  | f,
|  |  | s
| ) |  | rb_w32_fdisset(f, s)

Definition at line 536 of file win32.h.

#define FD_SET | ( |  | f,
|  |  | s
| ) |  | rb_w32_fdset(f, s)

Definition at line 530 of file win32.h.

Referenced by rb_thread_wait_fd_rw().

#define fstat | ( |  | fd,
|  |  | st
| ) |  | rb_w32_fstat(fd,st)

Definition at line 190 of file win32.h.

Referenced by argf_next_argv(), file_load_ok(), fill_random_seed(), rb_file_atime(), rb_file_ctime(), rb_file_mtime(), rb_file_size(), rb_io_initialize(), rb_io_stat(), rb_stat(), remain_size(), rsock_init_sock(), sdbm_prep(), and wsplit_p().

#define fsync _commit

Definition at line 198 of file win32.h.

Referenced by rb_io_flush().

#define ftruncate rb_w32_ftruncate

Definition at line 373 of file win32.h.

#define getc | ( |  | _stream | ) | rb_w32_getc(_stream)

Definition at line 120 of file win32.h.

#define getchar | ( |  | ) | rb_w32_getc(stdin)

Definition at line 121 of file win32.h.

Referenced by VpFree().

#define isnan | ( |  | x | ) | _isnan(x)

Definition at line 304 of file win32.h.

Referenced by BSD__hdtoa(), BSD_vfprintf(), dbl2big(), erf(), erfc(), f_signbit(), finite(), flo_cmp(), flo_eq(), flo_eql(), flo_ge(), flo_gt(), flo_is_finite_p(), flo_is_nan_p(), flo_le(), flo_lt(), flo_to_s(), float_arg(), float_denominator(), float_numerator(), float_value(), flodivmod(), generate_json(), opt_eq_func(), rb_big_eq(), rb_big_fdiv(), rb_dbl_cmp(), rb_str_format(), VpDtoV(), and w_float().

#define LOCK_EX 2

Definition at line 399 of file win32.h.

#define LOCK_NB 4

Definition at line 400 of file win32.h.

#define LOCK_SH 1

Definition at line 398 of file win32.h.

#define LOCK_UN 8

Definition at line 401 of file win32.h.

#define mode_t int

Definition at line 95 of file win32.h.

Referenced by get_device_once(), rb_exec_arg_addopt(), rb_io_open(), rb_io_s_sysopen(), rb_open_file(), rb_run_exec_options_err(), and rb_scan_open_args().

#define NT 1

Definition at line 40 of file win32.h.

#define NtInitialize ruby_sysinit

Definition at line 221 of file win32.h.

#define O_NONBLOCK 1

Definition at line 527 of file win32.h.

Referenced by fcntl(), fill_random_seed(), Init_fcntl(), Init_IO(), make_fd_nonblock(), overlapped_socket_io(), rb_io_ctl(), rb_io_set_nonblock(), recvmsg(), sendmsg(), and wsplit_p().

#define PIPE_BUF 1024

Definition at line 396 of file win32.h.

#define putc | ( |  | _c,
|  |  | _stream
| ) |  | rb_w32_putc(_c, _stream)

Definition at line 122 of file win32.h.

#define putchar | ( |  | _c | ) | rb_w32_putc(_c, stdout)

Definition at line 123 of file win32.h.

#define rb_w32_iswin95 | ( |  | ) | FALSE

Definition at line 104 of file win32.h.

Referenced by rb_file_identical_p().

#define rb_w32_iswinnt | ( |  | ) | TRUE

Definition at line 103 of file win32.h.

#define S_IRGRP 0040

Definition at line 342 of file win32.h.

Referenced by rb_stat_R(), and rb_stat_r().

#define S_IROTH 0004

Definition at line 345 of file win32.h.

Referenced by rb_file_world_readable_p(), rb_stat_R(), rb_stat_r(), and rb_stat_wr().

#define S_IRUSR 0400

Definition at line 339 of file win32.h.

Referenced by rb_stat_R(), and rb_stat_r().

#define S_IWGRP 0020

Definition at line 352 of file win32.h.

Referenced by rb_stat_W(), rb_stat_w(), and wstati64().

#define S_IWOTH 0002

Definition at line 355 of file win32.h.

#define S_IWUSR 0200

Definition at line 349 of file win32.h.

Referenced by fileattr_to_unixmode(), rb_stat_W(), and rb_stat_w().

#define S_IXGRP 0010

Definition at line 362 of file win32.h.

Referenced by rb_stat_X(), and rb_stat_x().

#define S_IXOTH 0001

Definition at line 365 of file win32.h.

Referenced by rb_stat_X(), and rb_stat_x().

#define S_IXUSR 0100

Definition at line 359 of file win32.h.

Referenced by rb_stat_X(), and rb_stat_x().

#define SIGINT 2

Definition at line 405 of file win32.h.

Referenced by default_handler(), Init_signal(), interrupt_init(), kill(), rb_signal_exec(), rb_syswait(), and ruby_sig_finalize().

#define SIGKILL 9

Definition at line 408 of file win32.h.

Referenced by kill().

#define stat | ( |  | path,
|  |  | st
| ) |  | rb_w32_stat(path,st)

Definition at line 189 of file win32.h.

Referenced by argf_next_argv(), dln_find_1(), do_stat(), eaccess(), file_expand_path(), file_load_ok(), fill_random_seed(), get_stat(), glob_helper(), main(), path_check_0(), rb_f_test(), rb_file_atime(), rb_file_blockdev_p(), rb_file_chardev_p(), rb_file_ctime(), rb_file_directory_p(), rb_file_exist_p(), rb_file_file_p(), rb_file_grpowned_p(), rb_file_identical_p(), rb_file_lstat(), rb_file_mtime(), rb_file_owned_p(), rb_file_pipe_p(), rb_file_rowned_p(), rb_file_s_atime(), rb_file_s_ctime(), rb_file_s_ftype(), rb_file_s_lstat(), rb_file_s_mtime(), rb_file_s_size(), rb_file_s_stat(), rb_file_size(), rb_file_size_p(), rb_file_socket_p(), rb_file_symlink_p(), rb_file_world_readable_p(), rb_file_world_writable_p(), rb_file_zero_p(), rb_io_initialize(), rb_io_stat(), rb_stat_init(), rb_stat_init_copy(), rb_stat_inspect(), rb_stat_R(), rb_stat_r(), rb_stat_W(), rb_stat_w(), rb_stat_X(), rb_stat_x(), realpath_rec(), remain_size(), rsock_init_sock(), sdbm_prep(), stat_memsize(), stat_new_0(), vm_call_method(), and wsplit_p().

#define strcasecmp _stricmp

Definition at line 196 of file win32.h.

Referenced by is_batch(), is_command_com(), and ole_method_sub().

#define strncasecmp _strnicmp

Definition at line 197 of file win32.h.

Referenced by file_expand_path(), and rb_w32_getenv().

#define SUFFIX

Definition at line 372 of file win32.h.

#define WNOHANG -1

Definition at line 107 of file win32.h.

Referenced by Init_process(), and pty_check().

## Typedef Documentation

typedef uintptr_t(* asynchronous_func_t)(uintptr_t self, int argc, uintptr_t *argv)

Definition at line 662 of file win32.h.

typedef int intptr_t

Definition at line 81 of file win32.h.

typedef unsigned int uintptr_t

Definition at line 89 of file win32.h.

## Function Documentation

int chown | ( | const char * | ,
|  | int | ,
|  | int |
| ) |  |

Definition at line 3718 of file win32.c.

Referenced by argf_next_argv(), chown_internal(), get_device_once(), and rb_file_chown().

int fcntl | ( | int | ,
|  | int | ,
|  |  | ...
| ) |  |

Definition at line 3507 of file win32.c.

References errno, F_SETFL, is_socket(), map_errno, O_NONBLOCK, RUBY_CRITICAL, st_insert, st_lookup, TO_SOCKET, and u_long.

Referenced by dup2(), io_cntl(), make_fd_nonblock(), rb_io_initialize(), rb_io_set_nonblock(), run_exec_dup2(), and wsplit_p().

static int finite | ( | double | x | ) | `[inline, static]`

Definition at line 307 of file win32.h.

int flock | ( | int | fd,
|  | int | oper
| ) |  |

Definition at line 124 of file flock.c.

References flock_winnt(), IsWinNT, NULL, rb_notimplement(), and rb_w32_asynchronize().

int fseeko | ( | FILE * | stream,
|  | off_t | offset,
|  | int | whence
| ) |  |

Definition at line 4407 of file win32.c.

References fileno, off_t, SEEK_CUR, and SEEK_END.

off_t ftello | ( | FILE * | stream | ) |

Definition at line 4429 of file win32.c.

References off_t.

int ftruncate | ( | int | fd,
|  | off_t | length
| ) |  |

Definition at line 4356 of file win32.c.

References IsWin95, and rb_chsize().

HANDLE GetCurrentThreadHandle | ( | void |  | ) |

Definition at line 270 of file win32.c.

References FALSE, and NULL.

rb_gid_t getegid | ( | void |  | ) |

Definition at line 2240 of file win32.c.

References ROOT_GID.

Referenced by init_ids(), Init_process(), p_gid_change_privilege(), p_gid_exchange(), p_gid_switch(), proc_getegid(), and rb_group_member().

rb_uid_t geteuid | ( | void |  | ) |

Definition at line 2228 of file win32.c.

References ROOT_UID.

Referenced by eaccess(), init_ids(), Init_process(), p_gid_change_privilege(), p_uid_change_privilege(), p_uid_exchange(), p_uid_switch(), proc_geteuid(), rb_file_owned_p(), rb_setegid_core(), rb_seteuid_core(), rb_stat_owned(), rb_stat_r(), rb_stat_w(), and rb_stat_x().

rb_gid_t getgid | ( | void |  | ) |

Definition at line 2234 of file win32.c.

References ROOT_GID.

Referenced by etc_getgrgid(), get_device_once(), init_ids(), p_gid_change_privilege(), p_gid_exchange(), p_gid_switch(), proc_getgid(), rb_group_member(), and rb_setegid_core().

int gettimeofday | ( | struct timeval * | ,
|  | struct timezone * |
| ) |  |

Definition at line 3668 of file win32.c.

References filetime_to_timeval().

Referenced by do_select(), fill_random_seed(), getclockofday(), rb_strftime_with_timespec(), rb_w32_select(), time_init_0(), and timeofday().

rb_uid_t getuid | ( | void |  | ) |

Definition at line 2222 of file win32.c.

References ROOT_UID.

Referenced by chfunc(), establishShell(), etc_getpwuid(), get_device_once(), init_ids(), p_uid_change_privilege(), p_uid_exchange(), p_uid_switch(), proc_getuid(), rb_file_rowned_p(), rb_seteuid_core(), rb_stat_R(), rb_stat_rowned(), rb_stat_W(), and rb_stat_X().

int ioctl | ( | int | ,
|  | int | ,
|  |  | ...
| ) |  |

Definition at line 2262 of file win32.c.

References errno.

Referenced by chfunc(), get_device_once(), io_cntl(), io_nread(), io_ready_p(), and io_wait().

int kill | ( | int | ,
|  | int |
| ) |  |

Definition at line 3730 of file win32.c.

References EPERM, err, errno, FALSE, IfWin95, map_errno, NULL, RUBY_CRITICAL, SIGINT, and SIGKILL.

Referenced by raise_from_check(), and rb_f_kill().

int link | ( | const char * | ,
|  | const char * |
| ) |  |

Definition at line 3866 of file win32.c.

References filecp_to_wstr(), free, NULL, and wlink().

Referenced by r_object0(), rb_exec_end_proc(), rb_mark_end_proc(), rb_set_end_proc(), and realpath_rec().

int WSAAPI rb_w32_accept | ( | int | ,
|  | struct sockaddr * | ,
|  | int * |
| ) |  |

Definition at line 2641 of file win32.c.

References _pioinfo, _set_osfhnd, errno, map_errno, MTHREAD_ONLY, NULL, O_BINARY, rb_w32_open_osfhandle(), RUBY_CRITICAL, st_insert, StartSockets(), and TO_SOCKET.

int rb_w32_access | ( | const char * | ,
|  | int |
| ) |  |

Definition at line 4271 of file win32.c.

References errno, and rb_w32_stati64().

rb_pid_t rb_w32_aspawn | ( | int | ,
|  | const char * | ,
|  | char *const * |
| ) |  |

Definition at line 1171 of file win32.c.

References ALLOCA_N, argv, check_spawn_mode(), child_result(), CreateChild(), dln_find_exe_r(), FALSE, fbuf, getenv(), internal_cmd_match(), is_batch(), is_command_com(), join_argv(), len, MAXPATHLEN, NULL, strchr(), strlcat(), strlcpy(), STRNDUPA, and translate_char().

Referenced by pipe_open().

uintptr_t rb_w32_asynchronize | ( | asynchronous_func_t | func,
|  | uintptr_t | self,
|  | int | argc,
|  | uintptr_t * | argv,
|  | uintptr_t | intrval
| ) |  |

Definition at line 4551 of file win32.c.

References argc, asynchronous_arg_t::argc, argv, asynchronous_arg_t::argv, call_asynchronous(), Debug, errno, asynchronous_arg_t::errnum, FALSE, func, asynchronous_arg_t::func, NULL, rb_fatal(), rb_w32_wait_events_blocking(), RUBY_CRITICAL, asynchronous_arg_t::self, asynchronous_arg_t::stackaddr, TRUE, yield_once, and yield_until.

Referenced by flock().

int WSAAPI rb_w32_bind | ( | int | ,
|  | const struct sockaddr * | ,
|  | int |
| ) |  |

Definition at line 2676 of file win32.c.

References errno, map_errno, RUBY_CRITICAL, StartSockets(), and TO_SOCKET.

int rb_w32_close | ( | int |  | ) |

Definition at line 5025 of file win32.c.

References _set_osfhnd, errno, is_socket(), LK_LEN, map_errno, NULL, st_delete, and TO_SOCKET.

Referenced by rb_w32_pipe(), and rb_w32_socketpair().

int rb_w32_cmdvector | ( | const char * | ,
|  | char *** |
| ) |  |

Definition at line 1348 of file win32.c.

References calloc, CharNext, cmdglob(), _NtCmdLineElement::flags, free, ISSPACE, _NtCmdLineElement::len, len, malloc, _NtCmdLineElement::next, NTMALLOC, NULL, skipspace(), _NtCmdLineElement::str, strdup, and strlcpy().

Referenced by rb_w32_sysinit().

int WSAAPI rb_w32_connect | ( | int | ,
|  | const struct sockaddr * | ,
|  | int |
| ) |  |

Definition at line 2694 of file win32.c.

References EINPROGRESS, err, errno, map_errno, RUBY_CRITICAL, StartSockets(), and TO_SOCKET.

int rb_w32_fclose | ( | FILE * |  | ) |

Definition at line 4911 of file win32.c.

References _set_osfhnd, errno, fileno, is_socket(), LK_LEN, map_errno, and TO_SOCKET.

void rb_w32_fdclr | ( | int | ,
|  | fd_set * |
| ) |  |

Definition at line 2292 of file win32.c.

References memmove(), and TO_SOCKET.

int rb_w32_fdisset | ( | int | ,
|  | fd_set * |
| ) |  |

Definition at line 2309 of file win32.c.

References RUBY_CRITICAL, and TO_SOCKET.

void rb_w32_fdset | ( | int | ,
|  | fd_set * |
| ) |  |

Definition at line 2271 of file win32.c.

References TO_SOCKET.

void rb_w32_free_environ | ( | char ** |  | ) |

Definition at line 4648 of file win32.c.

References free.

int rb_w32_fstat | ( | int | ,
|  | struct stat * |
| ) |  |

char** rb_w32_get_environ | ( | void |  | ) |

Definition at line 4613 of file win32.c.

References env, malloc, NULL, and strdup.

SOCKET rb_w32_get_osfhandle | ( | int |  | ) |

Definition at line 872 of file win32.c.

int rb_w32_getc | ( | FILE * |  | ) |

Definition at line 4493 of file win32.c.

References catch_interrupt(), clearerr, enough_to_get, EOF, and errno.

char* rb_w32_getcwd | ( | char * | ,
|  | int |
| ) |  |

Definition at line 3679 of file win32.c.

References errno, free, len, malloc, map_errno, NULL, and translate_char().

char* rb_w32_getenv | ( | const char * |  | ) |

Definition at line 3891 of file win32.c.

References env, len, map_errno, NULL, and strncasecmp.

Referenced by init_env().

struct hostent* WSAAPI rb_w32_gethostbyaddr | ( | const char * | ,
|  | int | ,
|  | int |
| ) |  | `[read]`

Definition at line 3248 of file win32.c.

References errno, map_errno, NULL, RUBY_CRITICAL, and StartSockets().

struct hostent* WSAAPI rb_w32_gethostbyname | ( | const char * |  | ) | `[read]`

Definition at line 3265 of file win32.c.

References errno, map_errno, NULL, RUBY_CRITICAL, and StartSockets().

int WSAAPI rb_w32_gethostname | ( | char * | ,
|  | int |
| ) |  |

Definition at line 3282 of file win32.c.

References errno, map_errno, RUBY_CRITICAL, and StartSockets().

int WSAAPI rb_w32_getpeername | ( | int | ,
|  | struct sockaddr * | ,
|  | int * |
| ) |  |

Definition at line 2717 of file win32.c.

References errno, map_errno, RUBY_CRITICAL, StartSockets(), and TO_SOCKET.

rb_pid_t rb_w32_getpid | ( | void |  | ) |

Definition at line 4657 of file win32.c.

References IfWin95.

Referenced by rb_w32_pipe().

rb_pid_t rb_w32_getppid | ( | void |  | ) |

Definition at line 4670 of file win32.c.

References IsWin95, len, NULL, rb_w32_osver(), and ULONG().

struct protoent* WSAAPI rb_w32_getprotobyname | ( | const char * |  | ) | `[read]`

Definition at line 3299 of file win32.c.

References errno, map_errno, NULL, RUBY_CRITICAL, and StartSockets().

struct protoent* WSAAPI rb_w32_getprotobynumber | ( | int |  | ) | `[read]`

Definition at line 3316 of file win32.c.

References errno, map_errno, NULL, RUBY_CRITICAL, and StartSockets().

struct servent* WSAAPI rb_w32_getservbyname | ( | const char * | ,
|  | const char * |
| ) |  | `[read]`

Definition at line 3333 of file win32.c.

References errno, map_errno, NULL, RUBY_CRITICAL, and StartSockets().

struct servent* WSAAPI rb_w32_getservbyport | ( | int | ,
|  | const char * |
| ) |  | `[read]`

Definition at line 3350 of file win32.c.

References errno, map_errno, NULL, RUBY_CRITICAL, and StartSockets().

int WSAAPI rb_w32_getsockname | ( | int | ,
|  | struct sockaddr * | ,
|  | int * |
| ) |  |

Definition at line 2734 of file win32.c.

References errno, map_errno, RUBY_CRITICAL, StartSockets(), and TO_SOCKET.

int WSAAPI rb_w32_getsockopt | ( | int | ,
|  | int | ,
|  | int | ,
|  | char * | ,
|  | int * |
| ) |  |

Definition at line 2749 of file win32.c.

References errno, map_errno, RUBY_CRITICAL, StartSockets(), and TO_SOCKET.

int rb_w32_has_cancel_io | ( | void |  | ) |

Definition at line 563 of file win32.c.

References NULL.

int WSAAPI rb_w32_ioctlsocket | ( | int | ,
|  | long | ,
|  | u_long * |
| ) |  |

Definition at line 2766 of file win32.c.

References errno, map_errno, RUBY_CRITICAL, StartSockets(), and TO_SOCKET.

int rb_w32_is_socket | ( | int |  | ) |

Definition at line 2145 of file win32.c.

References is_socket(), and TO_SOCKET.

Referenced by rsock_init_sock().

int rb_w32_isatty | ( | int |  | ) |

Definition at line 5594 of file win32.c.

References _osfile, errno, and FDEV.

int WSAAPI rb_w32_listen | ( | int | ,
|  | int |
| ) |  |

Definition at line 2783 of file win32.c.

References errno, map_errno, RUBY_CRITICAL, StartSockets(), and TO_SOCKET.

int rb_w32_map_errno | ( | DWORD |  | ) |

Definition at line 213 of file win32.c.

References errmap, and winerr.

int rb_w32_mkdir | ( | const char * | ,
|  | int |
| ) |  |

Definition at line 5475 of file win32.c.

References filecp_to_wstr(), free, NULL, and wmkdir().

int rb_w32_open | ( | const char * | ,
|  | int | ,
|  |  | ...
| ) |  |

Definition at line 4722 of file win32.c.

References filecp_to_wstr(), free, NULL, O_BINARY, and rb_w32_wopen().

int rb_w32_pipe | ( | int | [2] | ) |

Definition at line 4933 of file win32.c.

References _pioinfo, _set_osfhnd, _set_osflags, err, errno, FALSE, FNOINHERIT, FOPEN, FPIPE, map_errno, MTHREAD_ONLY, name, NULL, rb_w32_close(), rb_w32_getpid(), RUBY_CRITICAL, snprintf, and strchr().

rb_pid_t rb_w32_pipe_exec | ( | const char * | ,
|  | const char * | ,
|  | int | ,
|  | int * | ,
|  | int * |
| ) |  |

int rb_w32_putc | ( | int | ,
|  | FILE * |
| ) |  |

Definition at line 4514 of file win32.c.

References catch_interrupt(), and enough_to_put.

size_t rb_w32_read | ( | int | ,
|  | void * | ,
|  | size_t |
| ) |  |

Definition at line 5050 of file win32.c.

References _osfhnd, _osfile, _pioinfo, _set_osflags, cancel_io, err, errno, FDEV, FEOFLAG, FPIPE, FTEXT, INVALID_SET_FILE_POINTER, is_console(), is_socket(), len, map_errno, MTHREAD_ONLY, NULL, rb_w32_recv(), rb_w32_wait_events_blocking(), size, TO_SOCKET, TRUE, and wait().

int WSAAPI rb_w32_recv | ( | int | ,
|  | char * | ,
|  | int | ,
|  | int |
| ) |  |

Definition at line 2899 of file win32.c.

References NULL, overlapped_socket_io(), and TRUE.

Referenced by rb_w32_read().

int WSAAPI rb_w32_recvfrom | ( | int | ,
|  | char * | ,
|  | int | ,
|  | int | ,
|  | struct sockaddr * | ,
|  | int * |
| ) |  |

Definition at line 2905 of file win32.c.

References overlapped_socket_io(), and TRUE.

int rb_w32_rename | ( | const char * | ,
|  | const char * |
| ) |  |

Definition at line 3980 of file win32.c.

References filecp_to_wstr(), free, NULL, and wrename().

int rb_w32_rmdir | ( | const char * |  | ) |

Definition at line 5508 of file win32.c.

References filecp_to_wstr(), free, NULL, and wrmdir().

int WSAAPI rb_w32_select | ( | int | ,
|  | fd_set * | ,
|  | fd_set * | ,
|  | fd_set * | ,
|  | struct timeval * |
| ) |  |

Definition at line 2515 of file win32.c.

References compare(), copy_fd(), do_select(), errno, extract_fd(), gettimeofday(), if(), is_console(), is_not_socket(), is_pipe(), is_readable_console(), is_readable_pipe(), NULL, rb_fd_init, rb_fd_term, StartSockets(), subtract(), timeval::tv_sec, timeval::tv_usec, and wait().

int WSAAPI rb_w32_send | ( | int | ,
|  | const char * | ,
|  | int | ,
|  | int |
| ) |  |

Definition at line 2912 of file win32.c.

References FALSE, NULL, and overlapped_socket_io().

Referenced by rb_w32_write().

int WSAAPI rb_w32_sendto | ( | int | ,
|  | const char * | ,
|  | int | ,
|  | int | ,
|  | const struct sockaddr * | ,
|  | int |
| ) |  |

Definition at line 2918 of file win32.c.

References FALSE, and overlapped_socket_io().

int WSAAPI rb_w32_setsockopt | ( | int | ,
|  | int | ,
|  | int | ,
|  | const char * | ,
|  | int |
| ) |  |

Definition at line 3139 of file win32.c.

References errno, map_errno, RUBY_CRITICAL, StartSockets(), and TO_SOCKET.

int WSAAPI rb_w32_shutdown | ( | int | ,
|  | int |
| ) |  |

Definition at line 3156 of file win32.c.

References errno, map_errno, RUBY_CRITICAL, shutdown, StartSockets(), and TO_SOCKET.

int rb_w32_sleep | ( | unsigned long | msec | ) |

Referenced by do_select().

int WINAPI rb_w32_Sleep | ( | unsigned long | msec | ) |

int WSAAPI rb_w32_socket | ( | int | ,
|  | int | ,
|  | int |
| ) |  |

Definition at line 3220 of file win32.c.

References errno, map_errno, O_BINARY, open_ifs_socket(), rb_w32_open_osfhandle(), RUBY_CRITICAL, st_insert, and StartSockets().

int rb_w32_socketpair | ( | int | ,
|  | int | ,
|  | int | ,
|  | int * |
| ) |  |

Definition at line 3455 of file win32.c.

References O_BINARY, rb_w32_close(), rb_w32_open_osfhandle(), socketpair_internal(), and st_insert.

rb_pid_t rb_w32_spawn | ( | int | ,
|  | const char * | ,
|  | const char * |
| ) |  |

Definition at line 1081 of file win32.c.

References ALLOCA_N, CharNext, check_spawn_mode(), child_result(), CreateChild(), dln_find_exe_r(), fbuf, getenv(), has_redirection(), is_batch(), is_command_com(), is_internal_cmd(), ISSPACE, len, MAXPATHLEN, NULL, strchr(), STRNDUPA, and translate_char().

Referenced by pipe_open(), and rb_proc_exec().

int rb_w32_stat | ( | const char * | ,
|  | struct stat * |
| ) |  |

Definition at line 4191 of file win32.c.

References COPY_STAT, and rb_w32_stati64().

int rb_w32_stati64 | ( | const char * | ,
|  | struct stati64 * |
| ) |  |

Definition at line 4258 of file win32.c.

References filecp_to_wstr(), free, NULL, and wstati64().

Referenced by rb_w32_access(), and rb_w32_stat().

char* rb_w32_strerror | ( | int |  | ) |

Definition at line 2159 of file win32.c.

References EADDRINUSE, err, errmap, EWOULDBLOCK, memmove(), NULL, strerror(), strlcpy(), sys_nerr, and winerr.

int rb_w32_times | ( | struct tms * |  | ) |

Definition at line 4447 of file win32.c.

References filetime_to_clock(), tms::tms_cstime, tms::tms_cutime, tms::tms_stime, and tms::tms_utime.

int rb_w32_uaccess | ( | const char * | ,
|  | int |
| ) |  |

Definition at line 4285 of file win32.c.

References errno, and rb_w32_ustati64().

int rb_w32_uchdir | ( | const char * |  | ) |

Definition at line 5430 of file win32.c.

References free, NULL, and utf8_to_wstr().

int rb_w32_uchmod | ( | const char * | ,
|  | int |
| ) |  |

Definition at line 5580 of file win32.c.

References filecp_to_wstr(), free, and NULL.

int rb_w32_uchown | ( | const char * | ,
|  | int | ,
|  | int |
| ) |  |

Definition at line 3724 of file win32.c.

int rb_w32_ulink | ( | const char * | ,
|  | const char * |
| ) |  |

Definition at line 3847 of file win32.c.

References free, NULL, utf8_to_wstr(), and wlink().

int rb_w32_umkdir | ( | const char * | ,
|  | int |
| ) |  |

Definition at line 5462 of file win32.c.

References free, NULL, utf8_to_wstr(), and wmkdir().

int rb_w32_unlink | ( | const char * |  | ) |

Definition at line 5567 of file win32.c.

References filecp_to_wstr(), free, NULL, and wunlink().

int rb_w32_uopen | ( | const char * | ,
|  | int | ,
|  |  | ...
| ) |  |

Definition at line 4703 of file win32.c.

References free, NULL, rb_w32_wopen(), and utf8_to_wstr().

int rb_w32_urename | ( | const char * | ,
|  | const char * |
| ) |  |

Definition at line 3962 of file win32.c.

References free, NULL, utf8_to_wstr(), and wrename().

int rb_w32_urmdir | ( | const char * |  | ) |

Definition at line 5521 of file win32.c.

References free, NULL, utf8_to_wstr(), and wrmdir().

int rb_w32_ustati64 | ( | const char * | ,
|  | struct stati64 * |
| ) |  |

Definition at line 4245 of file win32.c.

References free, NULL, utf8_to_wstr(), and wstati64().

Referenced by rb_w32_uaccess().

int rb_w32_utime | ( | const char * | ,
|  | const struct utimbuf * |
| ) |  |

Definition at line 5417 of file win32.c.

References filecp_to_wstr(), free, NULL, and wutime().

int rb_w32_uunlink | ( | const char * |  | ) |

Definition at line 5554 of file win32.c.

References free, NULL, utf8_to_wstr(), and wunlink().

int rb_w32_uutime | ( | const char * | ,
|  | const struct utimbuf * |
| ) |  |

Definition at line 5404 of file win32.c.

References free, NULL, utf8_to_wstr(), and wutime().

int rb_w32_wait_events_blocking | ( | HANDLE * | events,
|  | int | num,
|  | DWORD | timeout
| ) |  |

Referenced by overlapped_socket_io(), rb_w32_asynchronize(), rb_w32_read(), rb_w32_write(), recvmsg(), sendmsg(), and waitpid().

int rb_w32_wopen | ( | const WCHAR * | ,
|  | int | ,
|  |  | ...
| ) |  |

Definition at line 4744 of file win32.c.

References _osfile, _pioinfo, _set_osfhnd, _set_osflags, access, errno, FALSE, FAPPEND, FDEV, FNOINHERIT, FOPEN, FPIPE, map_errno, MTHREAD_ONLY, NULL, O_BINARY, RUBY_CRITICAL, and TRUE.

Referenced by rb_w32_open(), and rb_w32_uopen().

size_t rb_w32_write | ( | int | ,
|  | const void * | ,
|  | size_t |
| ) |  |

Definition at line 5206 of file win32.c.

References _osfhnd, _osfile, _pioinfo, cancel_io, err, errno, FAPPEND, FDEV, FEOFLAG, FPIPE, FTEXT, INVALID_SET_FILE_POINTER, is_socket(), len, map_errno, MTHREAD_ONLY, NULL, rb_w32_send(), rb_w32_wait_events_blocking(), size, TO_SOCKET, TRUE, and wait().

long rb_w32_write_console | ( | unsigned | long,
|  | int |
| ) |  |

int recvmsg | ( | int | ,
|  | struct msghdr * | ,
|  | int |
| ) |  |

Definition at line 2959 of file win32.c.

References cancel_io, WSAMSG::dwFlags, err, errno, FALSE, len, map_errno, msghdr::msg_flags, msghdr::msg_name, msghdr::msg_namelen, msghdr_to_wsamsg, WSAMSG::name, WSAMSG::namelen, NULL, O_NONBLOCK, rb_w32_wait_events_blocking(), RUBY_CRITICAL, size, st_lookup, StartSockets(), TO_SOCKET, TRUE, and WSAID_WSARECVMSG.

static double scalb | ( | double | a,
|  | long | b
| ) |  | `[inline, static]`

Definition at line 315 of file win32.h.

int sendmsg | ( | int | ,
|  | const struct msghdr * | ,
|  | int |
| ) |  |

Definition at line 3052 of file win32.c.

References cancel_io, err, errno, FALSE, len, map_errno, msghdr_to_wsamsg, NULL, O_NONBLOCK, rb_w32_wait_events_blocking(), RUBY_CRITICAL, size, st_lookup, StartSockets(), TO_SOCKET, TRUE, and WSAID_WSASENDMSG.

int setgid | ( | rb_gid_t |  | ) |

Definition at line 2252 of file win32.c.

References ROOT_GID.

Referenced by p_gid_change_privilege(), and rb_setegid_core().

int setuid | ( | rb_uid_t |  | ) |

Definition at line 2246 of file win32.c.

References ROOT_UID.

Referenced by p_uid_change_privilege(), and rb_seteuid_core().

int truncate | ( | const char * | path,
|  | off_t | length
| ) |  |

Definition at line 4330 of file win32.c.

References errno, IsWin95, map_errno, and rb_chsize().

rb_pid_t waitpid | ( | rb_pid_t | ,
|  | int * | ,
|  | int |
| ) |  |

Definition at line 3585 of file win32.c.

References count, END_FOREACH_CHILD, errno, FindChildSlot(), FindChildSlotByHandle(), FOREACH_CHILD, ChildRecord::hProcess, map_errno, MAXCHILDNUM, ChildRecord::pid, poll_child_status(), rb_w32_wait_events_blocking(), and WNOHANG.

Referenced by rb_waitpid_blocking(), and wait().