Project

General

Profile

Backport #4905 ยป add_socket.1_8.patch

ghazel (Greg Hazel), 06/19/2011 10:34 PM

View differences:

win32/win32.c (working copy)
1927 1927
}
1928 1928
#endif
1929 1929

  
1930
int
1931
rb_w32_add_socket(SOCKET sock, int flag)
1932
{
1933
    return rb_w32_open_osfhandle(sock, O_RDWR|O_BINARY|O_NOINHERIT);
1934
}
1935

  
1936
void
1937
rb_w32_remove_socket(int fd)
1938
{
1939
    _set_osfhnd(fd, (SOCKET)INVALID_HANDLE_VALUE);
1940
    _close(fd);
1941
}
1942

  
1930 1943
#undef getsockopt
1931 1944

  
1932 1945
static int
win32/win32.h (working copy)
612 612
size_t rb_w32_write(int, const void *, size_t);
613 613
int  rb_w32_utime(const char *, struct utimbuf *);
614 614
#define Sleep(msec) (void)rb_w32_sleep(msec)
615
int  rb_w32_add_socket(SOCKET sock, int flag);
616
void rb_w32_remove_socket(int fd);
615 617

  
616 618
/*
617 619
== ***CAUTION***