delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/02/26/09:54:11

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Date: Mon, 26 Feb 2001 17:49:17 +0300
From: Egor Duda <deo AT logos-m DOT ru>
X-Mailer: The Bat! (v1.45) Personal
Reply-To: Egor Duda <cygwin AT cygwin DOT com>
Organization: DEO
X-Priority: 3 (Normal)
Message-ID: <8019743569.20010226174917@logos-m.ru>
To: Earnie Boyd <earnie_boyd AT yahoo DOT com>
CC: cygwin AT cygwin DOT com, Jesper Eskilson <jojo AT virtutech DOT se>
Subject: Re: lseek() fails to seek on /dev/fd0 ('\\.\A:')
In-reply-To: <3A9A621F.7661F240@yahoo.com>
References: <u67ae79bw6v DOT fsf AT rachel DOT hq DOT vtech> <u671ysl8xda DOT fsf AT rachel DOT hq DOT vtech>
<613331659 DOT 20010226160225 AT logos-m DOT ru> <3A9A621F DOT 7661F240 AT yahoo DOT com>
Mime-Version: 1.0

Hi!

Monday, 26 February, 2001 Earnie Boyd earnie_boyd AT yahoo DOT 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 AT logos-m DOT ru ICQ 5165414 FidoNet 2:5020/496.19



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

- Raw text -


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