Re: "Run .. returning" & "exit program"
Posted in 1997
On 30 Oct 1997, Michael Hoffman wrote: } I stumbled upon a little problem that I'm hoping one of the gurus has } solved in the past. Yep, I've solved it. I put the relevant information in the release notes. The status returned to your program is the status from the wait(2) system call. This contains the exit code of the program in the upper 8-bits of the 16-bit value, and it contains information about signals and core dumps in the lower 8-bits if they are relevant. } I am using Informix 4gl and calling another 4ge program ("run x.4ge } returning y"). The other program passes back an integer ("exit program(a)"). } } The problem: 'y' should equal 'a', correct? No: you'd have to divide by 256 to get the same value. } Well... it doesn't. } After looking at the data, I found that 'y' actually equals the second 8 bits } of 'a'. } [example: a = 6649 (binary = 00011001 11111001); } y = 63744 (binary = 11111001 00000000); ] Yes. } How do I get around this problem? Divide by 256. } My system: Informix v. 5.04 on HP-UX 10.01 And I4GL v4.1x? Yours, Jonathan Leffler (johnl@informix.com) #include <witticism.h>