All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans-Werner Hilse <hwhilse@gmail.com>
To: user-mode-linux-devel@lists.sourceforge.net
Subject: [uml-devel] [PATCH v2] um: Do not rely on libc to provide modify_ldt()
Date: Mon, 29 Jun 2015 11:50:32 +0200	[thread overview]
Message-ID: <1435571432-21125-2-git-send-email-hwhilse@gmail.com> (raw)
In-Reply-To: <1435571432-21125-1-git-send-email-hwhilse@gmail.com>

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>
---
 arch/x86/um/ldt.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/x86/um/ldt.c b/arch/x86/um/ldt.c
index 9701a4f..836a1eb 100644
--- a/arch/x86/um/ldt.c
+++ b/arch/x86/um/ldt.c
@@ -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)
-- 
2.4.3


------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors 
network devices and physical & virtual servers, alerts via email & sms 
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


  reply	other threads:[~2015-06-29  9:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-26  8:36 [uml-devel] [PATCH] missed musl compatibility patch Hans-Werner Hilse
2015-06-26  8:36 ` [uml-devel] [PATCH] um: Do not rely on libc to provide modify_ldt() Hans-Werner Hilse
2015-06-27 18:18 ` [uml-devel] [PATCH] missed musl compatibility patch Richard Weinberger
2015-06-29  7:15   ` Hans-Werner Hilse
2015-06-29  9:50     ` [uml-devel] [PATCH v2] " Hans-Werner Hilse
2015-06-29  9:50       ` Hans-Werner Hilse [this message]
2015-07-27 11:30         ` [uml-devel] [PATCH v2] um: Do not rely on libc to provide modify_ldt() Hans-Werner Hilse
2015-07-28 21:41           ` Richard Weinberger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1435571432-21125-2-git-send-email-hwhilse@gmail.com \
    --to=hwhilse@gmail.com \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.