【发布时间】:2010-11-18 10:10:34
【问题描述】:
我在程序中使用 system() 调用,即在 c 库中。对于第 9 次调用,它在第 10 次调用后返回“0”(零)。我不知道这是什么意思。请任何人帮助我。以下是代码行
int returnValue= system("/system/bin/cat /dev/graphics/fb0 > /tmpdata/Screenshot/screenshot.bin");
【问题讨论】:
我在程序中使用 system() 调用,即在 c 库中。对于第 9 次调用,它在第 10 次调用后返回“0”(零)。我不知道这是什么意思。请任何人帮助我。以下是代码行
int returnValue= system("/system/bin/cat /dev/graphics/fb0 > /tmpdata/Screenshot/screenshot.bin");
【问题讨论】:
根据this man page处理通用的unixcat命令,错误代码>0仅仅意味着发生了错误。
The following exit values shall be returned: 0 All input files were output successfully. >0 An error occurred.
您的system() 调用正在尝试连接两个文件,因此可能存在空间问题或源文件不存在。
您可能还希望查看最近的一些 source code for Android cat (cat.c),它提供了一些在 cat 中触发错误的指示。
【讨论】: