1 //===-- LibcGlue.cpp ------------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // This file adds functions missing from libc on older versions of linux
12 #include <lldb/Host/linux/Uio.h>
13 #include <sys/syscall.h>
16 #if !HAVE_PROCESS_VM_READV
17 // If the syscall wrapper is not available, provide one.
18 ssize_t
process_vm_readv(::pid_t pid
, const struct iovec
*local_iov
,
19 unsigned long liovcnt
, const struct iovec
*remote_iov
,
20 unsigned long riovcnt
, unsigned long flags
) {
21 #if HAVE_NR_PROCESS_VM_READV
22 // If we have the syscall number, we can issue the syscall ourselves.
23 return syscall(__NR_process_vm_readv
, pid
, local_iov
, liovcnt
, remote_iov
,
25 #else // If not, let's pretend the syscall is not present.