Re: return code wierdness
Posted in 1994
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
Jack Parker (jparker@hpbs3645.boi.hp.com) wrote: >: Could one of you informix blokes explain this? [Fun with return codes deleted.] I use a number of C functions embedded in my I-4GL code. [AT&T UNIX System V 3.2.3. I run fglc, then fglc2 on my I-4GL to get C code, then 'cc' them with with the proper includes and libs to get object files. Then I 'cc' the whole mess into a single executable. (Heck, I even have a C front-end that execs w/environment, which I use in lue of any shell in the users /etc/passwd entries. NEVER do I suffer from bad user paths. And the users can't do a darn thing that I don't let them.)] Here's a short C function that I use to clean up my return values. [My code spawns child process via system calls, and, like all well behaved code, checks the return value.] Note that on AT&T Sys V you have to mask before shifting - 32 bit ints, and those upper 16 bits are set upon return. int fix_exit_val(passed) int passed; { return((passed & 0x0000ff00) >> 8); } -- Chuck E. Jones cej@ccsitn.att.com Every other third Tuesday in the fourth week of February