www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/02/02/10:06:45

From: "A.Appleyard" <A DOT APPLEYARD AT fs2 DOT mt DOT umist DOT ac DOT uk>
To: DJGPP AT sun DOT soe DOT clarkson DOT edu
Date: Fri, 2 Feb 1996 08:35:00 GMT
Subject: info re drives : getmntent()

struct mntent * getmntent(FILE *filep) {
  if (drive_number == -1) return NULL;
  if (filep != (FILE *)1) {
      errno = EBADF;    /* fake errno for invalid handle */ return NULL; }
...
      /* Work around a possible bug in QDPMI: _truename() would sometimes
         crash the calling program when there is no disk in a (floppy)
         drive.  To avoid this, we have to check if the drive is empty
         with a BIOS call.  */
      if (drive_number <= 2) {      <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
...
          while (++count < 10 && (bios_status =
                 biosdisk(2, drive_number - 1, 0, 0, 1, 1, buf)) == 6)
            biosdisk(0, drive_number - 1, 0, 0, 0, 0, NULL);
          /* If the loop ends with nonzero status, fail.  */
          if (bios_status != 0) continue; }
...

This assumes that there are never > 2 floppy drives. There sometimes are. I
heard of someone with 4 floppy drives A: B: C: D:, and his hard drive was E:

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019