Problem with system() call
I am using a system() call in a program , that is in c library. For 1st 9 calls it returns '0'(zero) after 10th call it returns 256. I do not know what does it 开发者_如何学编程mean. Please anybody help me. Following is the line of code
int returnValue= system("/system/bin/cat /dev/graphics/fb0 > /tmpdata/Screenshot/screenshot.bin");
According to this man page dealing with the general unix cat
command, an error code >0 simply means an error occurred.
The following exit values shall be returned: 0 All input files were output successfully. >0 An error occurred.
Your system()
call is attempting to concatentate two files, so perhaps there is a space issue or maybe the source file does not exist.
You may also wish to take a look at some recent source code for Android cat (cat.c) which gives some indicatations of the kind of things that trigger errors within cat.
精彩评论