[PATCH v2] io: Refactor close_range and closefrom

Adhemerval Zanella adhemerval.zanella@linaro.org
Wed Nov 24 12:43:30 GMT 2021



On 24/11/2021 09:20, Adhemerval Zanella wrote:
> 
> 
> On 24/11/2021 09:03, Florian Weimer wrote:
>> * Adhemerval Zanella:
>>
>>>> diff --git a/sysdeps/mach/hurd/kernel-features.h b/sysdeps/mach/hurd/kernel-features.h
>>>> index 7d4eaee0a6..5fd37a6d7b 100644
>>>> --- a/sysdeps/mach/hurd/kernel-features.h
>>>> +++ b/sysdeps/mach/hurd/kernel-features.h
>>>> @@ -19,3 +19,5 @@
>>>>  /* This file can define __ASSUME_* macros checked by certain source files.
>>>>     Almost none of these are used outside of sysdeps/unix/sysv/linux code.
>>>>     But those referring to POSIX-level features like O_* flags can be.  */
>>>> +
>>>> +#define __ASSUME_CLOSE_RANGE 1
>>>
>>> It does add it here (I also checked with a build for i688-gnu).
>>
>> Hmm, this doesn't match existing practice.  We haven't unified
>> implementations in light of such divergence, I think.  If the Hurd
>> developers don't object, it should be fine, though..
> 
> This was used before, we still have some leftovers from it:
> 
> nscd/nscd.c:306:# ifndef __ASSUME_IN_NONBLOCK

On a side note, I think we can just remove it since it is only used
with inotify_init1 (which is only supported on Linux and currently
on all minimum supported kernel).

> resolv/res_send.c:1035:#ifndef __ASSUME_SENDMMSG
> resolv/res_send.c:1081:#ifndef __ASSUME_SENDMMSG
> resolv/res_send.c:1100:#ifndef __ASSUME_SENDMMSG

And we might remove it by implementing sendmmsg/recvmmsg on top of
sendmsg/recvmsg on generic implementations.

> 
> You have also cleanup some other assumes from Hurd: dup3 (b48061e1a534a242),
> O_CLOEXEC (cef9b65376a04430), and accept4 (e92030239abb4038).
> 


More information about the Libc-alpha mailing list