delorie.com/archives/browse.cgi | search |
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: | <cygwin.cygwin.com> |
List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
List-Archive: | <http://sourceware.org/ml/cygwin/> |
List-Post: | <mailto:cygwin AT cygwin DOT com> |
List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/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 |
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 <roytam AT gmail DOT 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 DOT xderrfffdyj81a AT monster DOT itedn32a DOT localdomain> <5334EF41 DOT 50809 AT redhat DOT com> |
Mime-Version: | 1.0 |
User-Agent: | Opera Mail/11.64 (Win32) |
X-IsSubscribed: | yes |
On Fri, 28 Mar 2014 11:40:49 +0800, Eric Blake <eblake AT redhat DOT 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
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |