1 //===-- LibcGlue.cpp --------------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file adds functions missing from libc on older versions of linux
13 #include <lldb/Host/linux/Uio.h>
14 #include <sys/syscall.h>
17 #ifndef HAVE_PROCESS_VM_READV // If the syscall wrapper is not available,
19 ssize_t process_vm_readv(::pid_t pid, const struct iovec *local_iov,
20 unsigned long liovcnt, const struct iovec *remote_iov,
21 unsigned long riovcnt, unsigned long flags) {
22 #ifdef HAVE_NR_PROCESS_VM_READV // If we have the syscall number, we can issue
23 // the syscall ourselves.
24 return syscall(__NR_process_vm_readv, pid, local_iov, liovcnt, remote_iov,
26 #else // If not, let's pretend the syscall is not present.