]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
membarrier.2: Use syscall(SYS_...); for system calls without a wrapper
authorAlejandro Colomar <alx.manpages@gmail.com>
Mon, 10 May 2021 17:55:28 +0000 (19:55 +0200)
committerMichael Kerrisk <mtk.manpages@gmail.com>
Tue, 11 May 2021 05:18:08 +0000 (17:18 +1200)
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
man2/membarrier.2

index 851f5d59f1211ce12395950e121dba8e6aa013b5..fec82f22840b1951fac12def5bde45790bbd0c69 100644 (file)
@@ -28,13 +28,20 @@ membarrier \- issue memory barriers on a set of threads
 .SH SYNOPSIS
 .nf
 .PP
-.B #include <linux/membarrier.h>
+.BR "#include <linux/membarrier.h>" \
+" /* Definition of " MEMBARRIER_* " constants */"
+.BR "#include <sys/syscall.h>" "      /* Definition of " SYS_* " constants */"
+.B #include <unistd.h>
 .PP
-.BI "int membarrier(int " cmd ", unsigned int " flags ", int " cpu_id );
+.BI "int syscall(SYS_membarrier, int " cmd ", unsigned int " flags \
+", int " cpu_id );
 .fi
 .PP
 .IR Note :
-There is no glibc wrapper for this system call; see NOTES.
+glibc provides no wrapper for
+.BR membarrier (),
+necessitating the use of
+.BR syscall (2).
 .SH DESCRIPTION
 The
 .BR membarrier ()
@@ -322,9 +329,6 @@ Examples where
 .BR membarrier ()
 can be useful include implementations
 of Read-Copy-Update libraries and garbage collectors.
-.PP
-Glibc does not provide a wrapper for this system call; call it using
-.BR syscall (2).
 .SH EXAMPLES
 Assuming a multithreaded application where "fast_path()" is executed
 very frequently, and where "slow_path()" is executed infrequently, the