Skip to content

Commit

Permalink
um: Do not rely on libc to provide modify_ldt()
Browse files Browse the repository at this point in the history
modify_ldt() was declared as an external symbol. Despite the man
page for this syscall telling that there is no wrapper in glibc,
since version 2.1 there actually is, so linking to the glibc
works.

Since modify_ldt() is not a POSIX interface, other libc
implementations do not always provide a wrapper function.
Even glibc headers do not provide a corresponding declaration.

So go the recommended way to call this using syscall().

Signed-off-by: Hans-Werner Hilse <hwhilse@gmail.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
  • Loading branch information
Hans-Werner Hilse authored and Richard Weinberger committed Oct 19, 2015
1 parent 0b5aedf commit 37e81a0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion arch/x86/um/ldt.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
#include <skas.h>
#include <sysdep/tls.h>

extern int modify_ldt(int func, void *ptr, unsigned long bytecount);
static inline int modify_ldt (int func, void *ptr, unsigned long bytecount)
{
return syscall(__NR_modify_ldt, func, ptr, bytecount);
}

static long write_ldt_entry(struct mm_id *mm_idp, int func,
struct user_desc *desc, void **addr, int done)
Expand Down

0 comments on commit 37e81a0

Please sign in to comment.