p10-7.c
来自「SUN Solaris8平台下进程间通信」· C语言 代码 · 共 26 行
C
26 行
#include <stropts.h>#include <stdio.h>#include <fcntl.h>#include "err_exit.h"int main(int argc, char *argv[]){ int fd; char firstmodule[FMNAMESZ + 1]; if(argc != 2){ printf("Usage: a.out <pathname>\n"); exit(0); } if ((fd = open(argv[1],O_RDONLY)) < 0) err_exit("open failed"); if (isastream(fd) == 0){ printf("%s is not a stream\n",argv[1]); exit(0); } /* 获取模块名 */ if (ioctl(fd,I_LOOK, firstmodule) < 0) err_exit("no module in the STREAM."); /* 打印模块名 */ printf("module name = %s\n", firstmodule); return 0;}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?