This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: lseek() fails to seek on /dev/fd0 ('\\.\A:')


Hi!

Monday, 26 February, 2001 Earnie Boyd earnie_boyd@yahoo.com wrote:

>> Anyway,  if  we  decide to be linux- and solaris- compatible here, the
>> patch would be trivial.
>> 

EB> I thought the decision to be as Linux compatible as possible had already
EB> been determined.  I suggest that someone submit the trivial patch.

unfortunately,  i  haven't  any  linux  boxes  with floppies around to
check,  so  could  somebody    run    this   program on linux  with or
without  media  in  drive  and  (if  possible) with media of different
sizes,  i.e.  1.44M  and 720K floppies, and report what it prints when
run as './floppy 0' or './floppy 1000' or './floppy 1024' ?

#include <stdio.h>
#include <fcntl.h>
#include <errno.h>

int main (int argc, char** argv)
{
  off_t rv;
  off_t offset = ( argc > 1 ? atoi (argv[1]) : 0 );
  int fd = open ( "/dev/fd0", O_RDONLY );
  if ( fd >= 0 )
    {
      rv = lseek ( fd, offset, SEEK_END );
      printf ( "offset = %ld; filepos = %ld\n", offset, rv );
      if ( rv < 0 ) perror ( "lseek" );
    }
  else perror ( "open" );
}

Egor.            mailto:deo@logos-m.ru ICQ 5165414 FidoNet 2:5020/496.19



--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]