DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 51FGTlSc2094409
Authentication-Results: delorie.com; dmarc=pass (p=none dis=none) header.from=cygwin.com
Authentication-Results: delorie.com; spf=pass smtp.mailfrom=cygwin.com
DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 51FGTlSc2094409
Authentication-Results: delorie.com;
	dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=Q1XUsMwD
X-Recipient: archive-cygwin@delorie.com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A20733858420
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
	s=default; t=1739636985;
	bh=0ALtprgzvNkmKZ4g/WbZjeQG/MVEyFbusWsYtZOSB2Q=;
	h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe:
	 List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:
	 From;
	b=Q1XUsMwDXXB2/mg++K9RZLpqJZaLfMJS0MLjkvEw4U8BSbXv4Y9qE/Sods4bR+/MS
	 hM0C8j+FD+25IszVHjMG2ro1LRht5YlDyjmELl30Wqlwkbfh3AY3BLSTYYQz53ZqQW
	 Rn2pccKVvzzXEiTXCqypRdjyGRZIev6fPcQtH+vw=
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4F2623858C42
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 4F2623858C42
ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1739636914; cv=none;
 b=I/MR9VoCY3ZT0XdumMzHM5BodKzw7YusQt/9ifIxYVpsTVPRfPqDAUjM2RO/SPQaM5tgIDN+xA49IXbdDMfuWsqExdW+u8lACERD4zuFaAxK1q7KqEajSs2S57t+aC68tbjIWhQVr7BQiqUSVx0JIwvrvHpDMJ5ZAd6/q/pFVGo=
ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
 t=1739636914; c=relaxed/simple;
 bh=OHo1K5jRrI6ti4+eQJ7mRRpMiv0l2AorP3tRJr0pKws=;
 h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From;
 b=OvFCbXp18EcFX7W4jjrlBlH/8nR7IzfFco+hm1/IS50BZpuOH4ochpeEDPpVkgvYYswwtRDXuFFb/BefFWedQJ5uY617KuL8VmwVpDEpPlQKlGKZkdTOxnSrHhiTjD5ytUunyXcPhUpOFcMZXByFABKjE9FbS6MHXsvJTEzvcPM=
ARC-Authentication-Results: i=1; server2.sourceware.org
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4F2623858C42
Message-ID: <54763b8c-ae4f-4616-85e4-f93edd9513d5@hamachi.org>
Date: Sat, 15 Feb 2025 08:28:30 -0800
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [developer] Re: SEEK_DATA should fail at EOF
To: developer@lists.illumos.org, Cedric Blancher <cedric.blancher@gmail.com>,
        cygwin@cygwin.com
References: <614771e9-592c-6154-d56d-13842b6fc6ac@t-online.de>
 <5ccdf4be-4e4b-1846-9fd6-cba29c9dbb11@t-online.de>
 <CALXu0UcYLMhnOtQ2emvoH7=EpjuxcZmqf8+B8xY8YU8dxk7_Og@mail.gmail.com>
Content-Language: en-US
In-Reply-To: <CALXu0UcYLMhnOtQ2emvoH7=EpjuxcZmqf8+B8xY8YU8dxk7_Og@mail.gmail.com>
X-BeenThere: cygwin@cygwin.com
X-Mailman-Version: 2.1.30
Precedence: list
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-request@cygwin.com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=subscribe>
From: Bill Sommerfeld via Cygwin <cygwin@cygwin.com>
Reply-To: Bill Sommerfeld <sommerfeld@hamachi.org>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Errors-To: cygwin-bounces~archive-cygwin=delorie.com@cygwin.com
Sender: "Cygwin" <cygwin-bounces~archive-cygwin=delorie.com@cygwin.com>

On 2/14/25 23:42, Cedric Blancher wrote:
> cc: illumos-dev@ list. How does Solaris or Illumos behave? SUN/Solaris
> invented SEEK_DATA/SEEK_HOLE, so this should be - aside from looking
> at the OpenGroup/POSIX specs - the reference implementation.

Thanks for asking.

On Illumos, SEEK_DATA fails with ENXIO at EOF, and more generally fails 
with ENXIO if there are no non-hole regions in the file after the passed 
offset -- a file may end in a hole, so you may also get ENXIO for 
offsets less than the file's length.

The lseek manpage says:

...
ERRORS
        The lseek() function will fail if:
...
        ENXIO
            For SEEK_DATA, there are no more data regions past the
            supplied offset.  For SEEK_HOLE, there are no more holes
            past the supplied offset.

						- Bill


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