Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Fri, 17 Dec 2021 05:04:18 -0300
From: Érico Nogueira <ericonr@...root.org>
To: <musl@...ts.openwall.com>
Cc: 
Subject: Re: [PATCH] add SEEK_DATA and SEEK_HOLE to <unistd.h>

On Fri Dec 17, 2021 at 4:59 AM -03, Érico Nogueira wrote:
> these are linux specific constants. glibc exposes them behind
> _GNU_SOURCE, but, since SEEK_* is reserved for the implementation, we
> can simply define them. furthermore, since they can't be used with
> fseek() and other functions that deal with FILE, we don't add them to
> <stdio.h>.

Since we are now adding these flags to headers, it might make sense to
revisit [1], which I came across while looking for patches related to
SEEK_* constants.

If all we need is to restrict acceptable whence values, I can try to
make a patch.

[1] https://inbox.vuxu.org/musl/20191024140649.GO16318@brightrain.aerifal.cx/

> ---
> include/unistd.h | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/include/unistd.h b/include/unistd.h
> index ee2dbe8a..212263a7 100644
> --- a/include/unistd.h
> +++ b/include/unistd.h
> @@ -14,6 +14,8 @@ extern "C" {
> #define SEEK_SET 0
> #define SEEK_CUR 1
> #define SEEK_END 2
> +#define SEEK_DATA 3
> +#define SEEK_HOLE 4
>  
> #if __cplusplus >= 201103L
> #define NULL nullptr
> --
> 2.34.1

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.