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:message-id:date:from:mime-version:to:subject
	:references:in-reply-to:content-type; q=dns; s=default; b=Mo3A4Z
	wPQN0WPT6xHuBwUO25UCqJ+fr+xbVijU4IiHpN58RFBfJ7RNGDAltr3TmqbiqAGd
	PDwk1njUYqnrCNBmznaUCRSKjsPrqdugArUFRwoqalK+SaBC4lPE2gjhvspMNLwM
	7ZL3K6NqTtstEqQxZelOvq5ja1Q1yUq6uPgIE=
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:message-id:date:from:mime-version:to:subject
	:references:in-reply-to:content-type; s=default; bh=4F2pXVu8Vu0T
	I3MYeak2UdevOEU=; b=Ykj2lXW3v4VON8z5IuzNG6LwtDOyQQ/R/yEI/frBHmAg
	WAppFzgb08gAtqGveVcqQaSRruWUz93AY41Wb9gOIrJZhMnKxy6Gtyxws24V3oSf
	czeDdNpc6ZAQUFXjl2VtUKDuw3vOX89Xe9tsiZtkiKOXHgU7MNS+CKD0dUIp/8s=
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,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2
X-HELO: mx1.redhat.com
Message-ID: <5334EF41.50809@redhat.com>
Date: Thu, 27 Mar 2014 21:40:49 -0600
From: Eric Blake <eblake@redhat.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: open(O_RDWR) and lseek() fail
References: <op.xderrfffdyj81a@monster.itedn32a.localdomain>
In-Reply-To: <op.xderrfffdyj81a@monster.itedn32a.localdomain>
OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg
Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="rK75671h3wvVnN1WAG7JdEjMQpj6XoHis"
X-IsSubscribed: yes

--rK75671h3wvVnN1WAG7JdEjMQpj6XoHis
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On 03/27/2014 07:29 PM, Roy wrote:
> Hello list,
>=20
> I wonder why lseek(SEEK_CUR) on open(O_RDWR) fails with errno=3D22, the
> code works on Linux:
>=20
> #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.

>=20
> Whats wrong with cygwin?

Rather, fix the bugs in your code, and let the compiler help you.

--=20
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


--rK75671h3wvVnN1WAG7JdEjMQpj6XoHis
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: Public key at http://people.redhat.com/eblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBCAAGBQJTNO9BAAoJEKeha0olJ0NqRnAIAJz6aUIHR+iKSrGmLJlGwN2c
eXisS454Yh03BMPTZ/w3IvhbrgTlBo3TMyKxHZ3WdxR1v/kU0HrYKBgNKnI7Ts85
rIeqK83uEb/V2Fdy+WAqU5a4IiM18YHAO7FSo1hoMUfuarb/uXWbXbKOdvUADLBb
1UQpaLZz7L0OA+17BZ2n06jl1Ro0N4m2lPpGq7EQbAtjxe0Xn5BBgxyyEitiOHko
VwyRDNjQUaSvKTZklYc0Mzw5moPBnqc2LgwFZe/g6ugkqF0q0qQUKzNllfZoIG47
kUE772zn+nTeCdf7hqED1yKnabwyEOxPWwZ5mkTS2Cik/OA0ZJwZ8obexCC/uIQ=
=MjbH
-----END PGP SIGNATURE-----

--rK75671h3wvVnN1WAG7JdEjMQpj6XoHis--
