diff options
author | Steve Hay <SteveHay@planit.com> | 2007-06-20 16:03:10 +0000 |
---|---|---|
committer | Steve Hay <SteveHay@planit.com> | 2007-06-20 16:03:10 +0000 |
commit | 0a23e5bfd5c64a7864bfe5805f19af1e2e6d0a47 (patch) | |
tree | 0ecf864aa0bb201a9c78ee2f280b5393822e10cc /win32 | |
parent | d1b0f6034d6ba11b3431428d8dac3200d6b2b02b (diff) | |
download | perl-0a23e5bfd5c64a7864bfe5805f19af1e2e6d0a47.tar.gz |
Change #31426 should also be applied to the PERL_IMPLICIT_SYS
version of ioctl()
p4raw-id: //depot/perl@31428
Diffstat (limited to 'win32')
-rw-r--r-- | win32/perlhost.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/win32/perlhost.h b/win32/perlhost.h index e042103719..9974fd8b4b 100644 --- a/win32/perlhost.h +++ b/win32/perlhost.h @@ -989,7 +989,14 @@ PerlLIOFileStat(struct IPerlLIO* piPerl, int handle, Stat_t *buffer) int PerlLIOIOCtl(struct IPerlLIO* piPerl, int i, unsigned int u, char *data) { - return win32_ioctlsocket((SOCKET)i, (long)u, (u_long*)data); + u_long u_long_arg; + int retval; + + /* mauke says using memcpy avoids alignment issues */ + memcpy(&u_long_arg, data, sizeof u_long_arg); + retval = win32_ioctlsocket((SOCKET)i, (long)u, &u_long_arg); + memcpy(data, &u_long_arg, sizeof u_long_arg); + return retval; } int |