Perl 5.003_20: OS/2 patches
Chip Salzenberg writes:
>
> It's all become so routine:
>
> file: $CPAN/authors/id/CHIPS/perl5.003_20.pat.gz
Below are latest os/2-related patches. **** Note the first chunk ****
It shows that under OS/2 4-argument select was writing over memory
(256 bites = 32 bytes) over what is typically 1-char malloc area.
Since an exception of the general rule is needed on linux and OS/2,
can we trust this rule at all? There may be zillions of obscure
little-endian systems where select sets all the bytes it cares about
instead of just the passed number.
If one wants a Configure test for this, here is the skeleton:
#include <stdlib.h>
#include <sys/select.h>
char buffer[81] = "
01234567890123456789012345678901234567890123456789012345678901234567890123456789";
char buffer1[81] = "
01234567890123456789012345678901234567890123456789012345678901234567890123456789";
int
main (int argc, char* argv[], char* envp[])
{
int i = 80;
buffer[0] = 2; /* stdout */
select(8, NULL, (fd_set *)buffer, NULL, NULL);
while (i > 0 && buffer1[i] == buffer[i]) i--;
printf("%i bytes overwritten.\n", i+1);
exit(0);
}
Enjoy,
Ilya
This patch does the following:
a) substitutes BSD (s)random instead of broken EMX's one;
b) removes rsignal from os2/os2.c since it it exported now;
c) defines `register' to none if better debugging is deemed necessary.
d) fixes broken pp_sselect.
p5p-msgid: <
199701101102.GAA19051@monk.mps.ohio-state.edu>