delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/04/20/20:18:54

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Tue, 20 Apr 2004 17:18:33 -0700
From: Yitzchak Scott-Thoennes <sthoenna AT efn DOT org>
To: cygwin AT cygwin DOT com
Subject: lseek returning 2**32-1 on error instead of -1
Message-ID: <20040421001833.GA3836@efn.org>
Mime-Version: 1.0
User-Agent: Mutt/1.4.1i
Organization: bs"d
X-IsSubscribed: yes

Using the latest snapshot 20040420 (though I think it may have been
this way since at least 1.5.2):

$ cat lseeker.c
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>

int main(int argc, char **argv) {
   off_t offset = -1, result;

   printf ("offsets are size %d.\n", sizeof (off_t));
   printf ("offsets are %s.\n", ( offset < 0 ? "signed" : "unsigned" ));
   printf ("seeking to offset %lld.\n", offset);

   errno = 0;
   result = lseek (fileno (stdin), offset, SEEK_CUR);
   printf ("got %lld (%s).\n", result, strerror (errno));
   return 0;
}

$ gcc -Wall lseeker.c; ./a.exe<lseeker.c
offsets are size 8.
offsets are signed.
seeking to offset -1.
got 4294967295 (Invalid argument).

I believe this to be the cause of perl's op/sysio.t test 39 failing.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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