kern_loop.c
来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· C语言 代码 · 共 40 行
C
40 行
#ifndef lintstatic char *sccsid = "@(#)kern_loop.c 4.1 (ULTRIX) 7/2/90";#endif lint/* * kern_loop.c * * This program enables the redirecting of kernel messages * to the /dev/mouse. Messages will no longer appear on * the VAXstar monochrome screen at random. * * Ali Rafieymehr * */#include <stdio.h>#include <sys/file.h>#include <vaxuba/smioctl.h>#include <vaxuba/qevent.h>extern int errno;main(){ int fd; if ((fd = open("/dev/mouse", O_RDONLY)) < 0) { printf("Failed to open \"/dev/mouse\", errno = %d\n", errno); exit(-1); } if (ioctl(fd, QIOKERNLOOP) == -1) { printf("ioctl QIOKERNLOOP failed, errno = %d\n", errno); exit(-1); } close(fd);}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?