delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2026/07/06/13:09:14

DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 666H9Dg02671483
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 666H9Dg02671483
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=EH88mI5E
X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 59CAB4BA2E35
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1783357751;
bh=NI/V0WwrZclpBIhmX5p68nMo2SaB+7cp99lx52h0TAw=;
h=Subject:To:Date:List-Id:List-Unsubscribe:List-Archive:List-Post:
List-Help:List-Subscribe:From:Reply-To:Cc:From;
b=EH88mI5E0O77DGsKqfHEYo8bvHyyfwpmeFcSZhM0xop5Kr3dfvW8aYmzfRii5LUc/
KNTGq4WnKMAAzydofir9pNl+oeIGXbebMcnKQnw072DzWlfBn1mUci0h8vwivWZMQ5
/SbYcYeBg+EGaIWfrbSc+sc3IKrUOS6JTd4bicGk=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org F077A4BA5435
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org F077A4BA5435
ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1783357704; cv=none;
b=D5zF17zSrFjb0qR9MSY0wM05ia7Qed97P+Wk4XLqVyolI7V6zIjSaNn8e7Ef7o5iBbhBKQ5W/AC73sSr70BgJ8gAsnqAoUzi+4w8iZBHO8YpO0JoctfX+VET3MVY2jizYubqc2Ovyyd4bk5Z4Nn8Ysr8bXQZAy850yHAWx1FcIU=
ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
t=1783357704; c=relaxed/simple;
bh=UiLGlQP59A4uWrescAvOxr23jWy2zXd2DXgkrPDh7Gk=;
h=From:Subject:To:Message-ID:Date:MIME-Version:DKIM-Signature;
b=vNxOKUJBYUXsAWUw5zWD0cKZNIfk0EL+EG/+tQ2VypUgVU93n+j09R2lOtl7wYW3iaUDkElgxcCbr9vYOQ43bdO8E41oxzs+YFh/UqBfPUZT4uH0McOnTTYOT99Z6wDw17x6FgxUmA4lFT2AUhjtd9A2yCI2XCrp/0x4GjrTKkY=
ARC-Authentication-Results: i=1; sourceware.org;
dkim=pass (2048-bit key, unprotected)
header.d=t-online.de header.i=Christian DOT Franke AT t-online DOT de
header.a=rsa-sha256 header.s=20260216 header.b=Bv211K/W
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F077A4BA5435
Subject: Cygwin madvise(): aliased to posix_madvise() but the error handling
should differ
To: cygwin AT cygwin DOT com
Message-ID: <b5ae95b5-9510-bc9a-8e45-5f1311c22285@t-online.de>
Date: Mon, 6 Jul 2026 19:08:16 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:128.0) Gecko/20100101
SeaMonkey/2.53.23
MIME-Version: 1.0
X-TOI-EXPURGATEID: 150726::1783357696-24FF6830-DC6BA716/0/0 CLEAN NORMAL
X-TOI-MSGID: 0edc6719-75d8-4ffa-9751-d33adc8eeb18
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-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: Christian Franke via Cygwin <cygwin AT cygwin DOT com>
Reply-To: cygwin AT cygwin DOT com
Cc: Christian Franke <Christian DOT Franke AT t-online DOT de>
Sender: "Cygwin" <cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com>

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.

-- 
Regards,
Christian


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