简体   繁体   English

linux stat64这是什么风格?

[英]linux stat64 what style is this?

hello friends I strace my android recovery n found this 你好朋友我追踪我的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

my question is this what programs for this line in c. 我的问题是在c中为此行编写什么程序。 i write as same it is but it gave error expected expression before { token and becoz of this my build cwm isnot able to find fb0 framebuffer. 我写的是一样的,但是它在{令牌和becoz之前给了我预期的错误表达,我的构建cwm无法找到fb0帧缓冲区。 thanks 谢谢

 stat64("/dev/late_display/control",

 {st_mode=S_IFCHR|0660,

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

This is to use 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;
}

The man pages are an excellent reference for these functions man 2 stat 手册页是这些功能的绝佳参考man 2 stat

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM