Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260824121343.GO23438@brightrain.aerifal.cx>
Date: Mon, 24 Aug 2026 08:13:43 -0400
From: Rich Felker <dalias@...c.org>
To: Skye Soss <skye@...s.website>
Cc: musl <musl@...ts.openwall.com>
Subject: Re: [PATCH] add linux-specific close_range syscall wrapper

On Sun, Aug 23, 2026 at 10:10:39PM -0500, Skye Soss wrote:
> This patch adds the close_range syscall wrapper.
> 
> The syscall was added in Linux 5.9.
> 
> There was prior discussion more than 4 years ago on this addition. This patch
> is slightly modified to put the CLOSE_RANGE_UNSHARE macro definition inside
> the _GNU_SOURCE section, as FreeBSD defines *_CLOEXEC but not *_UNSHARE.
> 
> The Linux syscall accepts the flags parameter as unsigned, but glibc's wrapper
> uses a signed integer. The cast makes that reinterpretation explicit, but is
> not strictly necessary.

The cast does cause any sign extension from bit 31, if it were ever
used, not to extend up past bit 31 into high bits on a 64-bit arch.
This is probably good.

Rich

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.