From: Nick Ing-Simmons [mailto:[EMAIL PROTECTED]]
>
> long
> Lang_OSHandle(fd)
> int fd;
> {
> #ifdef WIN32
>  return win32_get_osfhandle(fd);
> #else
>  return fd;
> #endif
> }

On a similar note, I can sort out the socket issue (socket handles not being
waitable objects), if I can get from a Perl SV to a Winsock SOCKET value.
Can I do so? In particular, given a SV*, what I want to be able to do (in
the io watcher code) is:

   1. If it's not a filehandle, complain.
   2. If it's not a socket, get the fd
      and from there get the HANDLE, as above.
   3. If it is a socket, get the SOCKET. With
      the SOCKET, I can do WSAEventSelect to
      get an event handle which is waitable.

Just looking in the docs, it's interesting to note that perlapio.pod
explains all about PerlIO, but nowhere explains how to get a PerlIO* from a
SV*. I can crib the code from c/unix_io.c for this, though.

Paul.

Reply via email to