你好朋友我strace我的android恢复n找到了这个
open("/dev/tty0",
O_RDWR|O_DSYNC|O_LARGEFILE) = 3
ioctl(3, KDSETMODE, 0x1) = 0
stat64("/dev/late_display/control",
{st_mode=S_IFCHR|0660,
st_rdev=makedev(248, 0), ...}) = 0
write(2, "splash screen display", 21) = 21
write(2, ": ", 2) = 2
write(2, "No such file or directory", 25) = 25
write(2, "\n", 1) = 1
open("/dev/late_display/control",
O_RDONLY|O_LARGEFILE) = 4
ioctl(4, SNDCTL_SEQ_SYNC, 0) = 0
close(4) = 0
stat64("/dev/graphics/fb0",
{st_mode=S_IFCHR|0660,
st_rdev=makedev(29, 0), ...}) = 0
open("/dev/graphics/fb0",
O_RDWR|O_LARGEFILE) = 4
我的问题是这是c中这一行的程序。我写的是同样的但它在{token和becoz这个我的构建cwm无法找到fb0 framebuffer之前给出了错误预期的表达式。 谢谢
stat64("/dev/late_display/control",
{st_mode=S_IFCHR|0660,
st_rdev=makedev(248, 0), ...})
答案 0 :(得分:0)
这是使用stat
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <stdio.h>
int main()
{
struct stat buf;
const char *filename = "/dev/late_display/control";
if(stat(filename, &buf) != 0)
{
perror("stat");
return 1;
}
printf("stat succeeded\n");
return 0;
}
手册页是这些函数man 2 stat