Get exit code from non-child process

前端 未结 1 745
梦谈多话
梦谈多话 2021-01-24 10:10

I\'m looking how I can get exit code from non-child process.

As we all know there are few functions to work with child processes such as wait/waitpid. With this function

相关标签:
1条回答
  • 2021-01-24 10:50

    There is no POSIX or otherwise standard UNIX / Linux call to do what you ask, that I know of, but you can possibly accomplish it on Linux (or other UNIX) using the procfs. Many non-standard extensions were innovated with the procfs.

    If the parent has not yet waited on the child, the return code may still be around.

    See: Linux, where are the return codes stored of system daemons and other processes?

    0 讨论(0)
提交回复
热议问题