2010-11-18 98 views
0

我在程序中使用system()調用,即在c庫中。對於第9次調用,它在第10次調用後返回「0」(零),它返回256.我不知道它是什麼意思。請有人幫助我。以下是代碼系統問題()調用

int returnValue= system("/system/bin/cat /dev/graphics/fb0 > /tmpdata/Screenshot/screenshot.bin"); 
+0

Android的哪個版本? – 2010-11-18 10:16:11

+0

Android 2.1(Eclair)。 – Kantesh 2010-11-18 10:38:02

回答

1

根據this man page處理與一般的unix命令cat線,一個錯誤代碼> 0僅僅意味着發生了錯誤。

The following exit values shall be returned: 

0 
    All input files were output successfully. 
>0 
    An error occurred. 

system()呼叫嘗試concatentate兩個文件,因此,或許是有空間的問題或可能的源文件不存在。

你也不妨看看最近的一些source code for Android cat(cat.c),它給出了貓內引發錯誤的東西的一些指示。

+0

系統呼叫數量有限?因爲每次我都會在第10次電話會議中被打破。 – Kantesh 2010-11-25 09:18:28

+0

@Kantesh否 - 你可以隨時調用system(),調用它的**效果**(創建新數據)造成限制 – 2010-11-25 09:19:42

+0

我每次完成後都解決了重新啓動活動系統調用。我認爲有一個會話或類似的東西,當重新啓動活動過程重新啓動並重置。 – Kantesh 2010-11-25 09:23:34