summaryrefslogtreecommitdiff
path: root/source/Host/linux/LibcGlue.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-01-02 19:26:05 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-01-02 19:26:05 +0000
commit14f1b3e8826ce43b978db93a62d1166055db5394 (patch)
tree0a00ad8d3498783fe0193f3b656bca17c4c8697d /source/Host/linux/LibcGlue.cpp
parent4ee8c119c71a06dcad1e0fecc8c675e480e59337 (diff)
Notes
Diffstat (limited to 'source/Host/linux/LibcGlue.cpp')
-rw-r--r--source/Host/linux/LibcGlue.cpp27
1 files changed, 14 insertions, 13 deletions
diff --git a/source/Host/linux/LibcGlue.cpp b/source/Host/linux/LibcGlue.cpp
index 63d026f76c62..c036bb28a9bc 100644
--- a/source/Host/linux/LibcGlue.cpp
+++ b/source/Host/linux/LibcGlue.cpp
@@ -9,22 +9,23 @@
// This file adds functions missing from libc on older versions of linux
-#include <unistd.h>
-#include <sys/syscall.h>
-#include <lldb/Host/linux/Uio.h>
#include <cerrno>
+#include <lldb/Host/linux/Uio.h>
+#include <sys/syscall.h>
+#include <unistd.h>
-#ifndef HAVE_PROCESS_VM_READV // If the syscall wrapper is not available, provide one.
-ssize_t process_vm_readv(::pid_t pid,
- const struct iovec *local_iov, unsigned long liovcnt,
- const struct iovec *remote_iov, unsigned long riovcnt,
- unsigned long flags)
-{
-#ifdef HAVE_NR_PROCESS_VM_READV // If we have the syscall number, we can issue the syscall ourselves.
- return syscall(__NR_process_vm_readv, pid, local_iov, liovcnt, remote_iov, riovcnt, flags);
+#ifndef HAVE_PROCESS_VM_READV // If the syscall wrapper is not available,
+ // provide one.
+ssize_t process_vm_readv(::pid_t pid, const struct iovec *local_iov,
+ unsigned long liovcnt, const struct iovec *remote_iov,
+ unsigned long riovcnt, unsigned long flags) {
+#ifdef HAVE_NR_PROCESS_VM_READV // If we have the syscall number, we can issue
+ // the syscall ourselves.
+ return syscall(__NR_process_vm_readv, pid, local_iov, liovcnt, remote_iov,
+ riovcnt, flags);
#else // If not, let's pretend the syscall is not present.
- errno = ENOSYS;
- return -1;
+ errno = ENOSYS;
+ return -1;
#endif
}
#endif