read_simple_device.c
来自「fsmlabs的real time linux的内核」· C语言 代码 · 共 17 行
C
17 行
#include <stdio.h>#include <fcntl.h>#include "device_common.h"main(){ int fd,n; char data[16]; if((fd=open(SIMPLE_DEV, O_RDWR|O_SYNC))<0) { perror("open"); exit(-1); } /* just read to trigger the read-fops */ n = read(fd, &data, sizeof(data)); return 0;}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?