scsi_type.c

来自「操作系统SunOS 4.1.3版本的源码」· C语言 代码 · 共 38 行

C
38
字号
#ifndef lintstatic char sccsid[] = "@(#)scsi_type.c 1.1 92/07/30 SMI";#endif lint/* * Copyright (c) 1988 by Sun Microsystems, Inc. */#include <stdio.h>#include "install.h"extern	char *sprintf();intscsi_tapetype(tape_device)	register char *tape_device;{	register int bs, fd;	struct mtget tape;	char device[24];	(void) sprintf(device,"/dev/nr%s",tape_device);	if ((fd = open(device,O_RDONLY)) == -1)		return (BS_DEFAULT);	/* ask the tape device what type they are;	 * set the block size accordingly	 * else use default block size	 */	if (ioctl(fd, MTIOCGET, &tape) == 0) {		bs = tape.mt_bf;	} else		bs = BS_DEFAULT;	(void) close(fd);	return (bs);}

⌨️ 快捷键说明

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