X-Recipient: archive-cygwin@delorie.com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:to:from:subject:date:message-id:references
	:mime-version:content-type:content-transfer-encoding; q=dns; s=
	default; b=W52Y3gadbNvkrH2Kwi5STiiWCWpN1JNrABXDkOaRu0M7KAcuKBTlU
	pJ8GfgQj2CpqDfB+McP7uCdg0pdx/1Ai8nVeTgTVNXgkNDrHeMwNdwSKiK3y/zMI
	FjxZPrRwDeHYu2UdV8JdUy9YG2ZDwzi7ISdf48nomzp94Oz51H0Z60=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:to:from:subject:date:message-id:references
	:mime-version:content-type:content-transfer-encoding; s=default;
	 bh=8/40Q4q+gN50bm0NadoH4vqTttg=; b=TdXuq4mXH1tNNnetAY6X/xIUnDk4
	qDEhhXJjeL8OynxgO5PO6T+fI7RmTQRzCvc41QQT0OWekHf0Y141ZnyqAEULGAsp
	LkLuWIWIEVANtVT4+BScBcIPTT9FJP/IcqC8XkgYDMnlDjHCrqFBAuJjCS/HTNsS
	U+jsAz/FmGW1jTI=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2
X-HELO: plane.gmane.org
To: cygwin@cygwin.com
From: Roy <roytam@gmail.com>
Subject: Re: open(O_RDWR) and lseek() fail
Date: Fri, 28 Mar 2014 13:48:00 +0800
Lines: 26
Message-ID: <op.xde3qaa3dyj81a@monster.itedn32a.localdomain>
References: <op.xderrfffdyj81a@monster.itedn32a.localdomain> <5334EF41.50809@redhat.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes
Content-Transfer-Encoding: 7bit
User-Agent: Opera Mail/11.64 (Win32)
X-IsSubscribed: yes

On Fri, 28 Mar 2014 11:40:49 +0800, Eric Blake <eblake@redhat.com> wrote:

> On 03/27/2014 07:29 PM, Roy wrote:
>> Hello list,
>>
>> I wonder why lseek(SEEK_CUR) on open(O_RDWR) fails with errno=22, the
>> code works on Linux:
>>
>> #include <stdio.h>
>> #include <errno.h>
>> #include <stdlib.h>
>> #include <fcntl.h>
>> int main(int argc, char** argv){
>
> Where's #include <unistd.h>?  It fails because you are missing the
> prototype for lseeks, which means that the C compiler is trying to call
> it with 'int offset' instead of 'off_t offset'.  Compile with -Wall.
>
>>
>> Whats wrong with cygwin?
>
> Rather, fix the bugs in your code, and let the compiler help you.
>

Got it, but why enforcing the use of off_t here?
I'm not going to use 64bit offsets.


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

