Ruby 2.7.0p0(2019-12-25revision647ee6f091eafcce70ffb75ddf7e121e192ab217)

Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
win32.c File Reference
`#include "ruby/ruby.h"`
`#include "ruby/encoding.h"`
`#include "ruby/io.h"`
`#include "ruby/util.h"`
`#include <fcntl.h>`
`#include <process.h>`
`#include <sys/stat.h>`
`#include <stdio.h>`
`#include <stdlib.h>`
`#include <errno.h>`
`#include <assert.h>`
`#include <ctype.h>`
`#include <windows.h>`
`#include <winbase.h>`
`#include <wincon.h>`
`#include <share.h>`
`#include <shlobj.h>`
`#include <mbstring.h>`
`#include <shlwapi.h>`
`#include "ruby/win32.h"`
`#include "ruby/vm.h"`
`#include "win32/dir.h"`
`#include "win32/file.h"`
`#include "id.h"`
`#include "internal.h"`
`#include "encindex.h"`
`#include "dln.h"`
`#include "dln_find.c"`
`#include <sys/timeb.h>`
`#include "missing/nextafter.c"`

Go to the source code of this file.

## Data Structures
struct | constat
struct | ChildRecord
struct | _NtCmdLineElement
struct | ioinfo
struct | WSAMSG
struct | NET_LUID
struct | FILE_ID_128
struct | FILE_ID_INFO
struct | asynchronous_arg_t
struct | w32_io_info_t
struct | w32_io_info_args

## Macros
#define | isdirsep(x) ((x) == '/' || (x) == '\\')
#define | DLN_FIND_EXTRA_ARG_DECL ,UINT cp
#define | DLN_FIND_EXTRA_ARG ,cp
#define | rb_w32_stati128(path, st) w32_stati128(path, st, cp, FALSE)
#define | getenv(name) w32_getenv(name, cp)
#define | CharNext(p) CharNextExA(cp, (p), 0)
#define | dln_find_exe_r rb_w32_udln_find_exe_r
#define | dln_find_file_r rb_w32_udln_find_file_r
#define | dln_find_exe_r(fname, path, buf, size) rb_w32_udln_find_exe_r(fname, path, buf, size, cp)
#define | dln_find_file_r(fname, path, buf, size) rb_w32_udln_find_file_r(fname, path, buf, size, cp)
#define | ENV_MAX 512
#define | enough_to_get(n) (--(n) >= 0)
#define | enough_to_put(n) (--(n) >= 0)
#define | Debug(something) /* nothing */
#define | TO_SOCKET(x) _get_osfhandle(x)
#define | RUBY_CRITICAL if (0) {} else /* just remark */
#define | ERROR_PIPE_LOCAL 229L
#define | map_errno rb_w32_map_errno
#define | LK_ERR(f, i)
#define | LK_LEN ULONG_MAX
#define | CSIDL_LOCAL_APPDATA 28
#define | CSIDL_COMMON_APPDATA 35
#define | CSIDL_WINDOWS 36
#define | CSIDL_SYSTEM 37
#define | CSIDL_PROFILE 40
#define | env wk.val
#define | set_env_val(vname)
#define | conlist_disabled ((st_table *)-1)
#define | MAKE_SOCKDATA(af, fl) ((int)((((int)af)<<4)|((fl)&0xFFFF)))
#define | GET_FAMILY(v) ((int)(((v)>>4)&0xFFFF))
#define | GET_FLAGS(v) ((int)((v)&0xFFFF))
#define | MAXCHILDNUM 256 /* max num of child processes */
#define | FOREACH_CHILD(v)
#define | END_FOREACH_CHILD } while (0)
#define | InternalCmdsMax 8
#define | STRNDUPV(ptr, v, src, len) (((char *)memcpy(((ptr) = ALLOCV((v), (len) + 1)), (src), (len)))[len] = 0)
#define | filecp rb_w32_filecp
#define | mbstr_to_wstr rb_w32_mbstr_to_wstr
#define | wstr_to_mbstr rb_w32_wstr_to_mbstr
#define | acp_to_wstr(str, plen) mbstr_to_wstr(CP_ACP, str, -1, plen)
#define | wstr_to_acp(str, plen) wstr_to_mbstr(CP_ACP, str, -1, plen)
#define | filecp_to_wstr(str, plen) mbstr_to_wstr(filecp(), str, -1, plen)
#define | wstr_to_filecp(str, plen) wstr_to_mbstr(filecp(), str, -1, plen)
#define | utf8_to_wstr(str, plen) mbstr_to_wstr(CP_UTF8, str, -1, plen)
#define | wstr_to_utf8(str, plen) wstr_to_mbstr(CP_UTF8, str, -1, plen)
#define | NTGLOB 0x1
#define | NTMALLOC 0x2
#define | NTSTRING 0x4
#define | GetBit(bits, i) ((bits)[(i) / CHAR_BIT] & (1 << (i) % CHAR_BIT))
#define | SetBit(bits, i) ((bits)[(i) / CHAR_BIT] |= (1 << (i) % CHAR_BIT))
#define | BitOfIsDir(n) ((n) * 2)
#define | BitOfIsRep(n) ((n) * 2 + 1)
#define | DIRENT_PER_CHAR (CHAR_BIT / 2)
#define | FILE_COUNT(stream) stream->_cnt
#define | FILE_READPTR(stream) stream->_ptr
#define | FILE_FILENO(stream) stream->_file
#define | _CRTIMP __declspec(dllimport)
#define | IOINFO_L2E 5
#define | IOINFO_ARRAY_ELTS (1 << IOINFO_L2E)
#define | _osfhnd(i) (_pioinfo(i)->osfhnd)
#define | _osfile(i) (_pioinfo(i)->osfile)
#define | rb_acrt_lowio_lock_fh(i) EnterCriticalSection(&_pioinfo(i)->lock)
#define | rb_acrt_lowio_unlock_fh(i) LeaveCriticalSection(&_pioinfo(i)->lock)
#define | pioinfo_extra 0
#define | _set_osfhnd(fh, osfh) (void)(_osfhnd(fh) = osfh)
#define | _set_osflags(fh, flags) (_osfile(fh) = (flags))
#define | FOPEN 0x01 /* file handle open */
#define | FEOFLAG 0x02 /* end of file has been encountered */
#define | FPIPE 0x08 /* file handle refers to a pipe */
#define | FNOINHERIT 0x10 /* file handle opened O_NOINHERIT */
#define | FAPPEND 0x20 /* file handle opened O_APPEND */
#define | FDEV 0x40 /* file handle refers to device */
#define | FTEXT 0x80 /* file handle is in text mode */
#define | open_null(fd)
#define | ROOT_UID 0
#define | ROOT_GID 0
#define | WSAID_WSARECVMSG {0xf689d7c8,0x6f1f,0x436b,{0x8a,0x53,0xe5,0x4f,0xe3,0x51,0xc3,0x22}}
#define | WSAID_WSASENDMSG {0xa441e712,0x754f,0x43ca,{0x84,0xa7,0x0d,0xee,0x44,0xcf,0x60,0x6d}}
#define | msghdr_to_wsamsg(msg, wsamsg)
#define | hex2byte(str) ((isdigit(*(str)) ? *(str) - '0' : toupper(*(str)) - 'A' + 10) << 4 | (isdigit(*((str) + 1)) ? *((str) + 1) - '0' : toupper(*((str) + 1)) - 'A' + 10))
#define | FILE_DEVICE_FILE_SYSTEM 0x00000009
#define | FSCTL_GET_REPARSE_POINT ((0x9<<16)|(42<<2))
#define | IO_REPARSE_TAG_SYMLINK 0xA000000CL
#define | SYMBOLIC_LINK_FLAG_DIRECTORY (0x1)
#define | SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE (0x2)
#define | COPY_STAT(src, dest, size_cast)
#define | FileIdInfo 0x12
#define | yield_once() Sleep(0)
#define | yield_until(condition) do yield_once(); while (!(condition))
#define | set_new_std_handle(newfd, handle)
#define | set_new_std_fd(newfd) set_new_std_handle(newfd, (HANDLE)rb_w32_get_osfhandle(newfd))
#define | FOREGROUND_MASK (FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_INTENSITY)
#define | BACKGROUND_MASK (BACKGROUND_BLUE | BACKGROUND_GREEN | BACKGROUND_RED | BACKGROUND_INTENSITY)
#define | constat_attr_color_reverse(attr)
#define | COMMON_LVB_UNDERSCORE 0x8000
#define | INVALID_SET_FILE_POINTER ((DWORD)-1)

## Typedefs
typedef struct _NtCmdLineElement | NtCmdLineElement
typedef DWORD(WINAPI * | get_final_path_func) (HANDLE, WCHAR *, DWORD, DWORD)
typedef DWORD(WINAPI * | cigl_t) (const GUID *, NET_LUID *)
typedef DWORD(WINAPI * | cilnA_t) (const NET_LUID *, char *, size_t)

## Enumerations
enum | { constat_init = -2, constat_esc = -1, constat_seq = 0 }

## Functions
int | rb_w32_reparse_symlink_p (const WCHAR *path)
int | rb_w32_wait_events (HANDLE *events, int num, DWORD timeout)
VALUE | rb_w32_conv_from_wchar (const WCHAR *wstr, rb_encoding *enc)
int | ruby_brace_glob_with_enc (const char *str, int flags, ruby_glob_func *func, VALUE arg, rb_encoding *enc)
int | rb_w32_map_errno (DWORD winerr)
DWORD | rb_w32_osver (void)
int | flock (int fd, int oper)
VALUE | rb_w32_special_folder (int type)
UINT | rb_w32_system_tmpdir (WCHAR *path, UINT len)
WCHAR * | rb_w32_home_dir (void)
void | rb_w32_sysinit (int *argc, char ***argv)
char * | getlogin (void)
SOCKET | rb_w32_get_osfhandle (int fh)
MJIT_FUNC_EXPORTED HANDLE | rb_w32_start_process (const char *abspath, char *const *argv, int out_fd)
rb_pid_t | rb_w32_spawn (int mode, const char *cmd, const char *prog)
rb_pid_t | rb_w32_uspawn (int mode, const char *cmd, const char *prog)
rb_pid_t | rb_w32_aspawn_flags (int mode, const char *prog, char *const *argv, DWORD flags)
rb_pid_t | rb_w32_uaspawn_flags (int mode, const char *prog, char *const *argv, DWORD flags)
rb_pid_t | rb_w32_aspawn (int mode, const char *prog, char *const *argv)
rb_pid_t | rb_w32_uaspawn (int mode, const char *prog, char *const *argv)
char * | rb_w32_wstr_to_mbstr (UINT cp, const WCHAR *wstr, int clen, long *plen)
WCHAR * | rb_w32_mbstr_to_wstr (UINT cp, const char *str, int clen, long *plen)
DIR * | rb_w32_opendir (const char *filename)
DIR * | rb_w32_uopendir (const char *filename)
char * | rb_w32_conv_from_wstr (const WCHAR *wstr, long *lenp, rb_encoding *enc)
struct direct * | rb_w32_readdir (DIR *dirp, rb_encoding *enc)
long | rb_w32_telldir (DIR *dirp)
void | rb_w32_seekdir (DIR *dirp, long loc)
void | rb_w32_rewinddir (DIR *dirp)
void | rb_w32_closedir (DIR *dirp)
int | rb_w32_io_cancelable_p (int fd)
int | rb_w32_is_socket (int fd)
char * | rb_w32_strerror (int e)
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 uid)
int | setgid (rb_gid_t gid)
int | ioctl (int i, int u,...)
void | rb_w32_fdset (int fd, fd_set *set)
void | rb_w32_fdclr (int fd, fd_set *set)
int | rb_w32_fdisset (int fd, fd_set *set)
void | rb_w32_fd_copy (rb_fdset_t *dst, const fd_set *src, int max)
void | rb_w32_fd_dup (rb_fdset_t *dst, const rb_fdset_t *src)
int | rb_w32_time_subtract (struct timeval *rest, const struct timeval *wait)
int | rb_w32_check_interrupt (void *)
int | rb_w32_select_with_thread (int nfds, fd_set *rd, fd_set *wr, fd_set *ex, struct timeval *timeout, void *th)
int WSAAPI | rb_w32_select (int nfds, fd_set *rd, fd_set *wr, fd_set *ex, struct timeval *timeout)
int WSAAPI | rb_w32_accept (int s, struct sockaddr *addr, int *addrlen)
int WSAAPI | rb_w32_bind (int s, const struct sockaddr *addr, int addrlen)
int WSAAPI | rb_w32_connect (int s, const struct sockaddr *addr, int addrlen)
int WSAAPI | rb_w32_getpeername (int s, struct sockaddr *addr, int *addrlen)
int WSAAPI | rb_w32_getsockname (int fd, struct sockaddr *addr, int *addrlen)
int WSAAPI | rb_w32_getsockopt (int s, int level, int optname, char *optval, int *optlen)
int WSAAPI | rb_w32_ioctlsocket (int s, long cmd, u_long *argp)
int WSAAPI | rb_w32_listen (int s, int backlog)
int WSAAPI | rb_w32_recv (int fd, char *buf, int len, int flags)
int WSAAPI | rb_w32_recvfrom (int fd, char *buf, int len, int flags, struct sockaddr *from, int *fromlen)
int WSAAPI | rb_w32_send (int fd, const char *buf, int len, int flags)
int WSAAPI | rb_w32_sendto (int fd, const char *buf, int len, int flags, const struct sockaddr *to, int tolen)
int | recvmsg (int fd, struct msghdr *msg, int flags)
int | sendmsg (int fd, const struct msghdr *msg, int flags)
int WSAAPI | rb_w32_setsockopt (int s, int level, int optname, const char *optval, int optlen)
int WSAAPI | rb_w32_shutdown (int s, int how)
int WSAAPI | rb_w32_socket (int af, int type, int protocol)
struct hostent *WSAAPI | rb_w32_gethostbyaddr (const char *addr, int len, int type)
struct hostent *WSAAPI | rb_w32_gethostbyname (const char *name)
int WSAAPI | rb_w32_gethostname (char *name, int len)
struct protoent *WSAAPI | rb_w32_getprotobyname (const char *name)
struct protoent *WSAAPI | rb_w32_getprotobynumber (int num)
struct servent *WSAAPI | rb_w32_getservbyname (const char *name, const char *proto)
struct servent *WSAAPI | rb_w32_getservbyport (int port, const char *proto)
int | socketpair (int af, int type, int protocol, int *sv)
int | getifaddrs (struct ifaddrs **ifap)
void | freeifaddrs (struct ifaddrs *ifp)
void | endhostent (void)
void | endnetent (void)
void | endprotoent (void)
void | endservent (void)
struct netent * | getnetent (void)
struct netent * | getnetbyaddr (long net, int type)
struct netent * | getnetbyname (const char *name)
struct protoent * | getprotoent (void)
struct servent * | getservent (void)
void | sethostent (int stayopen)
void | setnetent (int stayopen)
void | setprotoent (int stayopen)
void | setservent (int stayopen)
int | fcntl (int fd, int cmd,...)
int | rb_w32_set_nonblock2 (int fd, int nonblock)
int | rb_w32_set_nonblock (int fd)
rb_pid_t | waitpid (rb_pid_t pid, int *stat_loc, int options)
int __cdecl | gettimeofday (struct timeval *tv, struct timezone *tz)
int | clock_gettime (clockid_t clock_id, struct timespec *sp)
int | clock_getres (clockid_t clock_id, struct timespec *sp)
char * | rb_w32_getcwd (char *buffer, int size)
char * | rb_w32_ugetcwd (char *buffer, int size)
VALUE | rb_dir_getwd_ospath (void)
int | chown (const char *path, int owner, int group)
int | rb_w32_uchown (const char *path, int owner, int group)
int | lchown (const char *path, int owner, int group)
int | rb_w32_ulchown (const char *path, int owner, int group)
int | kill (int pid, int sig)
int | rb_w32_ulink (const char *from, const char *to)
int | link (const char *from, const char *to)
int | rb_w32_read_reparse_point (const WCHAR *path, rb_w32_reparse_buffer_t *rp, size_t bufsize, WCHAR **result, DWORD *len)
ssize_t | rb_w32_ureadlink (const char *path, char *buf, size_t bufsize)
ssize_t | readlink (const char *path, char *buf, size_t bufsize)
int | rb_w32_usymlink (const char *src, const char *link)
int | symlink (const char *src, const char *link)
int | wait (int *status)
char * | rb_w32_ugetenv (const char *name)
char * | rb_w32_getenv (const char *name)
int | rb_w32_urename (const char *from, const char *to)
int | rb_w32_rename (const char *from, const char *to)
int | rb_w32_fstat (int fd, struct stat *st)
int | rb_w32_fstati128 (int fd, struct stati128 *st)
int | rb_w32_stat (const char *path, struct stat *st)
int | rb_w32_ustati128 (const char *path, struct stati128 *st)
int | rb_w32_stati128 (const char *path, struct stati128 *st)
int | rb_w32_ulstati128 (const char *path, struct stati128 *st)
int | rb_w32_lstati128 (const char *path, struct stati128 *st)
off_t | rb_w32_lseek (int fd, off_t ofs, int whence)
int | rb_w32_access (const char *path, int mode)
int | rb_w32_uaccess (const char *path, int mode)
int | rb_w32_utruncate (const char *path, off_t length)
int | rb_w32_truncate (const char *path, off_t length)
int | rb_w32_ftruncate (int fd, off_t length)
int | rb_w32_times (struct tms *tmbuf)
uintptr_t | rb_w32_asynchronize (asynchronous_func_t func, uintptr_t self, int argc, uintptr_t *argv, uintptr_t intrval)
char ** | rb_w32_get_environ (void)
void | rb_w32_free_environ (char **env)
rb_pid_t | rb_w32_getpid (void)
rb_pid_t | rb_w32_getppid (void)
| STATIC_ASSERT (std_handle,(STD_OUTPUT_HANDLE-STD_INPUT_HANDLE)==(STD_ERROR_HANDLE-STD_OUTPUT_HANDLE))
int | rb_w32_dup2 (int oldfd, int newfd)
int | rb_w32_uopen (const char *file, int oflag,...)
int | rb_w32_open (const char *file, int oflag,...)
int | rb_w32_wopen (const WCHAR *file, int oflag,...)
int | rb_w32_fclose (FILE *fp)
int | rb_w32_pipe (int fds[2])
int | rb_w32_close (int fd)
ssize_t | rb_w32_read (int fd, void *buf, size_t size)
ssize_t | rb_w32_write (int fd, const void *buf, size_t size)
long | rb_w32_write_console (uintptr_t strarg, int fd)
int | rb_w32_uutime (const char *path, const struct utimbuf *times)
int | rb_w32_utime (const char *path, const struct utimbuf *times)
int | rb_w32_uutimes (const char *path, const struct timeval *times)
int | rb_w32_utimes (const char *path, const struct timeval *times)
int | rb_w32_uutimensat (int dirfd, const char *path, const struct timespec *times, int flags)
int | rb_w32_utimensat (int dirfd, const char *path, const struct timespec *times, int flags)
int | rb_w32_uchdir (const char *path)
int | rb_w32_umkdir (const char *path, int mode)
int | rb_w32_mkdir (const char *path, int mode)
int | rb_w32_rmdir (const char *path)
int | rb_w32_urmdir (const char *path)
int | rb_w32_uunlink (const char *path)
int | rb_w32_unlink (const char *path)
int | rb_w32_uchmod (const char *path, int mode)
int | fchmod (int fd, int mode)
int | rb_w32_isatty (int fd)
int | signbit (double x)
const char *WSAAPI | rb_w32_inet_ntop (int af, const void *addr, char *numaddr, size_t numaddr_len)
int WSAAPI | rb_w32_inet_pton (int af, const char *src, void *dst)
char | rb_w32_fd_is_text (int fd)
struct tm * | gmtime_r (const time_t *tp, struct tm *rp)
struct tm * | localtime_r (const time_t *tp, struct tm *rp)
int | rb_w32_wrap_io_handle (HANDLE h, int flags)
int | rb_w32_unwrap_io_handle (int fd)
VALUE | rb_w32_file_identical_p (VALUE fname1, VALUE fname2)
int | rb_w32_set_thread_description (HANDLE th, const WCHAR *name)
int | rb_w32_set_thread_description_str (HANDLE th, VALUE name)

## Variables
EXTERN_C _CRTIMP ioinfo * | __pioinfo []
VALUE(*const | rb_f_notimplement_ )(int, const VALUE *, VALUE, VALUE) = rb_f_notimplement

## Macro Definition Documentation

## ◆ _CRTIMP

#define _CRTIMP __declspec(dllimport)

Definition at line 2471 of file win32.c.

## ◆ _osfhnd

#define _osfhnd | ( |  | i | ) | (_pioinfo(i)->osfhnd)

Definition at line 2485 of file win32.c.

## ◆ _osfile

#define _osfile | ( |  | i | ) | (_pioinfo(i)->osfile)

Definition at line 2486 of file win32.c.

## ◆ _set_osfhnd

#define _set_osfhnd | ( |  | fh,
|  |  | osfh
| ) |  | (void)(_osfhnd(fh) = osfh)

Definition at line 2586 of file win32.c.

## ◆ _set_osflags

#define _set_osflags | ( |  | fh,
|  |  | flags
| ) |  | (_osfile(fh) = (flags))

Definition at line 2587 of file win32.c.

## ◆ acp_to_wstr

#define acp_to_wstr | ( |  | str,
|  |  | plen
| ) |  | mbstr_to_wstr(CP_ACP, str, -1, plen)

Definition at line 1284 of file win32.c.

## ◆ BACKGROUND_MASK

#define BACKGROUND_MASK (BACKGROUND_BLUE | BACKGROUND_GREEN | BACKGROUND_RED | BACKGROUND_INTENSITY)

Definition at line 6575 of file win32.c.

## ◆ BitOfIsDir

#define BitOfIsDir | ( |  | n | ) | ((n) * 2)

Definition at line 1981 of file win32.c.

## ◆ BitOfIsRep

#define BitOfIsRep | ( |  | n | ) | ((n) * 2 + 1)

Definition at line 1982 of file win32.c.

## ◆ CharNext

#define CharNext | ( |  | p | ) | CharNextExA(cp, (p), 0)

Definition at line 75 of file win32.c.

## ◆ COMMON_LVB_UNDERSCORE

#define COMMON_LVB_UNDERSCORE 0x8000

## ◆ conlist_disabled

#define conlist_disabled ((st_table *)-1)

Definition at line 694 of file win32.c.

## ◆ constat_attr_color_reverse

#define constat_attr_color_reverse | ( |  | attr | ) |

Value:
((attr) & ~(FOREGROUND_MASK | BACKGROUND_MASK)) | \
(((attr) & FOREGROUND_MASK) << 4) | \
(((attr) & BACKGROUND_MASK) >> 4)

Definition at line 6577 of file win32.c.

## ◆ COPY_STAT

#define COPY_STAT | ( |  | src,
|  |  | dest,
|  |  | size_cast
| ) |  |

Value:
do { \
(dest).st_dev = (src).st_dev; \
(dest).st_ino = (src).st_ino; \
(dest).st_mode = (src).st_mode; \
(dest).st_nlink = (src).st_nlink; \
(dest).st_uid = (src).st_uid; \
(dest).st_gid = (src).st_gid; \
(dest).st_rdev = (src).st_rdev; \
(dest).st_size = size_cast(src).st_size; \
(dest).st_atime = (src).st_atime; \
(dest).st_mtime = (src).st_mtime; \
(dest).st_ctime = (src).st_ctime; \
} while (0)

Definition at line 5376 of file win32.c.

## ◆ CSIDL_COMMON_APPDATA

#define CSIDL_COMMON_APPDATA 35

Definition at line 420 of file win32.c.

## ◆ CSIDL_LOCAL_APPDATA

#define CSIDL_LOCAL_APPDATA 28

Definition at line 417 of file win32.c.

## ◆ CSIDL_PROFILE

#define CSIDL_PROFILE 40

Definition at line 429 of file win32.c.

## ◆ CSIDL_SYSTEM

#define CSIDL_SYSTEM 37

Definition at line 426 of file win32.c.

## ◆ CSIDL_WINDOWS

#define CSIDL_WINDOWS 36

Definition at line 423 of file win32.c.

## ◆ Debug

#define Debug | ( |  | something | ) | /* nothing */

Definition at line 115 of file win32.c.

## ◆ DIRENT_PER_CHAR

#define DIRENT_PER_CHAR (CHAR_BIT / 2)

Definition at line 1983 of file win32.c.

## ◆ dln_find_exe_r [1/2]

#define dln_find_exe_r | ( |  | fname,
|  |  | path,
|  |  | buf,
|  |  | size
| ) |  | rb_w32_udln_find_exe_r(fname, path, buf, size, cp)

Definition at line 84 of file win32.c.

## ◆ dln_find_exe_r [2/2]

#define dln_find_exe_r rb_w32_udln_find_exe_r

Definition at line 84 of file win32.c.

## ◆ DLN_FIND_EXTRA_ARG

#define DLN_FIND_EXTRA_ARG ,cp

Definition at line 71 of file win32.c.

## ◆ DLN_FIND_EXTRA_ARG_DECL

#define DLN_FIND_EXTRA_ARG_DECL ,UINT cp

Definition at line 70 of file win32.c.

## ◆ dln_find_file_r [1/2]

#define dln_find_file_r | ( |  | fname,
|  |  | path,
|  |  | buf,
|  |  | size
| ) |  | rb_w32_udln_find_file_r(fname, path, buf, size, cp)

Definition at line 85 of file win32.c.

## ◆ dln_find_file_r [2/2]

#define dln_find_file_r rb_w32_udln_find_file_r

Definition at line 85 of file win32.c.

## ◆ END_FOREACH_CHILD

#define END_FOREACH_CHILD } while (0)

Definition at line 898 of file win32.c.

## ◆ enough_to_get

#define enough_to_get | ( |  | n | ) | (--(n) >= 0)

Definition at line 109 of file win32.c.

## ◆ enough_to_put

#define enough_to_put | ( |  | n | ) | (--(n) >= 0)

Definition at line 110 of file win32.c.

## ◆ env

#define env wk.val

## ◆ ENV_MAX

#define ENV_MAX 512

Definition at line 96 of file win32.c.

## ◆ ERROR_PIPE_LOCAL

#define ERROR_PIPE_LOCAL 229L

## ◆ FAPPEND

#define FAPPEND 0x20 /* file handle opened O_APPEND */

Definition at line 2593 of file win32.c.

## ◆ FDEV

#define FDEV 0x40 /* file handle refers to device */

Definition at line 2594 of file win32.c.

## ◆ FEOFLAG

#define FEOFLAG 0x02 /* end of file has been encountered */

Definition at line 2590 of file win32.c.

## ◆ FILE_COUNT

#define FILE_COUNT | ( |  | stream | ) | stream->_cnt

Definition at line 2432 of file win32.c.

## ◆ FILE_DEVICE_FILE_SYSTEM

#define FILE_DEVICE_FILE_SYSTEM 0x00000009

Definition at line 4951 of file win32.c.

## ◆ FILE_FILENO

#define FILE_FILENO | ( |  | stream | ) | stream->_file

Definition at line 2434 of file win32.c.

## ◆ FILE_READPTR

#define FILE_READPTR | ( |  | stream | ) | stream->_ptr

Definition at line 2433 of file win32.c.

## ◆ filecp

UINT filecp rb_w32_filecp

Definition at line 1281 of file win32.c.

Referenced by rb_w32_readdir().

## ◆ filecp_to_wstr

#define filecp_to_wstr | ( |  | str,
|  |  | plen
| ) |  | mbstr_to_wstr(filecp(), str, -1, plen)

Definition at line 1286 of file win32.c.

## ◆ FileIdInfo

#define FileIdInfo 0x12

Definition at line 5433 of file win32.c.

## ◆ FNOINHERIT

#define FNOINHERIT 0x10 /* file handle opened O_NOINHERIT */

Definition at line 2592 of file win32.c.

## ◆ FOPEN

#define FOPEN 0x01 /* file handle open */

Definition at line 2589 of file win32.c.

## ◆ FOREACH_CHILD

#define FOREACH_CHILD | ( |  | v | ) |

Value:
do { \
struct ChildRecord* v; \
for (v = ChildRecord; v < ChildRecord + sizeof(ChildRecord) / sizeof(ChildRecord[0]); ++v)

Definition at line 895 of file win32.c.

## ◆ FOREGROUND_MASK

#define FOREGROUND_MASK (FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_INTENSITY)

Definition at line 6574 of file win32.c.

## ◆ FPIPE

#define FPIPE 0x08 /* file handle refers to a pipe */

Definition at line 2591 of file win32.c.

## ◆ FSCTL_GET_REPARSE_POINT

#define FSCTL_GET_REPARSE_POINT ((0x9<<16)|(42<<2))

Definition at line 4954 of file win32.c.

## ◆ FTEXT

#define FTEXT 0x80 /* file handle is in text mode */

Definition at line 2595 of file win32.c.

## ◆ GET_FAMILY

#define GET_FAMILY | ( |  | v | ) | ((int)(((v)>>4)&0xFFFF))

Definition at line 788 of file win32.c.

## ◆ GET_FLAGS

#define GET_FLAGS | ( |  | v | ) | ((int)((v)&0xFFFF))

Definition at line 789 of file win32.c.

## ◆ GetBit

#define GetBit | ( |  | bits,
|  |  | i
| ) |  | ((bits)[(i) / CHAR_BIT] & (1 << (i) % CHAR_BIT))

Definition at line 1978 of file win32.c.

## ◆ getenv

#define getenv | ( |  | name | ) | w32_getenv(name, cp)

Definition at line 73 of file win32.c.

## ◆ hex2byte

#define hex2byte | ( |  | str | ) | ((isdigit(*(str)) ? *(str) - '0' : toupper(*(str)) - 'A' + 10) << 4 | (isdigit(*((str) + 1)) ? *((str) + 1) - '0' : toupper(*((str) + 1)) - 'A' + 10))

## ◆ InternalCmdsMax

#define InternalCmdsMax 8

Definition at line 957 of file win32.c.

## ◆ INVALID_SET_FILE_POINTER

#define INVALID_SET_FILE_POINTER ((DWORD)-1)

## ◆ IO_REPARSE_TAG_SYMLINK

#define IO_REPARSE_TAG_SYMLINK 0xA000000CL

Definition at line 4957 of file win32.c.

## ◆ IOINFO_ARRAY_ELTS

#define IOINFO_ARRAY_ELTS (1 << IOINFO_L2E)

Definition at line 2484 of file win32.c.

## ◆ IOINFO_L2E

#define IOINFO_L2E 5

Definition at line 2479 of file win32.c.

## ◆ isdirsep

#define isdirsep | ( |  | x | ) | ((x) == '/' || (x) == '\\')

Definition at line 59 of file win32.c.

## ◆ LK_ERR

#define LK_ERR | ( |  | f,
|  |  | i
| ) |  |

Value:
do { \
if (f) \
i = 0; \
else { \
DWORD err = GetLastError(); \
if (err == ERROR_LOCK_VIOLATION || err == ERROR_IO_PENDING) \
errno = EWOULDBLOCK; \
else if (err == ERROR_NOT_LOCKED) \
i = 0; \
else \
errno = map_errno(err); \
} \
} while (0)

Definition at line 327 of file win32.c.

## ◆ LK_LEN

#define LK_LEN ULONG_MAX

Definition at line 341 of file win32.c.

## ◆ MAKE_SOCKDATA

#define MAKE_SOCKDATA | ( |  | af,
|  |  | fl
| ) |  | ((int)((((int)af)<<4)|((fl)&0xFFFF)))

Definition at line 787 of file win32.c.

## ◆ map_errno

#define map_errno rb_w32_map_errno

Definition at line 293 of file win32.c.

## ◆ MAXCHILDNUM

#define MAXCHILDNUM 256 /* max num of child processes */

Definition at line 886 of file win32.c.

## ◆ mbstr_to_wstr

#define mbstr_to_wstr rb_w32_mbstr_to_wstr

Definition at line 1282 of file win32.c.

## ◆ msghdr_to_wsamsg

#define msghdr_to_wsamsg | ( |  | msg,
|  |  | wsamsg
| ) |  |

Value:
do { \
int i; \
(wsamsg)->name = (msg)->msg_name; \
(wsamsg)->namelen = (msg)->msg_namelen; \
(wsamsg)->lpBuffers = ALLOCA_N(WSABUF, (msg)->msg_iovlen); \
(wsamsg)->dwBufferCount = (msg)->msg_iovlen; \
for (i = 0; i < (msg)->msg_iovlen; ++i) { \
(wsamsg)->lpBuffers[i].buf = (msg)->msg_iov[i].iov_base; \
(wsamsg)->lpBuffers[i].len = (msg)->msg_iov[i].iov_len; \
} \
(wsamsg)->Control.buf = (msg)->msg_control; \
(wsamsg)->Control.len = (msg)->msg_controllen; \
(wsamsg)->dwFlags = (msg)->msg_flags; \
} while (0)

Definition at line 3603 of file win32.c.

## ◆ NTGLOB

#define NTGLOB 0x1

Definition at line 1587 of file win32.c.

## ◆ NTMALLOC

#define NTMALLOC 0x2

Definition at line 1588 of file win32.c.

## ◆ NTSTRING

#define NTSTRING 0x4

Definition at line 1589 of file win32.c.

## ◆ open_null

#define open_null | ( |  | fd | ) |

Value:
(((nullfd < 0) ? \
(nullfd = open("NUL", O_RDWR)) : 0), \
((nullfd == (fd)) ? (keep = 1) : dup2(nullfd, fd)), \
(fd))

## ◆ pioinfo_extra

#define pioinfo_extra 0

Definition at line 2575 of file win32.c.

## ◆ rb_acrt_lowio_lock_fh

#define rb_acrt_lowio_lock_fh | ( |  | i | ) | EnterCriticalSection(&_pioinfo(i)->lock)

Definition at line 2487 of file win32.c.

## ◆ rb_acrt_lowio_unlock_fh

#define rb_acrt_lowio_unlock_fh | ( |  | i | ) | LeaveCriticalSection(&_pioinfo(i)->lock)

Definition at line 2488 of file win32.c.

## ◆ rb_w32_stati128

#define rb_w32_stati128 | ( |  | path,
|  |  | st
| ) |  | w32_stati128(path, st, cp, FALSE)

Definition at line 72 of file win32.c.

## ◆ ROOT_GID

#define ROOT_GID 0

Definition at line 2761 of file win32.c.

## ◆ ROOT_UID

#define ROOT_UID 0

Definition at line 2760 of file win32.c.

## ◆ RUBY_CRITICAL

#define RUBY_CRITICAL if (0) {} else /* just remark */

Definition at line 130 of file win32.c.

## ◆ set_env_val

#define set_env_val | ( |  | vname | ) |

Value:
do { \
typedef char wk_name_offset[(numberof(wk.name) - (numberof(vname) - 1)) * 2 + 1]; \
WCHAR *const buf = wk.name + sizeof(wk_name_offset) / 2; \
MEMCPY(buf, vname, WCHAR, numberof(vname) - 1); \
_wputenv(buf); \
} while (0)

## ◆ set_new_std_fd

#define set_new_std_fd | ( |  | newfd | ) | set_new_std_handle(newfd, (HANDLE)rb_w32_get_osfhandle(newfd))

Definition at line 6130 of file win32.c.

## ◆ set_new_std_handle

#define set_new_std_handle | ( |  | newfd,
|  |  | handle
| ) |  |

Value:
do { \
if ((unsigned)(newfd) > 2) break; \
SetStdHandle(STD_INPUT_HANDLE+(STD_OUTPUT_HANDLE-STD_INPUT_HANDLE)*(newfd), \
(handle)); \
} while (0)

Definition at line 6125 of file win32.c.

## ◆ SetBit

#define SetBit | ( |  | bits,
|  |  | i
| ) |  | ((bits)[(i) / CHAR_BIT] |= (1 << (i) % CHAR_BIT))

Definition at line 1979 of file win32.c.

## ◆ STRNDUPV

#define STRNDUPV | ( |  | ptr,
|  |  | v,
|  |  | src,
|  |  | len
| ) |  | (((char *)memcpy(((ptr) = ALLOCV((v), (len) + 1)), (src), (len)))[len] = 0)

Definition at line 1158 of file win32.c.

## ◆ SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE

#define SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE (0x2)

Definition at line 5108 of file win32.c.

## ◆ SYMBOLIC_LINK_FLAG_DIRECTORY

#define SYMBOLIC_LINK_FLAG_DIRECTORY (0x1)

Definition at line 5105 of file win32.c.

## ◆ TO_SOCKET

#define TO_SOCKET | ( |  | x | ) | _get_osfhandle(x)

Definition at line 118 of file win32.c.

## ◆ utf8_to_wstr

#define utf8_to_wstr | ( |  | str,
|  |  | plen
| ) |  | mbstr_to_wstr(CP_UTF8, str, -1, plen)

Definition at line 1288 of file win32.c.

## ◆ WSAID_WSARECVMSG

#define WSAID_WSARECVMSG {0xf689d7c8,0x6f1f,0x436b,{0x8a,0x53,0xe5,0x4f,0xe3,0x51,0xc3,0x22}}

Definition at line 3596 of file win32.c.

## ◆ WSAID_WSASENDMSG

#define WSAID_WSASENDMSG {0xa441e712,0x754f,0x43ca,{0x84,0xa7,0x0d,0xee,0x44,0xcf,0x60,0x6d}}

Definition at line 3599 of file win32.c.

## ◆ wstr_to_acp

#define wstr_to_acp | ( |  | str,
|  |  | plen
| ) |  | wstr_to_mbstr(CP_ACP, str, -1, plen)

Definition at line 1285 of file win32.c.

## ◆ wstr_to_filecp

#define wstr_to_filecp | ( |  | str,
|  |  | plen
| ) |  | wstr_to_mbstr(filecp(), str, -1, plen)

Definition at line 1287 of file win32.c.

## ◆ wstr_to_mbstr

#define wstr_to_mbstr rb_w32_wstr_to_mbstr

Definition at line 1283 of file win32.c.

## ◆ wstr_to_utf8

#define wstr_to_utf8 | ( |  | str,
|  |  | plen
| ) |  | wstr_to_mbstr(CP_UTF8, str, -1, plen)

Definition at line 1289 of file win32.c.

## ◆ yield_once

#define yield_once | ( |  | ) | Sleep(0)

Definition at line 5947 of file win32.c.

## ◆ yield_until

#define yield_until | ( |  | condition | ) | do yield_once(); while (!(condition))

Definition at line 5948 of file win32.c.

## Typedef Documentation

## ◆ cigl_t

typedef DWORD(WINAPI * cigl_t) (const GUID *, NET_LUID *)

Definition at line 4083 of file win32.c.

## ◆ cilnA_t

typedef DWORD(WINAPI * cilnA_t) (const NET_LUID *, char *, size_t)

Definition at line 4084 of file win32.c.

## ◆ get_final_path_func

typedef DWORD(WINAPI * get_final_path_func) (HANDLE, WCHAR *, DWORD, DWORD)

Definition at line 1939 of file win32.c.

## ◆ NtCmdLineElement

typedef struct _NtCmdLineElement NtCmdLineElement

## Enumeration Type Documentation

## ◆ anonymous enum

anonymous enum

Enumerator
constat_init |
constat_esc |
constat_seq |

Definition at line 705 of file win32.c.

## Function Documentation

## ◆ chown()

int chown | ( | const char * | path,
|  | int | owner,
|  | int | group
| ) |  |

Definition at line 4763 of file win32.c.

## ◆ clock_getres()

int clock_getres | ( | clockid_t | clock_id,
|  | struct timespec * | sp
| ) |  |

Definition at line 4652 of file win32.c.

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

## ◆ clock_gettime()

int clock_gettime | ( | clockid_t | clock_id,
|  | struct timespec * | sp
| ) |  |

Definition at line 4612 of file win32.c.

References CLOCK_REALTIME.

Referenced by rb_timespec_now().

## ◆ endhostent()

void endhostent | ( | void |  | ) |

Definition at line 4192 of file win32.c.

## ◆ endnetent()

void endnetent | ( | void |  | ) |

Definition at line 4193 of file win32.c.

## ◆ endprotoent()

void endprotoent | ( | void |  | ) |

Definition at line 4194 of file win32.c.

## ◆ endservent()

void endservent | ( | void |  | ) |

Definition at line 4195 of file win32.c.

## ◆ fchmod()

int fchmod | ( | int | fd,
|  | int | mode
| ) |  |

Definition at line 7638 of file win32.c.

References EBADF, errno, h, and int.

## ◆ fcntl()

int fcntl | ( | int | fd,
|  | int | cmd,
|  |  | ...
| ) |  |

Definition at line 4282 of file win32.c.

References arg, EBADF, errno, F_SETFL, is_socket, TO_SOCKET, va_arg, va_end, and va_start.

Referenced by dup2(), rb_cloexec_fcntl_dupfd(), rb_maygvl_fd_fix_cloexec(), rsock_detect_cloexec(), and rsock_make_fd_nonblock().

## ◆ flock()

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

Definition at line 384 of file win32.c.

## ◆ freeifaddrs()

void freeifaddrs | ( | struct ifaddrs * | ifp | ) |

Definition at line 4176 of file win32.c.

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

## ◆ getegid()

rb_gid_t getegid | ( | void |  | ) |

Definition at line 2786 of file win32.c.

References ROOT_GID.

Referenced by eaccess().

## ◆ geteuid()

rb_uid_t geteuid | ( | void |  | ) |

Definition at line 2772 of file win32.c.

References ROOT_UID.

Referenced by eaccess().

## ◆ getgid()

rb_gid_t getgid | ( | void |  | ) |

Definition at line 2779 of file win32.c.

References ROOT_GID.

Referenced by eaccess().

## ◆ getifaddrs()

int getifaddrs | ( | struct ifaddrs ** | ifap | ) |

Definition at line 4089 of file win32.c.

## ◆ getlogin()

char* getlogin | ( | void |  | ) |

Definition at line 881 of file win32.c.

## ◆ getnetbyaddr()

struct netent* getnetbyaddr | ( | long | net,
|  | int | type
| ) |  |

Definition at line 4199 of file win32.c.

References NULL.

## ◆ getnetbyname()

struct netent* getnetbyname | ( | const char * | name | ) |

Definition at line 4201 of file win32.c.

References NULL.

## ◆ getnetent()

struct netent* getnetent | ( | void |  | ) |

Definition at line 4197 of file win32.c.

References NULL.

## ◆ getprotoent()

struct protoent* getprotoent | ( | void |  | ) |

Definition at line 4203 of file win32.c.

References NULL.

## ◆ getservent()

struct servent* getservent | ( | void |  | ) |

Definition at line 4205 of file win32.c.

References NULL.

## ◆ gettimeofday()

int __cdecl gettimeofday | ( | struct timeval * | tv,
|  | struct timezone * | tz
| ) |  |

Definition at line 4598 of file win32.c.

Referenced by rb_timespec_now(), and rb_w32_select_with_thread().

## ◆ getuid()

rb_uid_t getuid | ( | void |  | ) |

Definition at line 2765 of file win32.c.

References ROOT_UID.

Referenced by eaccess().

## ◆ gmtime_r()

struct tm* gmtime_r | ( | const time_t * | tp,
|  | struct tm * | rp
| ) |  |

Definition at line 7838 of file win32.c.

References EINVAL, errno, error, NULL, rp, and st.

## ◆ ioctl()

int ioctl | ( | int | i,
|  | int | u,
|  |  | ...
| ) |  |

Definition at line 2811 of file win32.c.

References EINVAL, and errno.

## ◆ kill()

int kill | ( | int | pid,
|  | int | sig
| ) |  |

Definition at line 4789 of file win32.c.

References EINVAL, EPERM, err, errno, ESRCH, FALSE, map_errno, NULL, RUBY_CRITICAL, sig, SIGINT, and SIGKILL.

## ◆ lchown()

int lchown | ( | const char * | path,
|  | int | owner,
|  | int | group
| ) |  |

Definition at line 4776 of file win32.c.

## ◆ link()

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

Definition at line 4931 of file win32.c.

References filecp_to_wstr, free, and NULL.

Referenced by rb_mark_end_proc(), and rb_set_end_proc().

## ◆ localtime_r()

struct tm* localtime_r | ( | const time_t * | tp,
|  | struct tm * | rp
| ) |  |

Definition at line 7862 of file win32.c.

References EINVAL, errno, error, NULL, and rp.

## ◆ rb_dir_getwd_ospath()

VALUE rb_dir_getwd_ospath | ( | void |  | ) |

Definition at line 4754 of file win32.c.

References DATA_PTR, Data_Wrap_Struct, NULL, path, Qnil, rb_str_new2, RUBY_DEFAULT_FREE, ruby_getcwd(), strlen(), and xfree.

## ◆ rb_w32_accept()

int WSAAPI rb_w32_accept | ( | int | s,
|  | struct sockaddr * | addr,
|  | int * | addrlen
| ) |  |

Definition at line 3274 of file win32.c.

References RUBY_CRITICAL, and TO_SOCKET.

## ◆ rb_w32_access()

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

Definition at line 5809 of file win32.c.

References EACCES, errno, path, rb_w32_stati128, and stat::st_mode.

## ◆ rb_w32_aspawn()

rb_pid_t rb_w32_aspawn | ( | int | mode,
|  | const char * | prog,
|  | char *const * | argv
| ) |  |

Definition at line 1563 of file win32.c.

References argv, and rb_w32_aspawn_flags().

## ◆ rb_w32_aspawn_flags()

rb_pid_t rb_w32_aspawn_flags | ( | int | mode,
|  | const char * | prog,
|  | char *const * | argv,
|  | DWORD | flags
| ) |  |

Definition at line 1548 of file win32.c.

Referenced by rb_w32_aspawn().

## ◆ rb_w32_asynchronize()

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

Definition at line 5977 of file win32.c.

References arg, argc, argv, FALSE, asynchronous_arg_t::func, NULL, and RUBY_CRITICAL.

## ◆ rb_w32_bind()

int WSAAPI rb_w32_bind | ( | int | s,
|  | const struct sockaddr * | addr,
|  | int | addrlen
| ) |  |

Definition at line 3301 of file win32.c.

References errno, map_errno, RUBY_CRITICAL, and TO_SOCKET.

## ◆ rb_w32_check_interrupt()

int rb_w32_check_interrupt | ( | void * |  | ) |

## ◆ rb_w32_close()

int rb_w32_close | ( | int | fd | ) |

Definition at line 6910 of file win32.c.

References errno, is_socket, LK_LEN, and TO_SOCKET.

Referenced by rb_w32_pipe().

## ◆ rb_w32_closedir()

void rb_w32_closedir | ( | DIR * | dirp | ) |

Definition at line 2396 of file win32.c.

References DIR::bits, direct::d_altname, direct::d_name, DIR::dirstr, free, and DIR::start.

## ◆ rb_w32_connect()

int WSAAPI rb_w32_connect | ( | int | s,
|  | const struct sockaddr * | addr,
|  | int | addrlen
| ) |  |

Definition at line 3317 of file win32.c.

References EINPROGRESS, err, errno, map_errno, RUBY_CRITICAL, and TO_SOCKET.

## ◆ rb_w32_conv_from_wchar()

VALUE rb_w32_conv_from_wchar | ( | const WCHAR * | wstr,
|  | rb_encoding * | enc
| ) |  |

Definition at line 2229 of file win32.c.

References ECONV_UNDEF_REPLACE, ENCINDEX_ASCII, ENCINDEX_US_ASCII, ENCINDEX_UTF_16LE, ENCINDEX_UTF_8, len, NULL, Qnil, rb_enc_from_index(), rb_enc_str_new(), rb_enc_to_index(), rb_long2int, rb_str_conv_enc_opts(), RSTRING_PTR, and src.

Referenced by rb_w32_conv_from_wstr().

## ◆ rb_w32_conv_from_wstr()

char* rb_w32_conv_from_wstr | ( | const WCHAR * | wstr,
|  | long * | lenp,
|  | rb_encoding * | enc
| ) |  |

Definition at line 2260 of file win32.c.

References len, malloc(), memcpy(), NIL_P, ptr, rb_w32_conv_from_wchar(), RSTRING_LEN, RSTRING_PTR, str, and wstr_to_filecp.

## ◆ rb_w32_dup2()

int rb_w32_dup2 | ( | int | oldfd,
|  | int | newfd
| ) |  |

Definition at line 6134 of file win32.c.

References dup2(), and set_new_std_fd.

## ◆ rb_w32_fclose()

int rb_w32_fclose | ( | FILE * | fp | ) |

Definition at line 6389 of file win32.c.

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

## ◆ rb_w32_fd_copy()

void rb_w32_fd_copy | ( | rb_fdset_t * | dst,
|  | const fd_set * | src,
|  | int | max
| ) |  |

Definition at line 2857 of file win32.c.

## ◆ rb_w32_fd_dup()

void rb_w32_fd_dup | ( | rb_fdset_t * | dst,
|  | const rb_fdset_t * | src
| ) |  |

Definition at line 2872 of file win32.c.

References FD_SETSIZE, rb_fdset_t::fdset, memcpy(), src, and xrealloc.

## ◆ rb_w32_fd_is_text()

char rb_w32_fd_is_text | ( | int | fd | ) |

Definition at line 7756 of file win32.c.

References _osfile, and FTEXT.

## ◆ rb_w32_fdclr()

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

Definition at line 2827 of file win32.c.

References i, memmove, and TO_SOCKET.

## ◆ rb_w32_fdisset()

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

Definition at line 2845 of file win32.c.

References RUBY_CRITICAL, and TO_SOCKET.

## ◆ rb_w32_fdset()

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

Definition at line 2818 of file win32.c.

References FD_SET.

## ◆ rb_w32_file_identical_p()

VALUE rb_w32_file_identical_p | ( | VALUE | fname1,
|  | VALUE | fname2
| ) |  |

Definition at line 8024 of file win32.c.

## ◆ rb_w32_free_environ()

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

Definition at line 6077 of file win32.c.

References env, and free.

## ◆ rb_w32_fstat()

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

Definition at line 5398 of file win32.c.

References fstat(), L, NULL, and st.

## ◆ rb_w32_fstati128()

int rb_w32_fstati128 | ( | int | fd,
|  | struct stati128 * | st
| ) |  |

Definition at line 5415 of file win32.c.

References COPY_STAT, fstat(), and st.

## ◆ rb_w32_ftruncate()

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

Definition at line 5904 of file win32.c.

References h.

## ◆ rb_w32_get_environ()

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

Definition at line 6040 of file win32.c.

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

## ◆ rb_w32_get_osfhandle()

SOCKET rb_w32_get_osfhandle | ( | int | fh | ) |

Definition at line 1078 of file win32.c.

## ◆ rb_w32_getcwd()

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

Definition at line 4731 of file win32.c.

## ◆ rb_w32_getenv()

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

Definition at line 5237 of file win32.c.

## ◆ rb_w32_gethostbyaddr()

struct hostent* WSAAPI rb_w32_gethostbyaddr | ( | const char * | addr,
|  | int | len,
|  | int | type
| ) |  |

Definition at line 3831 of file win32.c.

References errno, len, map_errno, NULL, and RUBY_CRITICAL.

## ◆ rb_w32_gethostbyname()

struct hostent* WSAAPI rb_w32_gethostbyname | ( | const char * | name | ) |

Definition at line 3846 of file win32.c.

References errno, map_errno, name, NULL, and RUBY_CRITICAL.

## ◆ rb_w32_gethostname()

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

Definition at line 3861 of file win32.c.

References errno, gethostname(), len, map_errno, name, and RUBY_CRITICAL.

## ◆ rb_w32_getpeername()

int WSAAPI rb_w32_getpeername | ( | int | s,
|  | struct sockaddr * | addr,
|  | int * | addrlen
| ) |  |

Definition at line 3338 of file win32.c.

References errno, map_errno, RUBY_CRITICAL, and TO_SOCKET.

## ◆ rb_w32_getpid()

rb_pid_t rb_w32_getpid | ( | void |  | ) |

Definition at line 6087 of file win32.c.

Referenced by rb_w32_pipe().

## ◆ rb_w32_getppid()

rb_pid_t rb_w32_getppid | ( | void |  | ) |

Definition at line 6095 of file win32.c.

References int, and long.

## ◆ rb_w32_getprotobyname()

struct protoent* WSAAPI rb_w32_getprotobyname | ( | const char * | name | ) |

Definition at line 3876 of file win32.c.

References errno, map_errno, name, NULL, and RUBY_CRITICAL.

## ◆ rb_w32_getprotobynumber()

struct protoent* WSAAPI rb_w32_getprotobynumber | ( | int | num | ) |

Definition at line 3891 of file win32.c.

References errno, map_errno, NULL, and RUBY_CRITICAL.

## ◆ rb_w32_getservbyname()

struct servent* WSAAPI rb_w32_getservbyname | ( | const char * | name,
|  | const char * | proto
| ) |  |

Definition at line 3906 of file win32.c.

References errno, map_errno, name, NULL, proto, and RUBY_CRITICAL.

## ◆ rb_w32_getservbyport()

struct servent* WSAAPI rb_w32_getservbyport | ( | int | port,
|  | const char * | proto
| ) |  |

Definition at line 3921 of file win32.c.

References errno, map_errno, NULL, proto, and RUBY_CRITICAL.

## ◆ rb_w32_getsockname()

int WSAAPI rb_w32_getsockname | ( | int | fd,
|  | struct sockaddr * | addr,
|  | int * | addrlen
| ) |  |

Definition at line 3353 of file win32.c.

References RUBY_CRITICAL, and TO_SOCKET.

## ◆ rb_w32_getsockopt()

int WSAAPI rb_w32_getsockopt | ( | int | s,
|  | int | level,
|  | int | optname,
|  | char * | optval,
|  | int * | optlen
| ) |  |

Definition at line 3383 of file win32.c.

References errno, map_errno, RUBY_CRITICAL, and TO_SOCKET.

## ◆ rb_w32_home_dir()

WCHAR* rb_w32_home_dir | ( | void |  | ) |

Definition at line 540 of file win32.c.

References ALLOC_N, L, len, and NULL.

## ◆ rb_w32_inet_ntop()

const char* WSAAPI rb_w32_inet_ntop | ( | int | af,
|  | const void * | addr,
|  | char * | numaddr,
|  | size_t | numaddr_len
| ) |  |

Definition at line 7723 of file win32.c.

## ◆ rb_w32_inet_pton()

int WSAAPI rb_w32_inet_pton | ( | int | af,
|  | const char * | src,
|  | void * | dst
| ) |  |

Definition at line 7742 of file win32.c.

References int.

## ◆ rb_w32_io_cancelable_p()

int rb_w32_io_cancelable_p | ( | int | fd | ) |

Definition at line 2602 of file win32.c.

References is_socket, and TO_SOCKET.

## ◆ rb_w32_ioctlsocket()

int WSAAPI rb_w32_ioctlsocket | ( | int | s,
|  | long | cmd,
|  | u_long * | argp
| ) |  |

Definition at line 3398 of file win32.c.

References errno, map_errno, RUBY_CRITICAL, and TO_SOCKET.

## ◆ rb_w32_is_socket()

int rb_w32_is_socket | ( | int | fd | ) |

Definition at line 2691 of file win32.c.

References is_socket, and TO_SOCKET.

## ◆ rb_w32_isatty()

int rb_w32_isatty | ( | int | fd | ) |

Definition at line 7679 of file win32.c.

References _osfhnd, ENOTTY, and errno.

## ◆ rb_w32_listen()

int WSAAPI rb_w32_listen | ( | int | s,
|  | int | backlog
| ) |  |

Definition at line 3413 of file win32.c.

References errno, map_errno, RUBY_CRITICAL, and TO_SOCKET.

## ◆ rb_w32_lseek()

off_t rb_w32_lseek | ( | int | fd,
|  | off_t | ofs,
|  | int | whence
| ) |  |

Definition at line 5797 of file win32.c.

References is_socket, and TO_SOCKET.

## ◆ rb_w32_lstati128()

int rb_w32_lstati128 | ( | const char * | path,
|  | struct stati128 * | st
| ) |  |

Definition at line 5790 of file win32.c.

## ◆ rb_w32_map_errno()

int rb_w32_map_errno | ( | DWORD | winerr | ) |

Definition at line 273 of file win32.c.

References i, int, and winerr.

## ◆ rb_w32_mbstr_to_wstr()

WCHAR* rb_w32_mbstr_to_wstr | ( | UINT | cp,
|  | const char * | str,
|  | int | clen,
|  | long * | plen
| ) |  |

Definition at line 2149 of file win32.c.

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

Referenced by dln_load().

## ◆ rb_w32_mkdir()

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

Definition at line 7503 of file win32.c.

References filecp_to_wstr, NULL, and path.

## ◆ rb_w32_open()

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

Definition at line 6181 of file win32.c.

References arg, filecp_to_wstr, NULL, va_arg, va_end, and va_start.

## ◆ rb_w32_opendir()

DIR* rb_w32_opendir | ( | const char * | filename | ) |

Definition at line 2166 of file win32.c.

References filecp_to_wstr, and NULL.

## ◆ rb_w32_osver()

DWORD rb_w32_osver | ( | void |  | ) |

Definition at line 319 of file win32.c.

## ◆ rb_w32_pipe()

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

Definition at line 6412 of file win32.c.

References _set_osfhnd, _set_osflags, EMFILE, err, errno, FALSE, FNOINHERIT, FOPEN, FPIPE, h, int, map_errno, memcpy(), name, NULL, PRI_PIDT_PREFIX, rb_acrt_lowio_lock_fh, rb_acrt_lowio_unlock_fh, rb_pid_t, rb_w32_close(), rb_w32_getpid(), RUBY_CRITICAL, and snprintf().

## ◆ rb_w32_read()

ssize_t rb_w32_read | ( | int | fd,
|  | void * | buf,
|  | size_t | size
| ) |  |

Definition at line 6981 of file win32.c.

References _osfile, _set_osflags, buf, err, FALSE, FEOFLAG, FTEXT, is_socket, len, rb_acrt_lowio_lock_fh, rb_acrt_lowio_unlock_fh, rb_w32_recv(), read(), size, TO_SOCKET, and wait().

## ◆ rb_w32_read_reparse_point()

int rb_w32_read_reparse_point | ( | const WCHAR * | path,
|  | rb_w32_reparse_buffer_t * | rp,
|  | size_t | bufsize,
|  | WCHAR ** | result,
|  | DWORD * | len
| ) |  |

Definition at line 5012 of file win32.c.

Referenced by rb_w32_reparse_symlink_p().

## ◆ rb_w32_readdir()

struct direct* rb_w32_readdir | ( | DIR * | dirp,
|  | rb_encoding * | enc
| ) |  |

Definition at line 2337 of file win32.c.

References ENCINDEX_ASCII, filecp, and rb_enc_to_index().

## ◆ rb_w32_recv()

int WSAAPI rb_w32_recv | ( | int | fd,
|  | char * | buf,
|  | int | len,
|  | int | flags
| ) |  |

Definition at line 3555 of file win32.c.

Referenced by rb_w32_read().

## ◆ rb_w32_recvfrom()

int WSAAPI rb_w32_recvfrom | ( | int | fd,
|  | char * | buf,
|  | int | len,
|  | int | flags,
|  | struct sockaddr * | from,
|  | int * | fromlen
| ) |  |

Definition at line 3562 of file win32.c.

## ◆ rb_w32_rename()

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

Definition at line 5333 of file win32.c.

References filecp_to_wstr, free, and NULL.

## ◆ rb_w32_reparse_symlink_p()

int rb_w32_reparse_symlink_p | ( | const WCHAR * | path | ) |

Definition at line 4987 of file win32.c.

References ALLOCV, ALLOCV_END, FALSE, len, path, rb_w32_read_reparse_point(), rb_w32_reparse_buffer_size, rp, size, and TRUE.

## ◆ rb_w32_rewinddir()

void rb_w32_rewinddir | ( | DIR * | dirp | ) |

Definition at line 2384 of file win32.c.

References DIR::curr, DIR::loc, and DIR::start.

Referenced by rb_w32_seekdir().

## ◆ rb_w32_rmdir()

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

Definition at line 7538 of file win32.c.

References filecp_to_wstr, NULL, and path.

## ◆ rb_w32_seekdir()

void rb_w32_seekdir | ( | DIR * | dirp,
|  | long | loc
| ) |  |

Definition at line 2369 of file win32.c.

References DIR::curr, DIR::loc, and rb_w32_rewinddir().

## ◆ rb_w32_select()

int WSAAPI rb_w32_select | ( | int | nfds,
|  | fd_set * | rd,
|  | fd_set * | wr,
|  | fd_set * | ex,
|  | struct timeval * | timeout
| ) |  |

Definition at line 3250 of file win32.c.

References rb_w32_select_with_thread().

## ◆ rb_w32_select_with_thread()

int rb_w32_select_with_thread | ( | int | nfds,
|  | fd_set * | rd,
|  | fd_set * | wr,
|  | fd_set * | ex,
|  | struct timeval * | timeout,
|  | void * | th
| ) |  |

Definition at line 3113 of file win32.c.

References EINVAL, errno, gettimeofday(), NULL, rb_fd_init(), timeval::tv_sec, and timeval::tv_usec.

Referenced by rb_w32_select().

## ◆ rb_w32_send()

int WSAAPI rb_w32_send | ( | int | fd,
|  | const char * | buf,
|  | int | len,
|  | int | flags
| ) |  |

Definition at line 3570 of file win32.c.

Referenced by rb_w32_write().

## ◆ rb_w32_sendto()

int WSAAPI rb_w32_sendto | ( | int | fd,
|  | const char * | buf,
|  | int | len,
|  | int | flags,
|  | const struct sockaddr * | to,
|  | int | tolen
| ) |  |

Definition at line 3577 of file win32.c.

## ◆ rb_w32_set_nonblock()

int rb_w32_set_nonblock | ( | int | fd | ) |

Definition at line 4390 of file win32.c.

References rb_w32_set_nonblock2(), and TRUE.

## ◆ rb_w32_set_nonblock2()

int rb_w32_set_nonblock2 | ( | int | fd,
|  | int | nonblock
| ) |  |

Definition at line 4359 of file win32.c.

References is_socket, and TO_SOCKET.

Referenced by rb_w32_set_nonblock().

## ◆ rb_w32_set_thread_description()

int rb_w32_set_thread_description | ( | HANDLE | th,
|  | const WCHAR * | name
| ) |  |

Definition at line 8059 of file win32.c.

## ◆ rb_w32_set_thread_description_str()

int rb_w32_set_thread_description_str | ( | HANDLE | th,
|  | VALUE | name
| ) |  |

Definition at line 8076 of file win32.c.

## ◆ rb_w32_setsockopt()

int WSAAPI rb_w32_setsockopt | ( | int | s,
|  | int | level,
|  | int | optname,
|  | const char * | optval,
|  | int | optlen
| ) |  |

Definition at line 3725 of file win32.c.

References errno, map_errno, RUBY_CRITICAL, and TO_SOCKET.

## ◆ rb_w32_shutdown()

int WSAAPI rb_w32_shutdown | ( | int | s,
|  | int | how
| ) |  |

Definition at line 3740 of file win32.c.

References errno, map_errno, RUBY_CRITICAL, shutdown, and TO_SOCKET.

## ◆ rb_w32_socket()

int WSAAPI rb_w32_socket | ( | int | af,
|  | int | type,
|  | int | protocol
| ) |  |

Definition at line 3805 of file win32.c.

References RUBY_CRITICAL.

## ◆ rb_w32_spawn()

rb_pid_t rb_w32_spawn | ( | int | mode,
|  | const char * | cmd,
|  | const char * | prog
| ) |  |

Definition at line 1460 of file win32.c.

## ◆ rb_w32_special_folder()

VALUE rb_w32_special_folder | ( | int | type | ) |

Definition at line 499 of file win32.c.

References path, and PATH_MAX.

## ◆ rb_w32_start_process()

MJIT_FUNC_EXPORTED HANDLE rb_w32_start_process | ( | const char * | abspath,
|  | char *const * | argv,
|  | int | out_fd
| ) |  |

Definition at line 1293 of file win32.c.

## ◆ rb_w32_stat()

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

Definition at line 5687 of file win32.c.

References COPY_STAT, path, rb_w32_stati128, and st.

## ◆ rb_w32_stati128()

int rb_w32_stati128 | ( | const char * | path,
|  | struct stati128 * | st
| ) |  |

Definition at line 5762 of file win32.c.

## ◆ rb_w32_strerror()

char* rb_w32_strerror | ( | int | e | ) |

Definition at line 2706 of file win32.c.

References EADDRINUSE, EWOULDBLOCK, i, int, and sys_nerr.

## ◆ rb_w32_sysinit()

void rb_w32_sysinit | ( | int * | argc,
|  | char *** | argv
| ) |  |

Definition at line 847 of file win32.c.

Referenced by ruby_sysinit().

## ◆ rb_w32_system_tmpdir()

UINT rb_w32_system_tmpdir | ( | WCHAR * | path,
|  | UINT | len
| ) |  |

Definition at line 515 of file win32.c.

References L.

## ◆ rb_w32_telldir()

long rb_w32_telldir | ( | DIR * | dirp | ) |

Definition at line 2358 of file win32.c.

References DIR::loc.

## ◆ rb_w32_time_subtract()

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

Definition at line 3074 of file win32.c.

References timeval::tv_sec, timeval::tv_usec, and wait().

## ◆ rb_w32_times()

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

Definition at line 5926 of file win32.c.

References exit(), and tms::tms_utime.

## ◆ rb_w32_truncate()

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

Definition at line 5897 of file win32.c.

## ◆ rb_w32_uaccess()

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

Definition at line 5824 of file win32.c.

References EACCES, errno, path, rb_w32_ustati128(), and stat::st_mode.

## ◆ rb_w32_uaspawn()

rb_pid_t rb_w32_uaspawn | ( | int | mode,
|  | const char * | prog,
|  | char *const * | argv
| ) |  |

Definition at line 1570 of file win32.c.

References argv, and rb_w32_uaspawn_flags().

## ◆ rb_w32_uaspawn_flags()

rb_pid_t rb_w32_uaspawn_flags | ( | int | mode,
|  | const char * | prog,
|  | char *const * | argv,
|  | DWORD | flags
| ) |  |

Definition at line 1556 of file win32.c.

Referenced by rb_w32_uaspawn().

## ◆ rb_w32_uchdir()

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

Definition at line 7455 of file win32.c.

References free, NULL, path, and utf8_to_wstr.

## ◆ rb_w32_uchmod()

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

Definition at line 7624 of file win32.c.

References free, NULL, path, and utf8_to_wstr.

## ◆ rb_w32_uchown()

int rb_w32_uchown | ( | const char * | path,
|  | int | owner,
|  | int | group
| ) |  |

Definition at line 4770 of file win32.c.

## ◆ rb_w32_ugetcwd()

char* rb_w32_ugetcwd | ( | char * | buffer,
|  | int | size
| ) |  |

Definition at line 4738 of file win32.c.

## ◆ rb_w32_ugetenv()

char* rb_w32_ugetenv | ( | const char * | name | ) |

Definition at line 5230 of file win32.c.

## ◆ rb_w32_ulchown()

int rb_w32_ulchown | ( | const char * | path,
|  | int | owner,
|  | int | group
| ) |  |

Definition at line 4782 of file win32.c.

## ◆ rb_w32_ulink()

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

Definition at line 4911 of file win32.c.

References free, NULL, and utf8_to_wstr.

## ◆ rb_w32_ulstati128()

int rb_w32_ulstati128 | ( | const char * | path,
|  | struct stati128 * | st
| ) |  |

Definition at line 5783 of file win32.c.

## ◆ rb_w32_umkdir()

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

Definition at line 7489 of file win32.c.

References NULL, path, and utf8_to_wstr.

## ◆ rb_w32_unlink()

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

Definition at line 7610 of file win32.c.

References filecp_to_wstr, NULL, and path.

## ◆ rb_w32_unwrap_io_handle()

int rb_w32_unwrap_io_handle | ( | int | fd | ) |

Definition at line 7908 of file win32.c.

References _set_osfhnd, is_socket, LK_LEN, and TO_SOCKET.

## ◆ rb_w32_uopen()

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

Definition at line 6147 of file win32.c.

References arg, NULL, utf8_to_wstr, va_arg, va_end, and va_start.

## ◆ rb_w32_uopendir()

DIR* rb_w32_uopendir | ( | const char * | filename | ) |

Definition at line 2179 of file win32.c.

References NULL, and utf8_to_wstr.

## ◆ rb_w32_ureadlink()

ssize_t rb_w32_ureadlink | ( | const char * | path,
|  | char * | buf,
|  | size_t | bufsize
| ) |  |

Definition at line 5092 of file win32.c.

## ◆ rb_w32_urename()

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

Definition at line 5314 of file win32.c.

References free, NULL, and utf8_to_wstr.

## ◆ rb_w32_urmdir()

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

Definition at line 7552 of file win32.c.

References NULL, path, and utf8_to_wstr.

## ◆ rb_w32_uspawn()

rb_pid_t rb_w32_uspawn | ( | int | mode,
|  | const char * | cmd,
|  | const char * | prog
| ) |  |

Definition at line 1468 of file win32.c.

## ◆ rb_w32_ustati128()

int rb_w32_ustati128 | ( | const char * | path,
|  | struct stati128 * | st
| ) |  |

Definition at line 5755 of file win32.c.

Referenced by rb_w32_uaccess().

## ◆ rb_w32_usymlink()

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

Definition at line 5175 of file win32.c.

## ◆ rb_w32_utime()

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

Definition at line 7388 of file win32.c.

References utimbuf::actime, AT_FDCWD, utimbuf::modtime, path, rb_w32_utimensat(), timespec::tv_nsec, and timespec::tv_sec.

## ◆ rb_w32_utimensat()

int rb_w32_utimensat | ( | int | dirfd,
|  | const char * | path,
|  | const struct timespec * | times,
|  | int | flags
| ) |  |

Definition at line 7441 of file win32.c.

References filecp_to_wstr, NULL, and path.

Referenced by rb_w32_utime(), and rb_w32_utimes().

## ◆ rb_w32_utimes()

int rb_w32_utimes | ( | const char * | path,
|  | const struct timeval * | times
| ) |  |

Definition at line 7414 of file win32.c.

References AT_FDCWD, path, rb_w32_utimensat(), timespec::tv_nsec, timeval::tv_sec, timespec::tv_sec, and timeval::tv_usec.

## ◆ rb_w32_utruncate()

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

Definition at line 5890 of file win32.c.

## ◆ rb_w32_uunlink()

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

Definition at line 7596 of file win32.c.

References NULL, path, and utf8_to_wstr.

## ◆ rb_w32_uutime()

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

Definition at line 7375 of file win32.c.

References utimbuf::actime, AT_FDCWD, utimbuf::modtime, path, rb_w32_uutimensat(), timespec::tv_nsec, and timespec::tv_sec.

## ◆ rb_w32_uutimensat()

int rb_w32_uutimensat | ( | int | dirfd,
|  | const char * | path,
|  | const struct timespec * | times,
|  | int | flags
| ) |  |

Definition at line 7427 of file win32.c.

References NULL, path, and utf8_to_wstr.

Referenced by rb_w32_uutime(), and rb_w32_uutimes().

## ◆ rb_w32_uutimes()

int rb_w32_uutimes | ( | const char * | path,
|  | const struct timeval * | times
| ) |  |

Definition at line 7401 of file win32.c.

References AT_FDCWD, path, rb_w32_uutimensat(), timespec::tv_nsec, timeval::tv_sec, timespec::tv_sec, and timeval::tv_usec.

## ◆ rb_w32_wait_events()

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

## ◆ rb_w32_wopen()

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

Definition at line 6201 of file win32.c.

References arg, va_arg, va_end, and va_start.

## ◆ rb_w32_wrap_io_handle()

int rb_w32_wrap_io_handle | ( | HANDLE | h,
|  | int | flags
| ) |  |

Definition at line 7886 of file win32.c.

References f, h, len, and O_NONBLOCK.

## ◆ rb_w32_write()

ssize_t rb_w32_write | ( | int | fd,
|  | const void * | buf,
|  | size_t | size
| ) |  |

Definition at line 7120 of file win32.c.

References _osfile, buf, EINVAL, err, errno, FDEV, FEOFLAG, fileno(), FPIPE, FTEXT, is_socket, len, map_errno, rb_acrt_lowio_lock_fh, rb_acrt_lowio_unlock_fh, rb_w32_send(), size, stderr, stdout, TO_SOCKET, and wait().

## ◆ rb_w32_write_console()

long rb_w32_write_console | ( | uintptr_t | strarg,
|  | int | fd
| ) |  |

Definition at line 7225 of file win32.c.

References _osfhnd, L, len, ptr, and str.

## ◆ rb_w32_wstr_to_mbstr()

char* rb_w32_wstr_to_mbstr | ( | UINT | cp,
|  | const WCHAR * | wstr,
|  | int | clen,
|  | long * | plen
| ) |  |

Definition at line 2133 of file win32.c.

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

## ◆ readlink()

ssize_t readlink | ( | const char * | path,
|  | char * | buf,
|  | size_t | bufsize
| ) |  |

Definition at line 5099 of file win32.c.

## ◆ recvmsg()

int recvmsg | ( | int | fd,
|  | struct msghdr * | msg,
|  | int | flags
| ) |  |

Definition at line 3621 of file win32.c.

## ◆ ruby_brace_glob_with_enc()

int ruby_brace_glob_with_enc | ( | const char * | str,
|  | int | flags,
|  | ruby_glob_func * | func,
|  | VALUE | arg,
|  | rb_encoding * | enc
| ) |  |

Definition at line 2646 of file dir.c.

References arg, ruby_glob_funcs_t::error, brace_args::flags, brace_args::funcs, GLOB_VERBOSE, ruby_glob_funcs_t::match, NULL, and brace_args::value.

Referenced by ruby_brace_glob().

## ◆ sendmsg()

int sendmsg | ( | int | fd,
|  | const struct msghdr * | msg,
|  | int | flags
| ) |  |

Definition at line 3676 of file win32.c.

## ◆ setgid()

int setgid | ( | rb_gid_t | gid | ) |

Definition at line 2800 of file win32.c.

References ROOT_GID.

## ◆ sethostent()

void sethostent | ( | int | stayopen | ) |

Definition at line 4207 of file win32.c.

## ◆ setnetent()

void setnetent | ( | int | stayopen | ) |

Definition at line 4209 of file win32.c.

## ◆ setprotoent()

void setprotoent | ( | int | stayopen | ) |

Definition at line 4211 of file win32.c.

## ◆ setservent()

void setservent | ( | int | stayopen | ) |

Definition at line 4213 of file win32.c.

## ◆ setuid()

int setuid | ( | rb_uid_t | uid | ) |

Definition at line 2793 of file win32.c.

References ROOT_UID.

## ◆ signbit()

int signbit | ( | double | x | ) |

Definition at line 7714 of file win32.c.

## ◆ socketpair()

int socketpair | ( | int | af,
|  | int | type,
|  | int | protocol,
|  | int * | sv
| ) |  |

Definition at line 4022 of file win32.c.

## ◆ STATIC_ASSERT()

STATIC_ASSERT | ( | std_handle | ,
|  | (STD_OUTPUT_HANDLE-STD_INPUT_HANDLE) | = `=(STD_ERROR_HANDLE-STD_OUTPUT_HANDLE)`
| ) |  |

## ◆ symlink()

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

Definition at line 5182 of file win32.c.

## ◆ wait()

int wait | ( | int * | status | ) |

Definition at line 5189 of file win32.c.

References waitpid().

Referenced by rb_w32_read(), rb_w32_time_subtract(), and rb_w32_write().

## ◆ waitpid()

rb_pid_t waitpid | ( | rb_pid_t | pid,
|  | int * | stat_loc,
|  | int | options
| ) |  |

Definition at line 4476 of file win32.c.

Referenced by wait().

## Variable Documentation

## ◆ __pioinfo

EXTERN_C _CRTIMP ioinfo* __pioinfo[]

Definition at line 2478 of file win32.c.

## ◆ err

int err

Definition at line 135 of file win32.c.

Referenced by kill(), onig_compile_ruby(), onig_new(), ossl_raise(), rb_f_exec(), rb_f_raise(), rb_fiber_start(), rb_gc_for_fd(), rb_load_fail(), rb_mutex_unlock(), rb_notify_fd_close(), rb_range_beg_len(), rb_reg_check_preprocess(), rb_reg_match_p(), rb_reg_prepare_re(), rb_set_errinfo(), rb_threadptr_unlock_all_locking_mutexes(), rb_w32_connect(), rb_w32_pipe(), rb_w32_read(), rb_w32_write(), reg_enum_key(), reg_get_val(), reg_get_val2(), rsock_syserr_fail_host_port(), rsock_syserr_fail_path(), rsock_syserr_fail_raddrinfo(), rsock_syserr_fail_raddrinfo_or_sockaddr(), rsock_syserr_fail_sockaddr(), ruby_close(), ruby_float_step_size(), ruby_getpeername(), ruby_getsockname(), ruby_shutdown(), and sdbm_prep().

## ◆ rb_f_notimplement_

VALUE(*const rb_f_notimplement_) (int, const VALUE *, VALUE, VALUE) = rb_f_notimplement

Definition at line 8099 of file win32.c.

## ◆ winerr

DWORD winerr

Definition at line 134 of file win32.c.

Referenced by rb_w32_map_errno().

EWOULDBLOCK
#define EWOULDBLOCK
Definition: rubysocket.h:134
FOREGROUND_MASK
#define FOREGROUND_MASK
Definition: win32.c:6574
BACKGROUND_MASK
#define BACKGROUND_MASK
Definition: win32.c:6575
v
int VALUE v
Definition: rb_mjit_min_header-2.7.0.h:12332
st_ctime
#define st_ctime
Definition: rb_mjit_min_header-2.7.0.h:2403
i
uint32_t i
Definition: rb_mjit_min_header-2.7.0.h:5464
map_errno
#define map_errno
Definition: win32.c:293
ALLOCA_N
#define ALLOCA_N(type, n)
Definition: ruby.h:1684
st_mtime
#define st_mtime
Definition: rb_mjit_min_header-2.7.0.h:2402
src
__inline__ const void *__restrict src
Definition: rb_mjit_min_header-2.7.0.h:2836
dup2
RUBY_EXTERN int dup2(int, int)
Definition: dup2.c:27
buf
unsigned char buf[MIME_BUF_SIZE]
Definition: nkf.c:4322
f
#define f
err
int err
Definition: win32.c:135
st_atime
#define st_atime
Definition: rb_mjit_min_header-2.7.0.h:2401
len
uint8_t len
Definition: escape.c:17
numberof
#define numberof(array)
Definition: etc.c:618
name
const char * name
Definition: nkf.c:208