⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 scull_test.c

📁 Linux设备管理源码 字符设备驱动程序:设计两个终端设备文件实现一个字符设备驱动程序
💻 C
字号:
#include <stdio.h>#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>scull_test(unsigned int cmd,unsigned long arg){	int i,testscull;	char buf[50];	testscull=scull_open("/dev/scull",O_RDWR);	if(testscull==-1){		printf("Can't open the file!\n");		exit(0);	}	scull_read(testscull,buf,50);	for(i=0;i<50;i++)		printf("%d\n",buf[i]);	close(testscull);}

⌨️ 快捷键说明

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