diff options
author | mjacob <mjacob@FreeBSD.org> | 1998-12-18 02:02:20 +0000 |
---|---|---|
committer | mjacob <mjacob@FreeBSD.org> | 1998-12-18 02:02:20 +0000 |
commit | 9007253495a3aa2a2dd2ddca81ff62b73c2dfe44 (patch) | |
tree | 6fde4252e0ee6ba5a58187469d64e3469687c899 /usr.bin | |
parent | 28aeb66d7eefd6bf857ec14d415e7e957f8d52d3 (diff) | |
download | FreeBSD-src-9007253495a3aa2a2dd2ddca81ff62b73c2dfe44.zip FreeBSD-src-9007253495a3aa2a2dd2ddca81ff62b73c2dfe44.tar.gz |
1) Clarify that a weof count of zero is allowed (flush buffers).
2) Add in the set of {sethpos,setspos,rdhpos,rdspos) commands to implement the
Hardware && SCSI Logical Block position ioctls.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/mt/mt.c | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/usr.bin/mt/mt.c b/usr.bin/mt/mt.c index 230ab1c..9d7e79c 100644 --- a/usr.bin/mt/mt.c +++ b/usr.bin/mt/mt.c @@ -42,7 +42,7 @@ static const char copyright[] = static char sccsid[] = "@(#)mt.c 8.2 (Berkeley) 5/4/95"; #endif static const char rcsid[] = - "$Id: mt.c,v 1.15 1998/09/15 10:28:20 gibbs Exp $"; + "$Id: mt.c,v 1.16 1998/10/03 10:58:54 dfr Exp $"; #endif /* not lint */ /* @@ -101,7 +101,11 @@ struct commands { { "rewind", MTREW, 1 }, { "rewoffl", MTOFFL, 1 }, { "status", MTNOP, 1 }, +#if defined(__FreeBSD__) + { "weof", MTWEOF, 0, ZERO_ALLOWED }, +#else { "weof", MTWEOF, 0 }, +#endif #if defined(__FreeBSD__) { "erase", MTERASE, 0, ZERO_ALLOWED}, { "blocksize", MTSETBSIZ, 0, NEED_2ARGS|ZERO_ALLOWED }, @@ -110,6 +114,10 @@ struct commands { { "eod", MTEOD, 1 }, { "comp", MTCOMP, 0, NEED_2ARGS|ZERO_ALLOWED|IS_COMP }, { "retension", MTRETENS, 1 }, + { "rdhpos", MTIOCRDHPOS, 0 }, + { "rdspos", MTIOCRDSPOS, 0 }, + { "sethpos", MTIOCHLOCATE, 0, NEED_2ARGS|ZERO_ALLOWED }, + { "setspos", MTIOCSLOCATE, 0, NEED_2ARGS|ZERO_ALLOWED }, #endif /* defined(__FreeBSD__) */ { NULL } }; @@ -215,6 +223,27 @@ main(argc, argv) } else mt_com.mt_count = 1; +#if defined(__FreeBSD__) + switch (comp->c_code) { + case MTIOCRDHPOS: + case MTIOCRDSPOS: + if (ioctl(mtfd, comp->c_code, &mt_com.mt_count) < 0) + err(2, "%s", tape); + printf("%s: %s block location %u\n", tape, + (comp->c_code == MTIOCRDHPOS)? "hardware" : + "logical", (unsigned int) mt_com.mt_count); + exit (0); + /* NOTREACHED */ + case MTIOCSLOCATE: + case MTIOCHLOCATE: + if (ioctl(mtfd, comp->c_code, &mt_com.mt_count) < 0) + err(2, "%s", tape); + exit (0); + /* NOTREACHED */ + default: + break; + } +#endif if (ioctl(mtfd, MTIOCTOP, &mt_com) < 0) err(1, "%s: %s", tape, comp->c_name); } else { |