[comp.bugs.4bsd] mt reports absurd error message when pointed at a tty

roy@phri.UUCP (Roy Smith) (11/12/86)

Index:	bin/mt.c 4.2BSD

Description:
	Mt calls perror to print error messages.  Since mt uses ioctls to
	do its magic, one of the diagnostics you can draw is "not a
	typewriter".  This is not useful most of the time, and can even
	be absurd.  The basic problem is that "character device" and "tty"
	are concepts which are more closely related then they should be.

Repeat-By:
	Run "mt -f /dev/tty stat".  You will draw the error message "not a
	typewriter", which is a patently absurd thing to say about /dev/tty.
	The same thing happens on Sun 3.0.  Granted, this is a bit of a
	silly thing to do, but it should still give some useful error message.
-- 
Roy Smith, {allegra,cmcl2,philabs}!phri!roy
System Administrator, Public Health Research Institute
455 First Avenue, New York, NY 10016

"you can't spell deoxyribonucleic without unix!"

guy@sun.uucp (Guy Harris) (12/01/86)

> Repeat-By:
> 	Run "mt -f /dev/tty stat".  You will draw the error message "not a
> 	typewriter", which is a patently absurd thing to say about /dev/tty.
> 	The same thing happens on Sun 3.0.

"Fixed in 4.3" (and SunOS 3.2).  It now says "Inappropriate ioctl for
device".  One more piece of UNIX tradition bites the dust....  (S5 returns
EINVAL in this case, and only returns ENOTTY if the object that the "ioctl"
is being performed on is not a character special file.  A case can be made
that this is the right thing to do, although 4.3BSD supports some "ioctl"s
that can be made on files other than character special files, as well as
supporting "ioctl"s on sockets.)
-- 
	Guy Harris
	{ihnp4, decvax, seismo, decwrl, ...}!sun!guy
	guy@sun.com (or guy@sun.arpa)