1 /* 2 * Copyright (C) 2012 Linux Test Project, Inc. 3 * 4 * This program is free software; you can redistribute it and/or 5 * modify it under the terms of version 2 of the GNU General Public 6 * License as published by the Free Software Foundation. 7 * 8 * This program is distributed in the hope that it would be useful, 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 11 * 12 * Further, this software is distributed without any warranty that it 13 * is free of the rightful claim of any third person regarding 14 * infringement or the like. Any license provided herein, whether 15 * implied or otherwise, applies only to this software file. Patent 16 * licenses, if any, provided herein do not apply to combinations of 17 * this program with other software, or any other product whatsoever. 18 * 19 * You should have received a copy of the GNU General Public License 20 * along with this program; if not, write the Free Software 21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 22 * 02110-1301, USA. 23 */ 24 25 #ifndef _PROCESS_VM_H_ 26 #define _PROCESS_VM_H_ 27 28 #include <sys/types.h> 29 #include <sys/ipc.h> 30 #include <sys/sem.h> 31 #include <sys/syscall.h> 32 #include <sys/uio.h> 33 #include <unistd.h> 34 #include "lapi/semun.h" 35 36 static inline ssize_t test_process_vm_readv(pid_t pid, 37 const struct iovec *lvec, unsigned long liovcnt, 38 const struct iovec *rvec, unsigned long riovcnt, 39 unsigned long flags) 40 { 41 #if defined(__NR_process_vm_readv) 42 return syscall(__NR_process_vm_readv, pid, lvec, liovcnt, 43 rvec, riovcnt, flags); 44 #else 45 return syscall(-1); 46 #endif 47 } 48 49 static inline ssize_t test_process_vm_writev(pid_t pid, 50 const struct iovec *lvec, unsigned long liovcnt, 51 const struct iovec *rvec, unsigned long riovcnt, 52 unsigned long flags) 53 { 54 #if defined(__NR_process_vm_writev) 55 return syscall(__NR_process_vm_writev, pid, lvec, liovcnt, 56 rvec, riovcnt, flags); 57 #else 58 return syscall(-1); 59 #endif 60 } 61 62 #endif /* _PROCESS_VM_H_ */ 63