简体   繁体   中英

exit status of ./a.out (c compiled code) on running it

I have ac compiled code.
I am using

exec('./a.out 2>&1',$out,$ret);
in my php script to get return type where I want to know first whether it ran fine or what went wrong a segmentation fault or infinite loop or something like that.
basically i want to know the exit status 0,1 and 2 and there significance.
if any other exit status exist please tell those also..

PHP puts the exit status of the exec()ed program to the $ret variable. The program has exited successfully iff $ret becomes 0 after exec() returns.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM