Ruby  2.1.10p492(2016-04-01revision54464)
Data Structures | Macros | Typedefs | Functions
win32.h File Reference
#include <winsock2.h>
#include <ws2tcpip.h>
#include <iphlpapi.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>

Go to the source code of this file.

Data Structures

struct  iovec
 
struct  msghdr
 
struct  ifaddrs
 
struct  tms
 

Macros

#define WIN32
 
#define _INTPTR_T_DEFINED
 
#define INTPTR_MAX   2147483647
 
#define INTPTR_MIN   (-INTPTR_MAX-1)
 
#define _UINTPTR_T_DEFINED
 
#define UINTPTR_MAX   4294967295U
 
#define mode_t   int
 
#define rb_w32_iswinnt()   TRUE
 
#define rb_w32_iswin95()   FALSE
 
#define WNOHANG   -1
 
#define CLOCK_REALTIME   0
 
#define CLOCK_MONOTONIC   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 IFNAMSIZ   256
 
#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 HAVE_FTRUNCATE   1
 
#define ftruncate   rb_w32_ftruncate
 
#define HAVE_TRUNCATE   1
 
#define truncate   rb_w32_truncate
 
#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_DUPFD   0
 
#define F_SETFL   4
 
#define O_NONBLOCK   1
 
#define FD_SET(fd, set)
 
#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 int clockid_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 *)
 
DWORD rb_w32_osid (void)
 
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_io_cancelable_p (int)
 
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 socketpair (int, int, int, int *)
 
int getifaddrs (struct ifaddrs **)
 
void freeifaddrs (struct ifaddrs *)
 
char * rb_w32_getcwd (char *, int)
 
char * rb_w32_ugetenv (const char *)
 
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)
 
const char *WSAAPI rb_w32_inet_ntop (int, const void *, char *, size_t)
 
int WSAAPI rb_w32_inet_pton (int, const char *, void *)
 
DWORD rb_w32_osver (void)
 
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 *)
 
int clock_gettime (clockid_t, struct timespec *)
 
int clock_getres (clockid_t, struct timespec *)
 
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 *)
 
rb_pid_t rb_w32_aspawn_flags (int, const char *, char *const *, DWORD)
 
rb_pid_t rb_w32_uspawn (int, const char *, const char *)
 
rb_pid_t rb_w32_uaspawn (int, const char *, char *const *)
 
rb_pid_t rb_w32_uaspawn_flags (int, const char *, char *const *, DWORD)
 
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)
 
char rb_w32_fd_is_text (int)
 
int rb_w32_fstati64 (int, struct stati64 *)
 
int rb_w32_dup2 (int, int)
 
static int finite (double x)
 
static double scalb (double a, long b)
 
int rb_w32_ftruncate (int fd, off_t length)
 
int rb_w32_truncate (const char *path, off_t length)
 
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)
 
int fstati64 (int, struct stati64 *)
 
char * rb_w32_strerror (int)
 
int rb_w32_times (struct tms *)
 
struct tm * gmtime_r (const time_t *, struct tm *)
 
struct tm * localtime_r (const time_t *, struct tm *)
 
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])
 
ssize_t rb_w32_read (int, void *, size_t)
 
ssize_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 (uintptr_t, int)
 
int WINAPI rb_w32_Sleep (unsigned long msec)
 
int rb_w32_wait_events_blocking (HANDLE *events, int num, DWORD timeout)
 
int rb_w32_time_subtract (struct timeval *rest, const struct timeval *wait)
 
int rb_w32_wrap_io_handle (HANDLE, int)
 
int rb_w32_unwrap_io_handle (int)
 
WCHAR * rb_w32_mbstr_to_wstr (UINT, const char *, int, long *)
 
char * rb_w32_wstr_to_mbstr (UINT, const WCHAR *, int, long *)
 
uintptr_t rb_w32_asynchronize (asynchronous_func_t func, uintptr_t self, int argc, uintptr_t *argv, uintptr_t intrval)
 

Macro Definition Documentation

#define _INTPTR_T_DEFINED

Definition at line 89 of file win32.h.

#define _UINTPTR_T_DEFINED

Definition at line 105 of file win32.h.

#define access (   path,
  mode 
)    rb_w32_access(path,mode)
#define CLOCK_MONOTONIC   1

Definition at line 129 of file win32.h.

Referenced by clock_getres(), clock_gettime(), getclockofday(), Init_process(), and timeofday().

#define CLOCK_REALTIME   0

Definition at line 128 of file win32.h.

Referenced by clock_getres(), clock_gettime(), datetime_s_now(), Init_process(), and time_init_0().

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

Definition at line 384 of file win32.h.

#define EADDRINUSE   WSAEADDRINUSE

Definition at line 548 of file win32.h.

Referenced by rb_w32_strerror().

#define EADDRNOTAVAIL   WSAEADDRNOTAVAIL

Definition at line 551 of file win32.h.

#define EAFNOSUPPORT   WSAEAFNOSUPPORT

Definition at line 545 of file win32.h.

Referenced by socketpair_internal().

#define EALREADY   WSAEALREADY

Definition at line 515 of file win32.h.

Referenced by rsock_connect().

#define ECONNABORTED   WSAECONNABORTED

Definition at line 563 of file win32.h.

Referenced by rsock_s_accept_nonblock().

#define ECONNREFUSED   WSAECONNREFUSED

Definition at line 587 of file win32.h.

#define ECONNRESET   WSAECONNRESET

Definition at line 566 of file win32.h.

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

#define EDESTADDRREQ   WSAEDESTADDRREQ

Definition at line 521 of file win32.h.

#define EDQUOT   WSAEDQUOT

Definition at line 607 of file win32.h.

#define EHOSTDOWN   WSAEHOSTDOWN

Definition at line 594 of file win32.h.

#define EHOSTUNREACH   WSAEHOSTUNREACH

Definition at line 597 of file win32.h.

#define EINPROGRESS   WSAEINPROGRESS
#define EISCONN   WSAEISCONN

Definition at line 572 of file win32.h.

Referenced by rsock_connect().

#define ELOOP   WSAELOOP

Definition at line 590 of file win32.h.

Referenced by realpath_rec().

#define EMSGSIZE   WSAEMSGSIZE

Definition at line 524 of file win32.h.

#define ENETDOWN   WSAENETDOWN

Definition at line 554 of file win32.h.

#define ENETRESET   WSAENETRESET

Definition at line 560 of file win32.h.

#define ENETUNREACH   WSAENETUNREACH

Definition at line 557 of file win32.h.

#define ENOBUFS   WSAENOBUFS

Definition at line 569 of file win32.h.

#define ENOPROTOOPT   WSAENOPROTOOPT

Definition at line 530 of file win32.h.

#define ENOTCONN   WSAENOTCONN

Definition at line 575 of file win32.h.

#define ENOTSOCK   WSAENOTSOCK

Definition at line 518 of file win32.h.

#define EOPNOTSUPP   WSAEOPNOTSUPP

Definition at line 539 of file win32.h.

#define EPFNOSUPPORT   WSAEPFNOSUPPORT

Definition at line 542 of file win32.h.

#define EPROCLIM   WSAEPROCLIM

Definition at line 601 of file win32.h.

#define EPROTONOSUPPORT   WSAEPROTONOSUPPORT

Definition at line 533 of file win32.h.

#define EPROTOTYPE   WSAEPROTOTYPE

Definition at line 527 of file win32.h.

Referenced by socketpair_internal().

#define EREMOTE   WSAEREMOTE

Definition at line 613 of file win32.h.

#define ESHUTDOWN   WSAESHUTDOWN

Definition at line 578 of file win32.h.

#define ESOCKTNOSUPPORT   WSAESOCKTNOSUPPORT

Definition at line 536 of file win32.h.

#define ESTALE   WSAESTALE

Definition at line 610 of file win32.h.

#define ETIMEDOUT   WSAETIMEDOUT

Definition at line 584 of file win32.h.

Referenced by lock_func().

#define ETOOMANYREFS   WSAETOOMANYREFS

Definition at line 581 of file win32.h.

#define EUSERS   WSAEUSERS

Definition at line 604 of file win32.h.

#define EWOULDBLOCK   WSAEWOULDBLOCK

Definition at line 509 of file win32.h.

#define F_DUPFD   0

Definition at line 616 of file win32.h.

Referenced by dup2(), fcntl(), Init_fcntl(), and rb_cloexec_fcntl_dupfd().

#define F_SETFL   4

Definition at line 622 of file win32.h.

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

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

Definition at line 647 of file win32.h.

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

Definition at line 650 of file win32.h.

#define FD_SET (   fd,
  set 
)
Value:
do {\
unsigned int i;\
SOCKET s = _get_osfhandle(fd);\
for (i = 0; i < (set)->fd_count; i++) {\
if ((set)->fd_array[i] == s) {\
break;\
}\
}\
if (i == (set)->fd_count) {\
if ((set)->fd_count < FD_SETSIZE) {\
(set)->fd_array[i] = s;\
(set)->fd_count++;\
}\
}\
} while(0)
if(args--[1]==0)
Definition: array.c:3187
i
Definition: enum.c:446
register char * s
Definition: os2.c:56
for(i=0;i< RARRAY_LEN(args);i++)
Definition: enum.c:1997

Definition at line 629 of file win32.h.

Referenced by rb_w32_fdset().

#define fstat (   fd,
  st 
)    rb_w32_fstat(fd,st)
#define fsync   _commit

Definition at line 222 of file win32.h.

#define ftruncate   rb_w32_ftruncate

Definition at line 456 of file win32.h.

#define getc (   _stream)    rb_w32_getc(_stream)

Definition at line 143 of file win32.h.

#define getchar ( )    rb_w32_getc(stdin)

Definition at line 144 of file win32.h.

Referenced by VpFree().

#define HAVE_FTRUNCATE   1

Definition at line 452 of file win32.h.

#define HAVE_TRUNCATE   1

Definition at line 460 of file win32.h.

#define IFNAMSIZ   256

Definition at line 259 of file win32.h.

#define INTPTR_MAX   2147483647

Definition at line 95 of file win32.h.

#define INTPTR_MIN   (-INTPTR_MAX-1)

Definition at line 97 of file win32.h.

#define isnan (   x)    _isnan(x)
#define LOCK_EX   2

Definition at line 489 of file win32.h.

#define LOCK_NB   4

Definition at line 490 of file win32.h.

#define LOCK_SH   1

Definition at line 488 of file win32.h.

#define LOCK_UN   8

Definition at line 491 of file win32.h.

#define mode_t   int
#define O_NONBLOCK   1
#define PIPE_BUF   1024

Definition at line 486 of file win32.h.

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

Definition at line 145 of file win32.h.

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

Definition at line 146 of file win32.h.

#define rb_w32_iswin95 ( )    FALSE

Definition at line 123 of file win32.h.

#define rb_w32_iswinnt ( )    TRUE

Definition at line 122 of file win32.h.

#define S_IRGRP   0040

Definition at line 416 of file win32.h.

Referenced by rb_stat_r(), and rb_stat_R().

#define S_IROTH   0004

Definition at line 419 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 413 of file win32.h.

Referenced by rb_stat_r(), and rb_stat_R().

#define S_IWGRP   0020

Definition at line 426 of file win32.h.

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

#define S_IWOTH   0002

Definition at line 429 of file win32.h.

#define S_IWUSR   0200

Definition at line 423 of file win32.h.

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

#define S_IXGRP   0010

Definition at line 436 of file win32.h.

Referenced by rb_stat_x(), and rb_stat_X().

#define S_IXOTH   0001

Definition at line 439 of file win32.h.

Referenced by rb_stat_x(), and rb_stat_X().

#define S_IXUSR   0100

Definition at line 433 of file win32.h.

Referenced by rb_stat_x(), and rb_stat_X().

#define SIGINT   2
#define SIGKILL   9

Definition at line 498 of file win32.h.

Referenced by kill(), and rb_f_kill().

#define stat (   path,
  st 
)    rb_w32_stat(path,st)
#define strcasecmp   _stricmp

Definition at line 220 of file win32.h.

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

#define strncasecmp   _strnicmp
#define SUFFIX

Definition at line 446 of file win32.h.

#define truncate   rb_w32_truncate

Definition at line 464 of file win32.h.

#define UINTPTR_MAX   4294967295U

Definition at line 111 of file win32.h.

#define WIN32

Definition at line 36 of file win32.h.

#define WNOHANG   -1

Definition at line 125 of file win32.h.

Referenced by Init_process(), pty_check(), and waitpid().

Typedef Documentation

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

Definition at line 789 of file win32.h.

typedef int clockid_t

Definition at line 127 of file win32.h.

typedef int intptr_t

Definition at line 87 of file win32.h.

typedef unsigned int uintptr_t

Definition at line 103 of file win32.h.

Function Documentation

int chown ( const char *  ,
int  ,
int   
)

Definition at line 4431 of file win32.c.

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

int clock_getres ( clockid_t  ,
struct timespec  
)

Definition at line 4363 of file win32.c.

References CLOCK_MONOTONIC, CLOCK_REALTIME, errno, map_errno, timespec::tv_nsec, and timespec::tv_sec.

Referenced by rb_clock_getres().

int clock_gettime ( clockid_t  ,
struct timespec  
)
int fcntl ( int  ,
int  ,
  ... 
)
static int finite ( double  x)
inlinestatic

Definition at line 379 of file win32.h.

int flock ( int  fd,
int  oper 
)

Definition at line 125 of file flock.c.

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

void freeifaddrs ( struct ifaddrs )

Definition at line 3983 of file win32.c.

References ifaddrs::ifa_addr, ifaddrs::ifa_name, ifaddrs::ifa_next, and ruby_xfree().

int fstati64 ( int  ,
struct stati64 *   
)
rb_gid_t getegid ( void  )
rb_uid_t geteuid ( void  )
rb_gid_t getgid ( void  )
int getifaddrs ( struct ifaddrs **  )
int gettimeofday ( struct timeval ,
struct timezone  
)
rb_uid_t getuid ( void  )
struct tm* gmtime_r ( const time_t *  ,
struct tm *   
)

Definition at line 7103 of file win32.c.

References e, errno, NULL, st, systemtime_to_tm(), and unixtime_to_systemtime().

int ioctl ( int  ,
int  ,
  ... 
)

Definition at line 2544 of file win32.c.

Referenced by chfunc(), get_device_once(), io_nread(), io_ready_p(), io_wait_readable(), and nogvl_ioctl().

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

Definition at line 4601 of file win32.c.

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

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

struct tm* localtime_r ( const time_t *  ,
struct tm *   
)
int WSAAPI rb_w32_accept ( int  ,
struct sockaddr *  ,
int  
)
int rb_w32_access ( const char *  ,
int   
)

Definition at line 5115 of file win32.c.

References errno, and rb_w32_stati64.

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

Definition at line 1439 of file win32.c.

References rb_w32_aspawn_flags().

rb_pid_t rb_w32_aspawn_flags ( int  ,
const char *  ,
char *const ,
DWORD   
)

Definition at line 1424 of file win32.c.

References filecp(), and w32_aspawn_flags().

Referenced by rb_w32_aspawn().

uintptr_t rb_w32_asynchronize ( asynchronous_func_t  func,
uintptr_t  self,
int  argc,
uintptr_t argv,
uintptr_t  intrval 
)
int WSAAPI rb_w32_bind ( int  ,
const struct sockaddr *  ,
int   
)

Definition at line 3047 of file win32.c.

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

int rb_w32_close ( int  )

Definition at line 6257 of file win32.c.

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

Referenced by rb_w32_pipe(), and socketpair().

int rb_w32_cmdvector ( const char *  ,
char ***   
)
int WSAAPI rb_w32_connect ( int  ,
const struct sockaddr *  ,
int   
)

Definition at line 3066 of file win32.c.

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

int rb_w32_dup2 ( int  ,
int   
)

Definition at line 5522 of file win32.c.

References dup2(), ret, and set_new_std_fd.

int rb_w32_fclose ( FILE )

Definition at line 5779 of file win32.c.

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

char rb_w32_fd_is_text ( int  )

Definition at line 7021 of file win32.c.

References _osfile, and FTEXT.

void rb_w32_fdclr ( int  ,
fd_set *   
)

Definition at line 2560 of file win32.c.

References i, memmove(), s, and TO_SOCKET.

int rb_w32_fdisset ( int  ,
fd_set *   
)

Definition at line 2578 of file win32.c.

References ret, RUBY_CRITICAL, s, and TO_SOCKET.

void rb_w32_fdset ( int  ,
fd_set *   
)

Definition at line 2551 of file win32.c.

References FD_SET.

void rb_w32_free_environ ( char **  )

Definition at line 5463 of file win32.c.

References env, free, and t.

int rb_w32_fstat ( int  ,
struct stat  
)

Definition at line 4823 of file win32.c.

References filetime_to_unixtime(), fstat, info, ret, S_IWGRP, S_IWOTH, and S_IWUSR.

int rb_w32_fstati64 ( int  ,
struct stati64 *   
)

Definition at line 4847 of file win32.c.

References COPY_STAT, filetime_to_unixtime(), fstat, info, ret, S_IWGRP, S_IWOTH, S_IWUSR, and stat.

int rb_w32_ftruncate ( int  fd,
off_t  length 
)

Definition at line 5190 of file win32.c.

References rb_chsize().

char** rb_w32_get_environ ( void  )

Definition at line 5426 of file win32.c.

References env, malloc(), NULL, and wstr_to_utf8.

SOCKET rb_w32_get_osfhandle ( int  )

Definition at line 988 of file win32.c.

Referenced by rb_io_flush_raw().

int rb_w32_getc ( FILE )

Definition at line 5303 of file win32.c.

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

char* rb_w32_getcwd ( char *  ,
int   
)

Definition at line 4391 of file win32.c.

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

char* rb_w32_getenv ( const char *  )

Definition at line 4673 of file win32.c.

References w32_getenv().

struct hostent* WSAAPI rb_w32_gethostbyaddr ( const char *  ,
int  ,
int   
)

Definition at line 3609 of file win32.c.

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

struct hostent* WSAAPI rb_w32_gethostbyname ( const char *  )

Definition at line 3627 of file win32.c.

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

int WSAAPI rb_w32_gethostname ( char *  ,
int   
)

Definition at line 3645 of file win32.c.

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

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

Definition at line 3090 of file win32.c.

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

rb_pid_t rb_w32_getpid ( void  )

Definition at line 5473 of file win32.c.

Referenced by rb_w32_pipe().

rb_pid_t rb_w32_getppid ( void  )

Definition at line 5481 of file win32.c.

References get_proc_address(), int, len, NULL, rb_w32_osver(), and ULONG().

struct protoent* WSAAPI rb_w32_getprotobyname ( const char *  )

Definition at line 3663 of file win32.c.

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

struct protoent* WSAAPI rb_w32_getprotobynumber ( int  )

Definition at line 3681 of file win32.c.

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

struct servent* WSAAPI rb_w32_getservbyname ( const char *  ,
const char *   
)

Definition at line 3699 of file win32.c.

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

struct servent* WSAAPI rb_w32_getservbyport ( int  ,
const char *   
)

Definition at line 3717 of file win32.c.

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

int WSAAPI rb_w32_getsockname ( int  ,
struct sockaddr *  ,
int  
)
int WSAAPI rb_w32_getsockopt ( int  ,
int  ,
int  ,
char *  ,
int  
)

Definition at line 3141 of file win32.c.

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

const char* WSAAPI rb_w32_inet_ntop ( int  ,
const void ,
char *  ,
size_t   
)

Definition at line 6990 of file win32.c.

References get_proc_address(), memcpy(), NULL, and snprintf.

int WSAAPI rb_w32_inet_pton ( int  ,
const char *  ,
void  
)

Definition at line 7008 of file win32.c.

References get_proc_address(), int, and NULL.

int rb_w32_io_cancelable_p ( int  )

Definition at line 2301 of file win32.c.

References cancel_io, is_console(), is_socket(), NULL, and TO_SOCKET.

int WSAAPI rb_w32_ioctlsocket ( int  ,
long  ,
u_long  
)

Definition at line 3159 of file win32.c.

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

int rb_w32_is_socket ( int  )

Definition at line 2415 of file win32.c.

References is_socket(), and TO_SOCKET.

Referenced by rsock_init_sock().

int rb_w32_isatty ( int  )

Definition at line 6889 of file win32.c.

References _osfhnd, errno, and mode.

int WSAAPI rb_w32_listen ( int  ,
int   
)

Definition at line 3177 of file win32.c.

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

int rb_w32_map_errno ( DWORD  )

Definition at line 250 of file win32.c.

References errmap, i, int, and winerr.

WCHAR* rb_w32_mbstr_to_wstr ( UINT  ,
const char *  ,
int  ,
long *   
)

Definition at line 1976 of file win32.c.

References len, malloc(), NULL, and ptr.

Referenced by dln_load().

int rb_w32_mkdir ( const char *  ,
int   
)

Definition at line 6762 of file win32.c.

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

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

Definition at line 5582 of file win32.c.

References arg, check_if_dir(), errno, filecp_to_wstr, free, NULL, O_BINARY, rb_w32_wopen(), ret, and va_end().

DWORD rb_w32_osid ( void  )
DWORD rb_w32_osver ( void  )

Definition at line 296 of file win32.c.

References osver.

Referenced by rb_w32_getppid().

int rb_w32_pipe ( int  [2])
rb_pid_t rb_w32_pipe_exec ( const char *  ,
const char *  ,
int  ,
int ,
int  
)
int rb_w32_putc ( int  ,
FILE  
)

Definition at line 5324 of file win32.c.

References c, catch_interrupt(), and enough_to_put.

ssize_t rb_w32_read ( int  ,
void ,
size_t   
)
int WSAAPI rb_w32_recv ( int  ,
char *  ,
int  ,
int   
)

Definition at line 3318 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 3325 of file win32.c.

References overlapped_socket_io(), and TRUE.

int rb_w32_rename ( const char *  ,
const char *   
)

Definition at line 4761 of file win32.c.

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

int rb_w32_rmdir ( const char *  )

Definition at line 6797 of file win32.c.

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

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

Definition at line 2986 of file win32.c.

References rb_w32_select_with_thread().

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

Definition at line 3333 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 3340 of file win32.c.

References FALSE, and overlapped_socket_io().

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

Definition at line 3494 of file win32.c.

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

int WSAAPI rb_w32_shutdown ( int  ,
int   
)

Definition at line 3512 of file win32.c.

References errno, map_errno, r, 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   
)
rb_pid_t rb_w32_spawn ( int  ,
const char *  ,
const char *   
)

Definition at line 1339 of file win32.c.

References filecp(), and w32_spawn().

int rb_w32_stat ( const char *  ,
struct stat  
)

Definition at line 5027 of file win32.c.

References COPY_STAT, and rb_w32_stati64.

int rb_w32_stati64 ( const char *  ,
struct stati64 *   
)

Definition at line 5094 of file win32.c.

References filecp(), and w32_stati64().

char* rb_w32_strerror ( int  )

Definition at line 2430 of file win32.c.

References EADDRINUSE, err, errmap, EWOULDBLOCK, i, int, memmove(), NULL, p, s, strerror(), strlcpy(), strlen(), sys_nerr, and winerr.

int rb_w32_time_subtract ( struct timeval rest,
const struct timeval wait 
)

Definition at line 2810 of file win32.c.

References timeval::tv_sec, and timeval::tv_usec.

Referenced by rb_w32_select_with_thread().

int rb_w32_times ( struct tms )
int rb_w32_truncate ( const char *  path,
off_t  length 
)

Definition at line 5174 of file win32.c.

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

int rb_w32_uaccess ( const char *  ,
int   
)

Definition at line 5130 of file win32.c.

References errno, and rb_w32_ustati64().

rb_pid_t rb_w32_uaspawn ( int  ,
const char *  ,
char *const  
)

Definition at line 1446 of file win32.c.

References rb_w32_uaspawn_flags().

rb_pid_t rb_w32_uaspawn_flags ( int  ,
const char *  ,
char *const ,
DWORD   
)

Definition at line 1432 of file win32.c.

References w32_aspawn_flags().

Referenced by rb_w32_uaspawn().

int rb_w32_uchdir ( const char *  )

Definition at line 6714 of file win32.c.

References free, NULL, ret, and utf8_to_wstr.

int rb_w32_uchmod ( const char *  ,
int   
)

Definition at line 6874 of file win32.c.

References free, NULL, ret, and utf8_to_wstr.

int rb_w32_uchown ( const char *  ,
int  ,
int   
)

Definition at line 4438 of file win32.c.

char* rb_w32_ugetenv ( const char *  )

Definition at line 4666 of file win32.c.

References w32_getenv().

int rb_w32_ulink ( const char *  ,
const char *   
)

Definition at line 4581 of file win32.c.

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

int rb_w32_umkdir ( const char *  ,
int   
)

Definition at line 6748 of file win32.c.

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

int rb_w32_unlink ( const char *  )

Definition at line 6860 of file win32.c.

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

int rb_w32_unwrap_io_handle ( int  )

Definition at line 7173 of file win32.c.

References _set_osfhnd, constat_delete(), is_socket(), LK_LEN, NULL, socklist_delete(), and TO_SOCKET.

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

Definition at line 5534 of file win32.c.

References arg, free, NULL, rb_w32_wopen(), ret, utf8_to_wstr, and va_end().

int rb_w32_urename ( const char *  ,
const char *   
)

Definition at line 4742 of file win32.c.

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

int rb_w32_urmdir ( const char *  )

Definition at line 6811 of file win32.c.

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

rb_pid_t rb_w32_uspawn ( int  ,
const char *  ,
const char *   
)

Definition at line 1347 of file win32.c.

References w32_spawn().

Referenced by proc_exec_sh().

int rb_w32_ustati64 ( const char *  ,
struct stati64 *   
)

Definition at line 5087 of file win32.c.

References w32_stati64().

Referenced by rb_w32_uaccess().

int rb_w32_utime ( const char *  ,
const struct utimbuf  
)

Definition at line 6700 of file win32.c.

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

int rb_w32_uunlink ( const char *  )

Definition at line 6846 of file win32.c.

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

int rb_w32_uutime ( const char *  ,
const struct utimbuf  
)

Definition at line 6686 of file win32.c.

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

int rb_w32_wait_events_blocking ( HANDLE *  events,
int  num,
DWORD  timeout 
)
int rb_w32_wopen ( const WCHAR *  ,
int  ,
  ... 
)
int rb_w32_wrap_io_handle ( HANDLE  ,
int   
)

Definition at line 7151 of file win32.c.

References errno, len, O_NONBLOCK, r, rb_w32_open_osfhandle(), socklist_insert(), and tmp.

ssize_t rb_w32_write ( int  ,
const void ,
size_t   
)
long rb_w32_write_console ( uintptr_t  ,
int   
)
char* rb_w32_wstr_to_mbstr ( UINT  ,
const WCHAR *  ,
int  ,
long *   
)

Definition at line 1960 of file win32.c.

References len, malloc(), NULL, and ptr.

Referenced by init_env().

int recvmsg ( int  ,
struct msghdr ,
int   
)
static double scalb ( double  a,
long  b 
)
inlinestatic

Definition at line 387 of file win32.h.

int sendmsg ( int  ,
const struct msghdr ,
int   
)
int setgid ( rb_gid_t  )

Definition at line 2533 of file win32.c.

References ROOT_GID.

Referenced by p_gid_change_privilege(), rb_execarg_run_options(), and rb_setegid_core().

int setuid ( rb_uid_t  )

Definition at line 2526 of file win32.c.

References ROOT_UID.

Referenced by p_uid_change_privilege(), rb_execarg_run_options(), and rb_seteuid_core().

int socketpair ( int  ,
int  ,
int  ,
int  
)
rb_pid_t waitpid ( rb_pid_t  ,
int ,
int   
)