Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!ames!amdahl!bnrmtv!connery From: connery@bnrmtv.UUCP Newsgroups: comp.sys.ibm.pc Subject: Re: ioctl on msdos device drivers Message-ID: <1620@bnrmtv.UUCP> Date: Sun, 12-Apr-87 16:57:12 EST Article-I.D.: bnrmtv.1620 Posted: Sun Apr 12 16:57:12 1987 Date-Received: Tue, 14-Apr-87 00:57:03 EST References: <959@rocksvax.UUCP> <4490002@hpcvck.HP> Organization: Bell Northern Research, Mtn. View, CA Lines: 35 > I would also be interested in what people have to say about > setting ioctl for devices like printers. I have been trying > to write a graphics dump routine for my MSDOS computer (not IBM > compatible), and was having trouble. I was opening the printer > as a binary device, but MSDOS was *not* treating like a binary > device/file. If I wrote the info to a file first, then did > COPY PRN: /B, it printed the info fine. > void SetRaw(fd) int fd; { union REGS r; r.h.ah = 0x44; r.x.bx = fd; r.h.al = 0; intdos(&r, &r); if (r.x.dx & 0x80) { r.h.ah = 0x44; r.x.bx = fd; r.h.al = 1; r.x.dx |= 0x20; r.x.dx &= 0xFF; intdos(&r, &r); } } Basically, this just sets raw if the handle passed is a device, and sets raw mode if it is. Works fine on network devices too. -- Glenn Connery, Bell Northern Research, Mountain View, CA {hplabs,amdahl,3comvax}!bnrmtv!connery