delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2026/07/06/18:45:02

DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 666Mj2OR2739004
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 666Mj2OR2739004
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=Z8zsSpc7
X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F0E294BA2E1C
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1783377900;
bh=p1s4lPp4hiFHhFfC7HFBtvZfo+PthokM3OcyZIfCwHw=;
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=Z8zsSpc78FGIzxEMvwxajUvZHnmr0T1FFOm7YbrcbjXpaDvUqxHEdUhzI8f1tD2Ee
Gv762qtukCg/LcHZB+MYlGI4HKK4Oapz0FU/3XjnbuS0HOsZoZ43pQz1DQzqBHberF
yMzpv4EMhwRuIdeU9s/YnYhtDxzNH0Kj/bHCV0gw=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B3BE94BA2E0B
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B3BE94BA2E0B
ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1783377879; cv=none;
b=cEgPwpFdKns8CrGppOJHVKBPJI2LeMgrivz8Uhi07gL36UOTOESnGj8yaAROWr0lSoJoLGlBgHW8ju2ueyyzvoZGgaGTjHu50xTvNJcCWLNTgv73DNvc9bpg9vAteeN4ZO7ym1QWiZONNqHNajif5rDne8rqbh0vpqBRzQ0nv88=
ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
t=1783377879; c=relaxed/simple;
bh=a3vmamCoaOuQxwjYjqaS205mz5QFyuxlxNUWpNFUwQU=;
h=Message-ID:Date:MIME-Version:Subject:To:From;
b=bIFo4W4XSsZBGPUyir+9CX5MXV90aM76T4Qp3mPU03AefZlCfvaPQfxbPaXA2oCKjiFLueYLC7AJ+waiTlQAeINjl5TJt41Uzy6uH1Mi5+iNkVTPPDXjGHYc0b3HRNm+w1EveD94Y4tj0eIN820rHs1uvIN7CrVWKkoT/EVyieU=
ARC-Authentication-Results: i=1; sourceware.org
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B3BE94BA2E0B
Message-ID: <5bc526ae-83fe-4675-abc9-70153cc4b9ea@maxrnd.com>
Date: Mon, 6 Jul 2026 15:44:35 -0700
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: Cygwin madvise(): aliased to posix_madvise() but the error
handling should differ
To: cygwin AT cygwin DOT com
References: <b5ae95b5-9510-bc9a-8e45-5f1311c22285 AT t-online DOT de>
In-Reply-To: <b5ae95b5-9510-bc9a-8e45-5f1311c22285@t-online.de>
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.30
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Mark Geisert via Cygwin <cygwin AT cygwin DOT com>
Reply-To: Mark Geisert <mark AT maxrnd DOT com>
Errors-To: cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com>

Hi Christian,

On 7/6/2026 10:08 AM, Christian Franke via Cygwin wrote:
> Currently madvise() appears only as an alias in cygwin.din:
> 
> madvise = posix_madvise SIGFE
> 
> But according to the man pages, the error handling should differ:
> 
> https://man7.org/linux/man-pages/man2/madvise.2.html:
> "On error, it returns -1 and errno is set to indicate the error."
> 
> https://man7.org/linux/man-pages/man3/posix_madvise.3.html
> "On failure, it returns a positive error number."
> 
> https://pubs.opengroup.org/onlinepubs/009695399/functions/ 
> posix_madvise.html
> https://pubs.opengroup.org/onlinepubs/9799919799/functions/ 
> posix_madvise.html
> "... otherwise, an error number shall be returned to indicate the error."
> 
> The POSIX variant implies that 'errno' is left unchanged.
> 
> On Cygwin, only posix_madvise() works as documented.
> On Linux, both functions work as documented.

Thanks for the report and diagnosis.  I'll submit a patch shortly.

..mark

-- 
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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2026   by DJ Delorie     Updated Sep 20 2026