add global process
return the exit code
Merge pull request #533 from luvit/exit-code

add global process