From 57d2facb7875b02b0b4d0bd1b5104ba14e1d378c Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Mon, 10 May 2021 19:55:32 +0200 Subject: [PATCH] modify_ldt.2: Use syscall(SYS_...); for system calls without a wrapper Signed-off-by: Alejandro Colomar Signed-off-by: Michael Kerrisk --- man2/modify_ldt.2 | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/man2/modify_ldt.2 b/man2/modify_ldt.2 index 8ce9ed252..b67a67690 100644 --- a/man2/modify_ldt.2 +++ b/man2/modify_ldt.2 @@ -27,11 +27,19 @@ modify_ldt \- get or set a per-process LDT entry .SH SYNOPSIS .nf -.BI "int modify_ldt(int " func ", void *" ptr ", unsigned long " bytecount ); +.BR "#include " " /* Definition of " "struct user_desc" " */" +.BR "#include " " /* Definition of " SYS_* " constants */" +.B #include +.PP +.BI "int syscall(SYS_modify_ldt, int " func ", void *" ptr , +.BI " unsigned long " bytecount ); .fi .PP .IR Note : -There is no glibc wrapper for this system call; see NOTES. +glibc provides no wrapper for +.BR modify_ldt (), +necessitating the use of +.BR syscall (2). .SH DESCRIPTION .BR modify_ldt () reads or writes the local descriptor table (LDT) for a process. @@ -168,9 +176,6 @@ is neither 0, 1, 2, nor 0x11. This call is Linux-specific and should not be used in programs intended to be portable. .SH NOTES -Glibc does not provide a wrapper for this system call; call it using -.BR syscall (2). -.PP .BR modify_ldt () should not be used for thread-local storage, as it slows down context switches and only supports a limited number of threads.