0

你好朋友我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 之前给出了错误的预期表达式,因为我的构建 cwm 无法找到 fb0 帧缓冲区。谢谢

 stat64("/dev/late_display/control",

 {st_mode=S_IFCHR|0660,

 st_rdev=makedev(248, 0), ...})
4

1 回答 1

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

于 2013-09-13T09:40:02.020 回答