Re: system_exec() on Linux

new topic     » goto parent     » topic index » view thread      » older message » newer message

Derek Parnell wrote:
> 
> I think that the Linux return code is in the rightmost byte of the return
> value
> from the C system() call.
> 
>   sysret = system(pszCommand);
>   result = ((sysret & 0xFF00) >> 8);
> 
> -- 
> Derek Parnell
> Melbourne, Australia
> Skype name: derek.j.parnell

Hmm. Interestingly enough, 32512 in hex is #7F00.

Wait, your expression would give the leftmost byte for result then shift it into
the lower eight bits. You lose the rightmost byte.

--
A complex system that works is invariably found to have evolved from a simple
system that works.
--John Gall's 15th law of Systemantics.

"Premature optimization is the root of all evil in programming."
--C.A.R. Hoare

j.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu