C<dump()>, C<chown()>, C<link()>, C<symlink()>, C<chroot()>,
C<setpgrp()> and related security functions, C<setpriority()>,
C<getpriority()>, C<syscall()>, C<fcntl()>, C<getpw*()>,
-C<wait*()>, C<msg*()>, C<shm*()>, C<sem*()>, C<ioctl()>, C<alarm()>,
+C<wait*()>, C<msg*()>, C<shm*()>, C<sem*()>, C<alarm()>,
C<socketpair()>, C<*netent()>, C<*protoent()>, C<*servent()>,
C<*hostent()>, C<getnetby*()>.
This list is possibly incomplete.
=item *
+The C<ioctl()> call is only supported on sockets (where it provides the
+functionality of ioctlsocket() in the Winsock API).
+
+=item *
+
C<$?> ends up with the exitstatus of the subprocess (this is different
from Unix, where the exitstatus is actually given by "$? >> 8").
Failure to spawn() the subprocess is indicated by setting $? to
#define TMPPATH "plXXXXXX"
#ifdef WIN32
+#define HAS_IOCTL
#define HAS_UTIME
#define HAS_KILL
#endif
win32_alarm
win32_open_osfhandle
win32_get_osfhandle
+win32_ioctl
Perl_win32_init
Perl_init_os_extras
Perl_getTHR
* File system stuff
*/
-#if 0
-int
-ioctl(int i, unsigned int u, char *data)
-{
- croak("ioctl not implemented!\n");
- return -1;
-}
-#endif
-
DllExport unsigned int
win32_sleep(unsigned int t)
{
DllExport unsigned win32_alarm(unsigned int sec);
DllExport int win32_flock(int fd, int oper);
DllExport int win32_stat(const char *path, struct stat *buf);
+DllExport int win32_ioctl(int i, unsigned int u, char *data);
#ifdef HAVE_DES_FCRYPT
DllExport char * win32_crypt(const char *txt, const char *salt);
#undef sleep
#undef times
#undef alarm
+#undef ioctl
#ifdef __BORLANDC__
#undef ungetc
#define sleep win32_sleep
#define times win32_times
#define alarm win32_alarm
+#define ioctl win32_ioctl
#ifdef HAVE_DES_FCRYPT
#undef crypt
return r;
}
-int
+DllExport int
win32_ioctlsocket(SOCKET s, long cmd, u_long *argp)
{
int r;
return r;
}
+int
+win32_ioctl(int i, unsigned int u, char *data)
+{
+ u_long argp = (u_long)data;
+ int retval;
+
+ if (!wsock_started) {
+ croak("ioctl implemented only on sockets");
+ /* NOTREACHED */
+ }
+
+ retval = ioctlsocket(TO_SOCKET(i), (long)u, &argp);
+ if (retval == SOCKET_ERROR) {
+ if (WSAGetLastError() == WSAENOTSOCK) {
+ croak("ioctl implemented only on sockets");
+ /* NOTREACHED */
+ }
+ errno = WSAGetLastError();
+ }
+ return retval;
+}
+
char FAR *
win32_inet_ntoa(struct in_addr in)
{