<sys/membarrier.h>
Adhemerval Zanella Netto
adhemerval.zanella@linaro.org
Thu Jul 9 18:23:57 GMT 2026
On 09/07/26 14:09, enh wrote:
> fyi, it looks like musl added a <sys/membarrier.h>. membarrier() has
> seen quite a lot of use in android (via syscall() so far) so i'm
> thinking we'll add <sys/membarrier.h> to bionic. i'm assuming glibc
> has no immediate plans to add it somewhere else like <sys/mman.h> or
> whatever?
We don't have any RFE for this addition, but it should not be a blocker
either. It seems that musl has used the old Linux 5.10 prototype,
membarrier (int, int), where newer kernel now defined it with 3
argument.
I think it should avoid use varargs, this has bitten us in the past; so
I would suggest to either mimic the kernel interface with 3 arguments,
or at least return EINVAL when MEMBARRIER_CMD_FLAG_CPU is used (if the
idea is t keep some compatibility with musl).
Which kind of interface do you plan to use on Android? I don't have a
strong preference either to which header to use, sys/membarrier.h works
as well.
More information about the Libc-alpha
mailing list