X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: "Rod Pemberton" Newsgroups: comp.os.msdos.djgpp Subject: Re: Documentation error Date: Mon, 23 Mar 2009 07:24:11 -0400 Organization: Aioe.org NNTP Server Lines: 38 Message-ID: References: NNTP-Posting-Host: pldq+kT97bAAp/ObDwnZyQ.user.aioe.org X-Complaints-To: abuse AT aioe DOT org NNTP-Posting-Date: Mon, 23 Mar 2009 11:21:09 +0000 (UTC) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1933 X-Notice: Filtered by postfilter v. 0.7.7 X-Newsreader: Microsoft Outlook Express 6.00.2800.1933 Cancel-Lock: sha1:HgJ5BFANlszTbRmgtYMLyaT497A= X-Priority: 3 X-MSMail-Priority: Normal To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com "Jim Michaels" wrote in message news:ca683ba1-e029-4556-ae77-37e6cb3f5658 AT p6g2000pre DOT googlegroups DOT com... > but [setdisk] is not returning the correct drive number. Since it's just a wrapper around Int 0x21, AH=0Eh, I'd say it's returning the correct values for the DOS function used. > [setdisk] does a whammy on you and returns a 1-based drive > number instead of the zero-based number it took. This is not the > documentation given in djgpp. In libc.info under setdisk()'s "Return Value": "The highest drive actually present that the system can reference." AFAICT, the DJGPP documentation doesn't say anything about a either a zero or a one based drive number being returned... As you mentioned, it'd be nice to know the return value is one based, but I think the documentation could use even more clarification. The quoted statement above from DJGPP's libc.info document isn't correct in the least. According to the Int 0x21, AH=0Eh RBIL information (link below), LASTDRIVE= could set a drive number that is larger than the "highest drive actually present". E.g., LASTDRIVE=Z which should return 26, but only A through F are present in someone's system. Or, if only a few drives are present, it might return five (5) which is also larger than the number of drives present. http://www.delorie.com/djgpp/doc/rbinter/id/81/25.html Also, I think one could make a case for DJGPP that setdisk() should return the drive number that was set by setdisk(), or an error if the drive isn't present. Rod Pemberton