testdriverapp.c

来自「44B0-examcode测试程序」· C语言 代码 · 共 20 行

C
20
字号
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
main()
{
	int fd,i,j;
	char buf[10];
	fd=open("/dev/test",O_RDWR);
	if(fd<0)
	{
		printf("can not open file\n");
		exit(0);
	}
	ioctl(fd, 1, 0);  //µÚ2 žö²ÎÊý1 ±íÊŸÀ®°ÈœÐ,0 ±íÊŸ²»œÐ
	close(fd);
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?