diff options
author | Paul Green <Paul.Green@stratus.com> | 2002-03-08 17:34:00 -0500 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2002-03-09 04:19:22 +0000 |
commit | e366b469b913fe3bb59ea9a1de1949e15e2e2633 (patch) | |
tree | 574943b46ca39a58378399ee6c47507b0e247fc8 /pp_sys.c | |
parent | 091ab6010f97a3f49489e8fb6c7cc430e9479bff (diff) | |
download | perl-e366b469b913fe3bb59ea9a1de1949e15e2e2633.tar.gz |
pp_sys.c (pp_sselect to not clobber storage on BigEndian
Message-Id: <200203090336.WAA11215@mailhub1.stratus.com>
p4raw-id: //depot/perl@15128
Diffstat (limited to 'pp_sys.c')
-rw-r--r-- | pp_sys.c | 25 |
1 files changed, 12 insertions, 13 deletions
@@ -984,18 +984,7 @@ PP(pp_sselect) } /* little endians can use vecs directly */ -#if BYTEORDER == 0x1234 || BYTEORDER == 0x12345678 -# if SELECT_MIN_BITS > 1 - /* If SELECT_MIN_BITS is greater than one we most probably will want - * to align the sizes with SELECT_MIN_BITS/8 because for example - * in many little-endian (Intel, Alpha) systems (Linux, OS/2, Digital - * UNIX, Solaris, NeXT, Darwin) the smallest quantum select() operates - * on (sets/tests/clears bits) is 32 bits. */ - growsize = maxlen + (SELECT_MIN_BITS/8 - (maxlen % (SELECT_MIN_BITS/8))); -# else - growsize = sizeof(fd_set); -# endif -# else +#if BYTEORDER != 0x1234 && BYTEORDER != 0x12345678 # ifdef NFDBITS # ifndef NBBY @@ -1006,10 +995,20 @@ PP(pp_sselect) # else masksize = sizeof(long); /* documented int, everyone seems to use long */ # endif - growsize = maxlen + (masksize - (maxlen % masksize)); Zero(&fd_sets[0], 4, char*); #endif +# if SELECT_MIN_BITS > 1 + /* If SELECT_MIN_BITS is greater than one we most probably will want + * to align the sizes with SELECT_MIN_BITS/8 because for example + * in many little-endian (Intel, Alpha) systems (Linux, OS/2, Digital + * UNIX, Solaris, NeXT, Darwin) the smallest quantum select() operates + * on (sets/tests/clears bits) is 32 bits. */ + growsize = maxlen + (SELECT_MIN_BITS/8 - (maxlen % (SELECT_MIN_BITS/8))); +# else + growsize = sizeof(fd_set); +# endif + sv = SP[4]; if (SvOK(sv)) { value = SvNV(sv); |