Hi, I'd hate to be wrong, but I think I can see the error in doio.c:
The code performs INT2PTR on "a", enlarging it to a 64-bit char*. Since we're on a big-Endian machine, it means it is padded with zeroes on the left side. Then it moves "a" into "union semun".buf. However, SETVAL works in the "val" member of "union semun". Since this "val" is 32-bit and since we are on big-Endian, this "val" is always going to be zero. Quod erad demonstrandum :-) I wouldn't go so far as to suggest you a fix, but I think that you'll need a special branch for SETVAL (the only semctl() case that actually works on "union semun".val. Please comment. Regards, Petr Novotny [EMAIL PROTECTED] ----- PŮVODNÍ ZPRÁVA ----- Od: "Nicholas Clark via RT" <[EMAIL PROTECTED]> Komu: [EMAIL PROTECTED] Předmět: Re: [perl #36588] Problem with semctl() on Perl 5.8.6, Datum: 19.7.2005 - 12:09:18 > On Mon, Jul 18, 2005 at 07:04:03AM -0700, novotny. petr @ > volny. cz wrote: > > > Output from 5.6.1 (32-bit): > > Created new semaphore > > 1 > > > > Output from 5.8.6 (64-bit): > > Created new semaphore > > 0 > > > > (Of course, I called ipcrm between the two tests to delete > > the > > semaphore. I'm saying this just in case :-)) > > That's useful, as it's the sort of thing that people forget. > (Well, I would) > > Are you able to build 5.8.5 32-bit on your machine? This would > make it clear > whether it's a 5.6 -> 5.8 issue, or a 32 bit / 64 bit issue. > > My hunch is that it's something to do with big endian 64 bit > builds (and > pack templates or maybe structure alignment) but it would be > good to test > this. > > Nicholas Clark > > >