X-Recipient: archive-cygwin AT delorie DOT 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 AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT 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 AT cygwin DOT com From: Roy Subject: Re: open(O_RDWR) and lseek() fail Date: Fri, 28 Mar 2014 13:48:00 +0800 Lines: 26 Message-ID: References: <5334EF41 DOT 50809 AT redhat DOT 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 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 >> #include >> #include >> #include >> int main(int argc, char** argv){ > > Where's #include ? 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