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

📄 scsi_block_size.c

📁 操作系统SunOS 4.1.3版本的源码
💻 C
字号:
#ifndef lint#ifdef SunB1#ident			"@(#)scsi_block_size.c 1.1 92/07/30 SMI; SunOS MLS";#else#ident			"@(#)scsi_block_size.c 1.1 92/07/30 SMI";#endif /* SunB1 */#endif lint/* * Copyright (c) 1988 by Sun Microsystems, Inc. */#include <stdio.h>#include <sys/types.h>#include <sys/mtio.h>#include <fcntl.h>#include <sys/ioctl.h>#include "install.h"#include "media.h"/*******************************************************************************	Function:	(int)	scsi_block_size()****	Description:	gets the block size for a scsi tape drive****      Return Value:   the block size for the tape drive*******************************************************************************/intscsi_block_size(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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -