Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Date: Tue, 20 Apr 2004 17:18:33 -0700
From: Yitzchak Scott-Thoennes <sthoenna@efn.org>
To: cygwin@cygwin.com
Subject: lseek returning 2**32-1 on error instead of -1
Message-ID: <20040421001833.GA3836@efn.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
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/

