sewardj | a8d8e23 | 2005-06-07 20:04:56 +0000 | [diff] [blame] | 1 | |
| 2 | /*--------------------------------------------------------------------*/ |
njn | c1b0181 | 2005-06-17 22:19:06 +0000 | [diff] [blame] | 3 | /*--- Private syscalls header. priv_syswrap-generic.h ---*/ |
sewardj | a8d8e23 | 2005-06-07 20:04:56 +0000 | [diff] [blame] | 4 | /*--------------------------------------------------------------------*/ |
| 5 | |
| 6 | /* |
| 7 | This file is part of Valgrind, a dynamic binary instrumentation |
| 8 | framework. |
| 9 | |
Elliott Hughes | ed39800 | 2017-06-21 14:41:24 -0700 | [diff] [blame^] | 10 | Copyright (C) 2000-2017 Julian Seward |
sewardj | a8d8e23 | 2005-06-07 20:04:56 +0000 | [diff] [blame] | 11 | jseward@acm.org |
| 12 | |
| 13 | This program is free software; you can redistribute it and/or |
| 14 | modify it under the terms of the GNU General Public License as |
| 15 | published by the Free Software Foundation; either version 2 of the |
| 16 | License, or (at your option) any later version. |
| 17 | |
| 18 | This program is distributed in the hope that it will be useful, but |
| 19 | WITHOUT ANY WARRANTY; without even the implied warranty of |
| 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 21 | General Public License for more details. |
| 22 | |
| 23 | You should have received a copy of the GNU General Public License |
| 24 | along with this program; if not, write to the Free Software |
| 25 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
| 26 | 02111-1307, USA. |
| 27 | |
| 28 | The GNU General Public License is contained in the file COPYING. |
| 29 | */ |
| 30 | |
njn | c1b0181 | 2005-06-17 22:19:06 +0000 | [diff] [blame] | 31 | #ifndef __PRIV_SYSWRAP_GENERIC_H |
| 32 | #define __PRIV_SYSWRAP_GENERIC_H |
sewardj | a8d8e23 | 2005-06-07 20:04:56 +0000 | [diff] [blame] | 33 | |
florian | 535fb1b | 2013-09-15 13:54:34 +0000 | [diff] [blame] | 34 | #include "pub_core_basics.h" // ThreadId |
| 35 | #include "pub_core_vki.h" // vki_msghdr |
| 36 | #include "priv_types_n_macros.h" // DECL_TEMPLATE |
sewardj | a8d8e23 | 2005-06-07 20:04:56 +0000 | [diff] [blame] | 37 | |
| 38 | |
philippe | 38a74d2 | 2014-08-29 22:53:19 +0000 | [diff] [blame] | 39 | /* Guess the client stack from the segment in which sp is mapped. |
| 40 | Register the guessed stack using VG_(register_stack). |
| 41 | Setup tst client_stack_highest_byte and client_stack_szB. |
| 42 | If sp is not in a mapped segment, does nothing. */ |
| 43 | extern void ML_(guess_and_register_stack) (Addr sp, ThreadState* tst); |
| 44 | |
sewardj | a8d8e23 | 2005-06-07 20:04:56 +0000 | [diff] [blame] | 45 | // Return true if address range entirely contained within client |
| 46 | // address space. |
| 47 | extern |
sewardj | 7eb7c58 | 2005-06-23 01:02:53 +0000 | [diff] [blame] | 48 | Bool ML_(valid_client_addr)(Addr start, SizeT size, ThreadId tid, |
florian | e543f30 | 2012-10-21 19:43:43 +0000 | [diff] [blame] | 49 | const HChar *syscallname); |
sewardj | a8d8e23 | 2005-06-07 20:04:56 +0000 | [diff] [blame] | 50 | |
sewardj | 45f4e7c | 2005-09-27 19:20:21 +0000 | [diff] [blame] | 51 | /* Handy small function to help stop wrappers from segfaulting when |
| 52 | presented with bogus client addresses. Is not used for generating |
| 53 | user-visible errors. */ |
sewardj | 8eb8bab | 2015-07-21 14:44:28 +0000 | [diff] [blame] | 54 | extern Bool ML_(safe_to_deref) ( const void *start, SizeT size ); |
sewardj | 45f4e7c | 2005-09-27 19:20:21 +0000 | [diff] [blame] | 55 | |
njn | 419bbcb | 2005-06-21 03:52:49 +0000 | [diff] [blame] | 56 | // Returns True if the signal is OK for the client to use. |
sewardj | 7eb7c58 | 2005-06-23 01:02:53 +0000 | [diff] [blame] | 57 | extern Bool ML_(client_signal_OK)(Int sigNo); |
njn | 419bbcb | 2005-06-21 03:52:49 +0000 | [diff] [blame] | 58 | |
sewardj | a8d8e23 | 2005-06-07 20:04:56 +0000 | [diff] [blame] | 59 | // Return true if we're allowed to use or create this fd. |
| 60 | extern |
florian | e543f30 | 2012-10-21 19:43:43 +0000 | [diff] [blame] | 61 | Bool ML_(fd_allowed)(Int fd, const HChar *syscallname, ThreadId tid, |
| 62 | Bool isNewFD); |
sewardj | a8d8e23 | 2005-06-07 20:04:56 +0000 | [diff] [blame] | 63 | |
sewardj | 8eb8bab | 2015-07-21 14:44:28 +0000 | [diff] [blame] | 64 | extern void ML_(record_fd_close) (Int fd); |
njn | 096ccdd | 2009-02-22 23:00:30 +0000 | [diff] [blame] | 65 | extern void ML_(record_fd_open_named) (ThreadId tid, Int fd); |
njn | 4279a88 | 2005-08-26 03:43:28 +0000 | [diff] [blame] | 66 | extern void ML_(record_fd_open_nameless) (ThreadId tid, Int fd); |
| 67 | extern void ML_(record_fd_open_with_given_name)(ThreadId tid, Int fd, |
florian | 3130eab | 2014-11-14 19:25:08 +0000 | [diff] [blame] | 68 | const HChar *pathname); |
sewardj | a8d8e23 | 2005-06-07 20:04:56 +0000 | [diff] [blame] | 69 | |
sewardj | 8eb8bab | 2015-07-21 14:44:28 +0000 | [diff] [blame] | 70 | // Return true if a given file descriptor is already recorded. |
| 71 | extern Bool ML_(fd_recorded)(Int fd); |
| 72 | // Returns a pathname representing a recorded fd. |
| 73 | // Returned string must not be modified nor free'd. |
| 74 | extern const HChar *ML_(find_fd_recorded_by_fd)(Int fd); |
| 75 | |
sewardj | a8d8e23 | 2005-06-07 20:04:56 +0000 | [diff] [blame] | 76 | // Used when killing threads -- we must not kill a thread if it's the thread |
| 77 | // that would do Valgrind's final cleanup and output. |
| 78 | extern |
sewardj | 7eb7c58 | 2005-06-23 01:02:53 +0000 | [diff] [blame] | 79 | Bool ML_(do_sigkill)(Int pid, Int tgid); |
sewardj | a8d8e23 | 2005-06-07 20:04:56 +0000 | [diff] [blame] | 80 | |
njn | dd37258 | 2009-05-10 22:42:19 +0000 | [diff] [blame] | 81 | /* When a client mmap or munmap has been successfully done, both the core |
| 82 | and the tool need to be notified of the new mapping. Hence this fn. */ |
| 83 | extern void |
| 84 | ML_(notify_core_and_tool_of_mmap) ( Addr a, SizeT len, UInt prot, |
| 85 | UInt mm_flags, Int fd, Off64T offset ); |
| 86 | extern void |
| 87 | ML_(notify_core_and_tool_of_munmap) ( Addr a, SizeT len ); |
| 88 | extern void |
| 89 | ML_(notify_core_and_tool_of_mprotect) ( Addr a, SizeT len, Int prot ); |
sewardj | a8d8e23 | 2005-06-07 20:04:56 +0000 | [diff] [blame] | 90 | |
njn | f37a81b | 2009-02-17 00:23:30 +0000 | [diff] [blame] | 91 | extern void |
| 92 | ML_(buf_and_len_pre_check) ( ThreadId tid, Addr buf_p, Addr buflen_p, |
florian | e543f30 | 2012-10-21 19:43:43 +0000 | [diff] [blame] | 93 | const HChar* buf_s, const HChar* buflen_s ); |
njn | f37a81b | 2009-02-17 00:23:30 +0000 | [diff] [blame] | 94 | extern void |
| 95 | ML_(buf_and_len_post_check) ( ThreadId tid, SysRes res, |
florian | e543f30 | 2012-10-21 19:43:43 +0000 | [diff] [blame] | 96 | Addr buf_p, Addr buflen_p, const HChar* s ); |
njn | f37a81b | 2009-02-17 00:23:30 +0000 | [diff] [blame] | 97 | |
njn | 1be9cf6 | 2009-05-22 00:15:06 +0000 | [diff] [blame] | 98 | /* PRE and POST for unknown ioctls based on ioctl request encoding */ |
| 99 | extern |
| 100 | void ML_(PRE_unknown_ioctl)(ThreadId tid, UWord request, UWord arg); |
| 101 | extern |
| 102 | void ML_(POST_unknown_ioctl)(ThreadId tid, UInt res, UWord request, UWord arg); |
| 103 | |
sewardj | 8eb8bab | 2015-07-21 14:44:28 +0000 | [diff] [blame] | 104 | extern |
| 105 | void ML_(pre_argv_envp)(Addr a, ThreadId tid, const HChar *s1, const HChar *s2); |
| 106 | |
| 107 | extern Bool |
| 108 | ML_(handle_auxv_open)(SyscallStatus *status, const HChar *filename, |
| 109 | int flags); |
sewardj | a8d8e23 | 2005-06-07 20:04:56 +0000 | [diff] [blame] | 110 | |
sewardj | bc22cf7 | 2005-06-08 00:02:49 +0000 | [diff] [blame] | 111 | DECL_TEMPLATE(generic, sys_ni_syscall); // * P -- unimplemented |
| 112 | DECL_TEMPLATE(generic, sys_exit); |
| 113 | DECL_TEMPLATE(generic, sys_fork); |
| 114 | DECL_TEMPLATE(generic, sys_read); |
| 115 | DECL_TEMPLATE(generic, sys_write); |
| 116 | DECL_TEMPLATE(generic, sys_open); |
| 117 | DECL_TEMPLATE(generic, sys_close); |
| 118 | DECL_TEMPLATE(generic, sys_waitpid); |
| 119 | DECL_TEMPLATE(generic, sys_creat); |
| 120 | DECL_TEMPLATE(generic, sys_link); |
| 121 | DECL_TEMPLATE(generic, sys_unlink); |
| 122 | DECL_TEMPLATE(generic, sys_execve); // (*??) P |
| 123 | DECL_TEMPLATE(generic, sys_chdir); |
| 124 | DECL_TEMPLATE(generic, sys_time); |
| 125 | DECL_TEMPLATE(generic, sys_mknod); |
| 126 | DECL_TEMPLATE(generic, sys_chmod); |
sewardj | bc22cf7 | 2005-06-08 00:02:49 +0000 | [diff] [blame] | 127 | DECL_TEMPLATE(generic, sys_getpid); |
| 128 | DECL_TEMPLATE(generic, sys_alarm); |
| 129 | DECL_TEMPLATE(generic, sys_pause); |
sewardj | bc22cf7 | 2005-06-08 00:02:49 +0000 | [diff] [blame] | 130 | DECL_TEMPLATE(generic, sys_access); |
| 131 | DECL_TEMPLATE(generic, sys_kill); |
| 132 | DECL_TEMPLATE(generic, sys_rename); |
| 133 | DECL_TEMPLATE(generic, sys_mkdir); |
| 134 | DECL_TEMPLATE(generic, sys_rmdir); |
| 135 | DECL_TEMPLATE(generic, sys_dup); |
| 136 | DECL_TEMPLATE(generic, sys_times); |
sewardj | bc22cf7 | 2005-06-08 00:02:49 +0000 | [diff] [blame] | 137 | DECL_TEMPLATE(generic, sys_setpgid); |
| 138 | DECL_TEMPLATE(generic, sys_umask); |
| 139 | DECL_TEMPLATE(generic, sys_dup2); |
| 140 | DECL_TEMPLATE(generic, sys_getppid); |
| 141 | DECL_TEMPLATE(generic, sys_getpgrp); |
| 142 | DECL_TEMPLATE(generic, sys_setsid); |
| 143 | DECL_TEMPLATE(generic, sys_munmap); |
| 144 | DECL_TEMPLATE(generic, sys_truncate); |
| 145 | DECL_TEMPLATE(generic, sys_ftruncate); |
| 146 | DECL_TEMPLATE(generic, sys_fchmod); |
| 147 | DECL_TEMPLATE(generic, sys_msync); |
| 148 | DECL_TEMPLATE(generic, sys_readv); |
| 149 | DECL_TEMPLATE(generic, sys_writev); |
| 150 | DECL_TEMPLATE(generic, sys_getsid); |
| 151 | DECL_TEMPLATE(generic, sys_fdatasync); |
| 152 | DECL_TEMPLATE(generic, sys_mlock); |
| 153 | DECL_TEMPLATE(generic, sys_munlock); |
| 154 | DECL_TEMPLATE(generic, sys_mlockall); |
sewardj | bc22cf7 | 2005-06-08 00:02:49 +0000 | [diff] [blame] | 155 | DECL_TEMPLATE(generic, sys_nanosleep); |
| 156 | DECL_TEMPLATE(generic, sys_mremap); // POSIX, but Linux arg order may be odd |
| 157 | DECL_TEMPLATE(generic, sys_getuid); |
| 158 | DECL_TEMPLATE(generic, sys_getgid); |
| 159 | DECL_TEMPLATE(generic, sys_geteuid); |
| 160 | DECL_TEMPLATE(generic, sys_getegid); |
| 161 | DECL_TEMPLATE(generic, sys_getpgid); |
| 162 | DECL_TEMPLATE(generic, sys_fsync); |
| 163 | DECL_TEMPLATE(generic, sys_wait4); |
| 164 | DECL_TEMPLATE(generic, sys_mprotect); |
sewardj | bc22cf7 | 2005-06-08 00:02:49 +0000 | [diff] [blame] | 165 | DECL_TEMPLATE(generic, sys_getcwd); |
| 166 | DECL_TEMPLATE(generic, sys_symlink); |
| 167 | DECL_TEMPLATE(generic, sys_getgroups); |
| 168 | DECL_TEMPLATE(generic, sys_setgroups); // SVr4, SVID, X/OPEN, 4.3BSD |
| 169 | DECL_TEMPLATE(generic, sys_chown); |
| 170 | DECL_TEMPLATE(generic, sys_setuid); |
| 171 | DECL_TEMPLATE(generic, sys_gettimeofday); |
| 172 | DECL_TEMPLATE(generic, sys_madvise); |
tom | f93bbd9 | 2013-07-17 12:43:30 +0000 | [diff] [blame] | 173 | DECL_TEMPLATE(generic, sys_sethostname); |
sewardj | a8d8e23 | 2005-06-07 20:04:56 +0000 | [diff] [blame] | 174 | |
| 175 | // These ones aren't POSIX, but are in some standard and look reasonably |
sewardj | bc22cf7 | 2005-06-08 00:02:49 +0000 | [diff] [blame] | 176 | // generic, and are the same for all architectures under Linux. |
| 177 | DECL_TEMPLATE(generic, sys_nice); // SVr4, SVID EXT, AT&T, X/OPEN, BSD 4.3 |
| 178 | DECL_TEMPLATE(generic, sys_sync); // SVr4, SVID, X/OPEN, BSD 4.3 |
| 179 | DECL_TEMPLATE(generic, sys_brk); // 4.3BSD |
| 180 | DECL_TEMPLATE(generic, sys_acct); // SVR4, non-POSIX |
| 181 | DECL_TEMPLATE(generic, sys_chroot); // SVr4, SVID, 4.4BSD, X/OPEN |
| 182 | DECL_TEMPLATE(generic, sys_readlink); // X/OPEN, 4.4BSD |
| 183 | DECL_TEMPLATE(generic, sys_fchdir); // SVr4, SVID, POSIX, X/OPEN, 4.4BSD |
| 184 | DECL_TEMPLATE(generic, sys_getdents); // SVr4,SVID |
| 185 | DECL_TEMPLATE(generic, sys_select); // 4.4BSD |
| 186 | DECL_TEMPLATE(generic, sys_flock); // 4.4BSD |
| 187 | DECL_TEMPLATE(generic, sys_poll); // XPG4-UNIX |
| 188 | DECL_TEMPLATE(generic, sys_getrusage); // SVr4, 4.3BSD |
| 189 | DECL_TEMPLATE(generic, sys_stime); // SVr4, SVID, X/OPEN |
| 190 | DECL_TEMPLATE(generic, sys_settimeofday); // SVr4, 4.3BSD (non-POSIX) |
| 191 | DECL_TEMPLATE(generic, sys_getpriority); // SVr4, 4.4BSD |
| 192 | DECL_TEMPLATE(generic, sys_setpriority); // SVr4, 4.4BSD |
| 193 | DECL_TEMPLATE(generic, sys_setitimer); // SVr4, 4.4BSD |
| 194 | DECL_TEMPLATE(generic, sys_getitimer); // SVr4, 4.4BSD |
| 195 | DECL_TEMPLATE(generic, sys_setreuid); // 4.3BSD |
| 196 | DECL_TEMPLATE(generic, sys_setregid); // 4.3BSD |
| 197 | DECL_TEMPLATE(generic, sys_fchown); // SVr4,4.3BSD |
| 198 | DECL_TEMPLATE(generic, sys_setgid); // SVr4,SVID |
| 199 | DECL_TEMPLATE(generic, sys_utimes); // 4.3BSD |
sewardj | a8d8e23 | 2005-06-07 20:04:56 +0000 | [diff] [blame] | 200 | |
sewardj | a8d8e23 | 2005-06-07 20:04:56 +0000 | [diff] [blame] | 201 | // May not be generic for every architecture under Linux. |
sewardj | bc22cf7 | 2005-06-08 00:02:49 +0000 | [diff] [blame] | 202 | DECL_TEMPLATE(generic, sys_sigaction); // (x86) P |
sewardj | a8d8e23 | 2005-06-07 20:04:56 +0000 | [diff] [blame] | 203 | |
| 204 | // Funny names, not sure... |
sewardj | bc22cf7 | 2005-06-08 00:02:49 +0000 | [diff] [blame] | 205 | DECL_TEMPLATE(generic, sys_newstat); // * P |
| 206 | DECL_TEMPLATE(generic, sys_newlstat); // * |
| 207 | DECL_TEMPLATE(generic, sys_newfstat); // * P (SVr4,BSD4.3) |
sewardj | a8d8e23 | 2005-06-07 20:04:56 +0000 | [diff] [blame] | 208 | |
| 209 | // For the remainder, not really sure yet |
sewardj | bc22cf7 | 2005-06-08 00:02:49 +0000 | [diff] [blame] | 210 | DECL_TEMPLATE(generic, sys_ptrace); // (x86?) (almost-P) |
sewardj | bc22cf7 | 2005-06-08 00:02:49 +0000 | [diff] [blame] | 211 | DECL_TEMPLATE(generic, sys_setrlimit); // SVr4, 4.3BSD |
sewardj | bc22cf7 | 2005-06-08 00:02:49 +0000 | [diff] [blame] | 212 | DECL_TEMPLATE(generic, sys_old_getrlimit); // SVr4, 4.3BSD L? |
| 213 | DECL_TEMPLATE(generic, sys_statfs); // * L? |
| 214 | DECL_TEMPLATE(generic, sys_fstatfs); // * L? |
| 215 | DECL_TEMPLATE(generic, sys_iopl); // (x86/amd64) L |
sewardj | bc22cf7 | 2005-06-08 00:02:49 +0000 | [diff] [blame] | 216 | DECL_TEMPLATE(generic, sys_newuname); // * P |
njn | 7b1edbd | 2009-05-19 06:50:37 +0000 | [diff] [blame] | 217 | DECL_TEMPLATE(generic, sys_pread64); // * (Unix98?) |
| 218 | DECL_TEMPLATE(generic, sys_pwrite64); // * (Unix98?) |
sewardj | bc22cf7 | 2005-06-08 00:02:49 +0000 | [diff] [blame] | 219 | DECL_TEMPLATE(generic, sys_sigaltstack); // (x86) (XPG4-UNIX) |
| 220 | DECL_TEMPLATE(generic, sys_getpmsg); // (?) (?) |
| 221 | DECL_TEMPLATE(generic, sys_putpmsg); // (?) (?) |
| 222 | DECL_TEMPLATE(generic, sys_getrlimit); // * (?) |
sewardj | bc22cf7 | 2005-06-08 00:02:49 +0000 | [diff] [blame] | 223 | DECL_TEMPLATE(generic, sys_truncate64); // %% (P?) |
| 224 | DECL_TEMPLATE(generic, sys_ftruncate64); // %% (P?) |
| 225 | DECL_TEMPLATE(generic, sys_lchown); // * (L?) |
| 226 | DECL_TEMPLATE(generic, sys_mincore); // * L? |
| 227 | DECL_TEMPLATE(generic, sys_getdents64); // * (SVr4,SVID?) |
sewardj | bc22cf7 | 2005-06-08 00:02:49 +0000 | [diff] [blame] | 228 | DECL_TEMPLATE(generic, sys_statfs64); // * (?) |
| 229 | DECL_TEMPLATE(generic, sys_fstatfs64); // * (?) |
sewardj | a8d8e23 | 2005-06-07 20:04:56 +0000 | [diff] [blame] | 230 | |
| 231 | |
| 232 | /* --------------------------------------------------------------------- |
| 233 | Wrappers for sockets and ipc-ery. These are split into standalone |
philippe | f2a7bbe | 2012-11-04 20:40:33 +0000 | [diff] [blame] | 234 | procedures because some platforms hides them inside multiplexors |
sewardj | a8d8e23 | 2005-06-07 20:04:56 +0000 | [diff] [blame] | 235 | (sys_socketcall and sys_ipc). |
| 236 | ------------------------------------------------------------------ */ |
| 237 | |
| 238 | #define TId ThreadId |
| 239 | #define UW UWord |
| 240 | #define SR SysRes |
| 241 | |
sewardj | 7eb7c58 | 2005-06-23 01:02:53 +0000 | [diff] [blame] | 242 | extern void ML_(generic_PRE_sys_socketpair) ( TId, UW, UW, UW, UW ); |
| 243 | extern SysRes ML_(generic_POST_sys_socketpair) ( TId, SR, UW, UW, UW, UW ); |
| 244 | extern SysRes ML_(generic_POST_sys_socket) ( TId, SR ); |
| 245 | extern void ML_(generic_PRE_sys_bind) ( TId, UW, UW, UW ); |
| 246 | extern void ML_(generic_PRE_sys_accept) ( TId, UW, UW, UW ); |
| 247 | extern SysRes ML_(generic_POST_sys_accept) ( TId, SR, UW, UW, UW ); |
| 248 | extern void ML_(generic_PRE_sys_sendto) ( TId, UW, UW, UW, UW, UW, UW ); |
| 249 | extern void ML_(generic_PRE_sys_send) ( TId, UW, UW, UW ); |
| 250 | extern void ML_(generic_PRE_sys_recvfrom) ( TId, UW, UW, UW, UW, UW, UW ); |
| 251 | extern void ML_(generic_POST_sys_recvfrom) ( TId, SR, UW, UW, UW, UW, UW, UW ); |
| 252 | extern void ML_(generic_PRE_sys_recv) ( TId, UW, UW, UW ); |
| 253 | extern void ML_(generic_POST_sys_recv) ( TId, UW, UW, UW, UW ); |
| 254 | extern void ML_(generic_PRE_sys_connect) ( TId, UW, UW, UW ); |
| 255 | extern void ML_(generic_PRE_sys_setsockopt) ( TId, UW, UW, UW, UW, UW ); |
sewardj | 7eb7c58 | 2005-06-23 01:02:53 +0000 | [diff] [blame] | 256 | extern void ML_(generic_PRE_sys_getsockname) ( TId, UW, UW, UW ); |
| 257 | extern void ML_(generic_POST_sys_getsockname) ( TId, SR, UW, UW, UW ); |
| 258 | extern void ML_(generic_PRE_sys_getpeername) ( TId, UW, UW, UW ); |
| 259 | extern void ML_(generic_POST_sys_getpeername) ( TId, SR, UW, UW, UW ); |
florian | e543f30 | 2012-10-21 19:43:43 +0000 | [diff] [blame] | 260 | extern void ML_(generic_PRE_sys_sendmsg) ( TId, const HChar *, |
| 261 | struct vki_msghdr * ); |
| 262 | extern void ML_(generic_PRE_sys_recvmsg) ( TId, const HChar *, |
| 263 | struct vki_msghdr * ); |
| 264 | extern void ML_(generic_POST_sys_recvmsg) ( TId, const HChar *, |
| 265 | struct vki_msghdr *, UInt ); |
sewardj | a8d8e23 | 2005-06-07 20:04:56 +0000 | [diff] [blame] | 266 | |
sewardj | 7eb7c58 | 2005-06-23 01:02:53 +0000 | [diff] [blame] | 267 | extern void ML_(generic_PRE_sys_semop) ( TId, UW, UW, UW ); |
| 268 | extern void ML_(generic_PRE_sys_semtimedop) ( TId, UW, UW, UW, UW ); |
| 269 | extern void ML_(generic_PRE_sys_semctl) ( TId, UW, UW, UW, UW ); |
| 270 | extern void ML_(generic_POST_sys_semctl) ( TId, UW, UW, UW, UW, UW ); |
sewardj | 7eb7c58 | 2005-06-23 01:02:53 +0000 | [diff] [blame] | 271 | extern UWord ML_(generic_PRE_sys_shmat) ( TId, UW, UW, UW ); |
| 272 | extern void ML_(generic_POST_sys_shmat) ( TId, UW, UW, UW, UW ); |
| 273 | extern Bool ML_(generic_PRE_sys_shmdt) ( TId, UW ); |
| 274 | extern void ML_(generic_POST_sys_shmdt) ( TId, UW, UW ); |
| 275 | extern void ML_(generic_PRE_sys_shmctl) ( TId, UW, UW, UW ); |
| 276 | extern void ML_(generic_POST_sys_shmctl) ( TId, UW, UW, UW, UW ); |
sewardj | a8d8e23 | 2005-06-07 20:04:56 +0000 | [diff] [blame] | 277 | |
sewardj | 274461d | 2005-10-02 17:01:41 +0000 | [diff] [blame] | 278 | extern SysRes ML_(generic_PRE_sys_mmap) ( TId, UW, UW, UW, UW, UW, Off64T ); |
tom | 9548a16 | 2005-09-30 08:07:53 +0000 | [diff] [blame] | 279 | |
tom | 15bd0c8 | 2010-02-19 16:50:45 +0000 | [diff] [blame] | 280 | #define PRE_timeval_READ(zzname, zzarg) \ |
| 281 | do { \ |
| 282 | struct vki_timeval *zztv = (struct vki_timeval *)(zzarg); \ |
| 283 | PRE_FIELD_READ(zzname, zztv->tv_sec); \ |
| 284 | PRE_FIELD_READ(zzname, zztv->tv_usec); \ |
njn | 72bbd8d | 2009-05-22 08:12:46 +0000 | [diff] [blame] | 285 | } while (0) |
tom | 15bd0c8 | 2010-02-19 16:50:45 +0000 | [diff] [blame] | 286 | #define PRE_timeval_WRITE(zzname, zzarg) \ |
| 287 | do { \ |
| 288 | struct vki_timeval *zztv = (struct vki_timeval *)(zzarg); \ |
| 289 | PRE_FIELD_WRITE(zzname, zztv->tv_sec); \ |
| 290 | PRE_FIELD_WRITE(zzname, zztv->tv_usec); \ |
njn | 72bbd8d | 2009-05-22 08:12:46 +0000 | [diff] [blame] | 291 | } while (0) |
tom | 15bd0c8 | 2010-02-19 16:50:45 +0000 | [diff] [blame] | 292 | #define POST_timeval_WRITE(zzarg) \ |
| 293 | do { \ |
| 294 | struct vki_timeval *zztv = (struct vki_timeval *)(zzarg); \ |
| 295 | POST_FIELD_WRITE(zztv->tv_sec); \ |
| 296 | POST_FIELD_WRITE(zztv->tv_usec); \ |
njn | 72bbd8d | 2009-05-22 08:12:46 +0000 | [diff] [blame] | 297 | } while (0) |
| 298 | |
| 299 | |
sewardj | a8d8e23 | 2005-06-07 20:04:56 +0000 | [diff] [blame] | 300 | #undef TId |
| 301 | #undef UW |
| 302 | #undef SR |
| 303 | |
| 304 | |
| 305 | ///////////////////////////////////////////////////////////////// |
| 306 | |
| 307 | |
njn | c1b0181 | 2005-06-17 22:19:06 +0000 | [diff] [blame] | 308 | #endif // __PRIV_SYSWRAP_GENERIC_H |
sewardj | a8d8e23 | 2005-06-07 20:04:56 +0000 | [diff] [blame] | 309 | |
| 310 | /*--------------------------------------------------------------------*/ |
| 311 | /*--- end ---*/ |
| 312 | /*--------------------------------------------------------------------*/ |