diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1999-06-24 04:24:09 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1999-06-24 04:24:09 +0000 |
commit | 031d2e84df58ed54948671931544c41cf32da1ca (patch) | |
tree | 1118362b178f55bf14d142752b8d61976191b991 /win32/win32.c | |
parent | 37bcc42c983987ec504efd9556f0cb884f0b424d (diff) |
990624
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_3@490 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32/win32.c')
-rw-r--r-- | win32/win32.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/win32/win32.c b/win32/win32.c index 7ff86366e9..db43ce6154 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -1780,6 +1780,36 @@ ioctl(int i, unsigned int u, long data) } +#undef FD_SET + +void +myfdset(int fd, fd_set *set) +{ + unsigned int i; + SOCKET s = TO_SOCKET(fd); + + for (i = 0; i < set->fd_count; i++) { + if (set->fd_array[i] == s) { + return; + } + } + if (i == set->fd_count) { + if (set->fd_count < FD_SETSIZE) { + set->fd_array[i] = s; + set->fd_count++; + } + } +} + + +#undef FD_ISSET + +int +myfdisset(int fd, fd_set *set) +{ + return __WSAFDIsSet(TO_SOCKET(fd), set); +} + // // Networking trampolines // These are used to avoid socket startup/shutdown overhead in case |