home *** CD-ROM | disk | FTP | other *** search
- #ifdef MSDOS
- #include <dos.h>
-
- binmode(fd)
- int fd;
- {
- union REGS inregs, outregs;
-
- /*
- ** get the current mode
- */
- inregs.h.ah = 0x44; /* ioctl */
- inregs.h.al = 0x00; /* get */
- inregs.x.bx = fd; /* unit */
- intdos(&inregs, &outregs);
-
- /*
- ** set to BINARY mode (this works for char devices)
- */
- inregs.h.ah = 0x44; /* ioctl */
- inregs.h.al = 0x01; /* set */
- inregs.x.bx = fd; /* unit */
- inregs.h.dh = 0;
- inregs.h.dl = outregs.h.dl | 0x20;
- intdos(&inregs, &outregs);
- }
- #endif
-