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

📄 syscall_check.c

📁 fsmlabs的real time linux的内核
💻 C
字号:
/* * Copywrite 2002 Der Herr Hofrat * License GPL V2 * Author der.herr@hofr.at *//* * prototype usage of loadable system call - this will grab the dynamically * allocated system cal number from /proc/pal_sys_nr and then trigger the * system call via syscall(#) - run demesg to check output from the actual * system call. */ #include <stdio.h>      /* printf */#include <asm/unistd.h> /* __NR_test_call _syscall0() */#include <errno.h>      /* for syscall() _syscall0() */int main(int argc,char ** argv){	int syscall_nr;	FILE *pal_sys_nr;	/* grab the syscall number to use */	if((pal_sys_nr = fopen("/proc/pal_sys_nr","r")) == NULL )	{		perror("Cannot open /proc/pal_sys_nr - did you load the modules ?");		exit(-1);	}	fscanf( pal_sys_nr, "PAL syscall Nr:%d\n", &syscall_nr );	fclose(pal_sys_nr);	/* invoce the system call now */		syscall(syscall_nr);	printf("now type  dmesg  to see the printk from default pal syscall\n");	return 0;}

⌨️ 快捷键说明

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