Lines Matching refs:res
100 SSizeT res = VG_(readlink)(tmp, buf, bufsiz); in VG_() local
101 if (res < 0) break; in VG_()
102 if (res == bufsiz) { // buffer too small; increase and retry in VG_()
107 vg_assert(bufsiz > res); // paranoia in VG_()
110 buf[res] = '\0'; in VG_()
143 SysRes res = VG_(do_syscall4)(__NR_mknodat, in VG_() local
146 SysRes res = VG_(do_syscall3)(__NR_mknod, in VG_()
149 SysRes res = VG_(do_syscall4)(__NR_mknodat, in VG_()
154 return res; in VG_()
161 SysRes res = VG_(do_syscall4)(__NR_openat, in VG_() local
164 SysRes res = VG_(do_syscall3)(__NR_open, in VG_()
167 SysRes res = VG_(do_syscall3)(__NR_open_nocancel, in VG_()
170 SysRes res = VG_(do_syscall4)(__NR_openat, in VG_()
175 return res; in VG_()
204 SysRes res = VG_(do_syscall3)(__NR_read, fd, (UWord)buf, count); in VG_() local
206 SysRes res = VG_(do_syscall3)(__NR_read_nocancel, fd, (UWord)buf, count); in VG_() local
210 if (sr_isError(res)) { in VG_()
211 ret = - (Int)(Word)sr_Err(res); in VG_()
214 ret = (Int)(Word)sr_Res(res); in VG_()
224 SysRes res = VG_(do_syscall3)(__NR_write, fd, (UWord)buf, count); in VG_() local
226 SysRes res = VG_(do_syscall3)(__NR_write_nocancel, fd, (UWord)buf, count); in VG_() local
230 if (sr_isError(res)) { in VG_()
231 ret = - (Int)(Word)sr_Err(res); in VG_()
234 ret = (Int)(Word)sr_Res(res); in VG_()
245 SysRes res = VG_(do_syscall1)(__NR_pipe, (UWord)fd); in VG_() local
246 if (!sr_isError(res)) { in VG_()
247 fd[0] = (Int)sr_Res(res); in VG_()
248 fd[1] = (Int)sr_ResEx(res); in VG_()
254 SysRes res = VG_(do_syscall2)(__NR_pipe2, (UWord)fd, 0); in VG_()
255 return sr_isError(res) ? -1 : 0; in VG_()
257 SysRes res = VG_(do_syscall1)(__NR_pipe, (UWord)fd); in VG_()
258 return sr_isError(res) ? -1 : 0; in VG_()
261 SysRes res = VG_(do_syscall0)(__NR_pipe); in VG_()
262 if (!sr_isError(res)) { in VG_()
263 fd[0] = (Int)sr_Res(res); in VG_()
264 fd[1] = (Int)sr_ResHI(res); in VG_()
266 return sr_isError(res) ? -1 : 0; in VG_()
269 SysRes res = VG_(do_syscall2)(__NR_pipe, (UWord)fd, 0); in VG_()
270 return sr_isError(res) ? -1 : 0; in VG_()
272 SysRes res = VG_(do_syscall0)(__NR_pipe); in VG_()
273 if (!sr_isError(res)) { in VG_()
274 fd[0] = (Int)sr_Res(res); in VG_()
275 fd[1] = (Int)sr_ResHI(res); in VG_()
277 return sr_isError(res) ? -1 : 0; in VG_()
289 SysRes res = VG_(do_syscall5)(__NR__llseek, fd, in VG_() local
292 return sr_isError(res) ? (-1) : result; in VG_()
294 SysRes res = VG_(do_syscall3)(__NR_lseek, fd, offset, whence); in VG_()
296 return sr_isError(res) ? (-1) : sr_Res(res); in VG_()
299 SysRes res = VG_(do_syscall4)(__NR_lseek, fd, in VG_()
301 return sr_isError(res) ? (-1) : sr_Res(res); in VG_()
303 SysRes res = VG_(do_syscall4)(__NR_llseek, fd, in VG_()
305 return sr_isError(res) ? (-1) : ((ULong)sr_ResHI(res) << 32 | sr_Res(res)); in VG_()
307 SysRes res = VG_(do_syscall3)(__NR_lseek, fd, offset, whence); in VG_()
309 return sr_isError(res) ? (-1) : sr_Res(res); in VG_()
344 SysRes res; in VG_() local
352 res = VG_(do_syscall2)(__NR_stat64, (UWord)file_name, (UWord)&buf64); in VG_()
353 if (!(sr_isError(res) && sr_Err(res) == VKI_ENOSYS)) { in VG_()
355 if (!sr_isError(res)) in VG_()
357 return res; in VG_()
364 res = VG_(do_syscall3)(__NR3264_fstatat, VKI_AT_FDCWD, in VG_()
367 res = VG_(do_syscall2)(__NR_stat, (UWord)file_name, (UWord)&buf); in VG_()
369 if (!sr_isError(res)) in VG_()
371 return res; in VG_()
377 res = VG_(do_syscall4)(__NR_fstatat64, VKI_AT_FDCWD, (UWord)file_name, in VG_()
381 res = VG_(do_syscall4)(__NR_fstatat, VKI_AT_FDCWD, (UWord)file_name, in VG_()
386 if (!sr_isError(res)) in VG_()
388 return res; in VG_()
397 SysRes res; in VG_() local
405 res = VG_(do_syscall2)(__NR_fstat64, (UWord)fd, (UWord)&buf64); in VG_()
406 if (!(sr_isError(res) && sr_Err(res) == VKI_ENOSYS)) { in VG_()
408 if (!sr_isError(res)) in VG_()
410 return sr_isError(res) ? (-1) : 0; in VG_()
415 res = VG_(do_syscall2)(__NR_fstat, (UWord)fd, (UWord)&buf); in VG_()
416 if (!sr_isError(res)) in VG_()
418 return sr_isError(res) ? (-1) : 0; in VG_()
424 res = VG_(do_syscall4)(__NR_fstatat64, (UWord)fd, 0, (UWord)&buf64, 0); in VG_()
427 res = VG_(do_syscall4)(__NR_fstatat, (UWord)fd, 0, (UWord)&buf64, 0); in VG_()
431 if (!sr_isError(res)) in VG_()
433 return sr_isError(res) ? (-1) : 0; in VG_()
446 Int res = VG_(fstat)( fd, &buf ); in VG_() local
447 return (res == -1) ? (-1LL) : buf.size; in VG_()
452 SysRes res; in VG_() local
454 res = VG_(do_syscall4)(__NR_getxattr, (UWord)file_name, (UWord)attr_name, in VG_()
457 res = VG_(mk_SysRes_Error)(VKI_ENOSYS); in VG_()
459 return res; in VG_()
465 SysRes res = VG_(stat)(f, &buf); in VG_() local
466 return sr_isError(res) ? False in VG_()
496 SysRes res = VG_(do_syscall3)(__NR_fcntl, fd, cmd, arg); in VG_() local
498 SysRes res = VG_(do_syscall3)(__NR_fcntl_nocancel, fd, cmd, arg); in VG_()
502 return sr_isError(res) ? -1 : sr_Res(res); in VG_()
508 SysRes res = VG_(do_syscall3)(__NR_renameat, VKI_AT_FDCWD, in VG_() local
511 SysRes res = VG_(do_syscall2)(__NR_rename, (UWord)old_name, (UWord)new_name); in VG_()
513 SysRes res = VG_(do_syscall4)(__NR_renameat, VKI_AT_FDCWD, (UWord)old_name, in VG_()
518 return sr_isError(res) ? (-1) : 0; in VG_()
524 SysRes res = VG_(do_syscall2)(__NR_unlinkat, VKI_AT_FDCWD, in VG_() local
527 SysRes res = VG_(do_syscall1)(__NR_unlink, (UWord)file_name); in VG_()
529 SysRes res = VG_(do_syscall3)(__NR_unlinkat, VKI_AT_FDCWD, in VG_()
534 return sr_isError(res) ? (-1) : 0; in VG_()
554 SysRes res; in VG_() local
560 res = VG_(do_syscall2)(__NR_getcwd, (UWord)startup_wd, szB-1); in VG_()
561 } while (sr_isError(res)); in VG_()
601 SysRes res; in VG_() local
609 res = VG_(do_syscall4)(__NR_ppoll, in VG_()
614 res = VG_(do_syscall3)(__NR_poll, (UWord)fds, nfds, timeout); in VG_()
616 res = VG_(do_syscall3)(__NR_poll_nocancel, (UWord)fds, nfds, timeout); in VG_()
629 res = VG_(do_syscall4)(__NR_pollsys, (UWord)fds, nfds, (UWord)tsp, 0); in VG_()
633 return res; in VG_()
643 SysRes res; in VG_() local
646 res = VG_(do_syscall4)(__NR_readlinkat, VKI_AT_FDCWD, in VG_()
649 res = VG_(do_syscall3)(__NR_readlink, (UWord)path, (UWord)buf, bufsiz); in VG_()
651 res = VG_(do_syscall4)(__NR_readlinkat, VKI_AT_FDCWD, (UWord)path, in VG_()
656 return sr_isError(res) ? -1 : sr_Res(res); in VG_()
662 SysRes res; in VG_() local
667 res = VG_(do_syscall3)(__NR_getdents, fd, (UWord)dirp, count); in VG_()
669 res = VG_(do_syscall3)(__NR_getdents64, fd, (UWord)dirp, count); in VG_()
671 return sr_isError(res) ? -1 : sr_Res(res); in VG_()
693 SysRes res = VG_(do_syscall3)(__NR_faccessat, VKI_AT_FDCWD, (UWord)path, w); in VG_() local
695 SysRes res = VG_(do_syscall2)(__NR_access, (UWord)path, w); in VG_() local
697 SysRes res = VG_(do_syscall4)(__NR_faccessat, VKI_AT_FDCWD, (UWord)path, in VG_() local
702 return sr_isError(res) ? 1 : 0; in VG_()
735 SysRes res = VG_(stat)(f, &st); in VG_() local
740 if (sr_isError(res)) { in VG_()
741 return sr_Err(res); in VG_()
754 res = VG_(getxattr)(f, "security.capability", (Addr)0, 0); in VG_()
755 if (!sr_isError(res) && !allow_setuid) { in VG_()
805 SysRes res; in VG_() local
810 res = VG_(do_syscall5)(__NR_pread64, fd, (UWord)buf, count, in VG_()
812 return res; in VG_()
815 res = VG_(do_syscall5)(__NR_pread64, fd, (UWord)buf, count, in VG_()
817 return res; in VG_()
820 res = VG_(do_syscall6)(__NR_pread64, fd, (UWord)buf, count, in VG_()
823 return res; in VG_()
826 res = VG_(do_syscall6)(__NR_pread64, fd, (UWord)buf, count, in VG_()
828 return res; in VG_()
831 res = VG_(do_syscall6)(__NR_pread64, fd, (UWord)buf, count, in VG_()
833 return res; in VG_()
838 res = VG_(do_syscall4)(__NR_pread64, fd, (UWord)buf, count, offset); in VG_()
839 return res; in VG_()
842 res = VG_(do_syscall4)(__NR_pread_nocancel, fd, (UWord)buf, count, offset); in VG_()
843 return res; in VG_()
846 res = VG_(do_syscall5)(__NR_pread_nocancel, fd, (UWord)buf, count, in VG_()
848 return res; in VG_()
851 res = VG_(do_syscall4)(__NR_pread, fd, (UWord)buf, count, offset); in VG_()
852 return res; in VG_()
855 res = VG_(do_syscall4)(__NR_pread, fd, (UWord)buf, count, offset); in VG_()
856 return res; in VG_()
992 Int sd, res; in VG_() local
1018 res = my_connect(sd, &servAddr, sizeof(servAddr)); in VG_()
1019 if (res < 0) { in VG_()
1082 SysRes res; in VG_() local
1087 res = VG_(do_syscall2)(__NR_socketcall, VKI_SYS_SOCKET, (UWord)&args); in VG_()
1088 return sr_isError(res) ? -1 : sr_Res(res); in VG_()
1093 SysRes res; in VG_()
1094 res = VG_(do_syscall3)(__NR_socket, domain, type, protocol ); in VG_()
1095 return sr_isError(res) ? -1 : sr_Res(res); in VG_()
1098 SysRes res; in VG_()
1099 res = VG_(do_syscall3)(__NR_socket, domain, type, protocol); in VG_()
1100 if (!sr_isError(res)) { in VG_()
1104 res2 = VG_(do_syscall5)(__NR_setsockopt, sr_Res(res), VKI_SOL_SOCKET, in VG_()
1109 return sr_isError(res) ? -1 : sr_Res(res); in VG_()
1120 SysRes res; in VG_()
1121 res = VG_(do_syscall5)(__NR_so_socket, domain, type, protocol, in VG_()
1123 return sr_isError(res) ? -1 : sr_Res(res); in VG_()
1137 SysRes res; in my_connect() local
1142 res = VG_(do_syscall2)(__NR_socketcall, VKI_SYS_CONNECT, (UWord)&args); in my_connect()
1143 return sr_isError(res) ? -1 : sr_Res(res); in my_connect()
1148 SysRes res; in my_connect()
1149 res = VG_(do_syscall3)(__NR_connect, sockfd, (UWord)serv_addr, addrlen); in my_connect()
1150 return sr_isError(res) ? -1 : sr_Res(res); in my_connect()
1153 SysRes res; in my_connect()
1154 res = VG_(do_syscall3)(__NR_connect_nocancel, in my_connect()
1156 return sr_isError(res) ? -1 : sr_Res(res); in my_connect()
1159 SysRes res; in my_connect()
1160 res = VG_(do_syscall4)(__NR_connect, sockfd, (UWord)serv_addr, addrlen, in my_connect()
1162 return sr_isError(res) ? -1 : sr_Res(res); in my_connect()
1183 SysRes res; in VG_() local
1189 res = VG_(do_syscall2)(__NR_socketcall, VKI_SYS_SEND, (UWord)&args); in VG_()
1190 return sr_isError(res) ? -1 : sr_Res(res); in VG_()
1195 SysRes res; in VG_()
1196 res = VG_(do_syscall6)(__NR_sendto, sd, (UWord)msg, in VG_()
1198 return sr_isError(res) ? -1 : sr_Res(res); in VG_()
1201 SysRes res; in VG_()
1202 res = VG_(do_syscall3)(__NR_write_nocancel, sd, (UWord)msg, count); in VG_()
1203 return sr_isError(res) ? -1 : sr_Res(res); in VG_()
1206 SysRes res; in VG_()
1207 res = VG_(do_syscall4)(__NR_send, sd, (UWord)msg, count, 0 /*flags*/); in VG_()
1208 return sr_isError(res) ? -1 : sr_Res(res); in VG_()
1221 SysRes res; in VG_() local
1226 res = VG_(do_syscall2)(__NR_socketcall, VKI_SYS_GETSOCKNAME, (UWord)&args); in VG_()
1227 return sr_isError(res) ? -1 : sr_Res(res); in VG_()
1232 SysRes res; in VG_()
1233 res = VG_(do_syscall3)( __NR_getsockname, in VG_()
1235 return sr_isError(res) ? -1 : sr_Res(res); in VG_()
1238 SysRes res; in VG_()
1239 res = VG_(do_syscall3)( __NR_getsockname, in VG_()
1241 return sr_isError(res) ? -1 : sr_Res(res); in VG_()
1244 SysRes res; in VG_()
1245 res = VG_(do_syscall4)(__NR_getsockname, sd, (UWord)name, (UWord)namelen, in VG_()
1247 return sr_isError(res) ? -1 : sr_Res(res); in VG_()
1260 SysRes res; in VG_() local
1265 res = VG_(do_syscall2)(__NR_socketcall, VKI_SYS_GETPEERNAME, (UWord)&args); in VG_()
1266 return sr_isError(res) ? -1 : sr_Res(res); in VG_()
1271 SysRes res; in VG_()
1272 res = VG_(do_syscall3)( __NR_getpeername, in VG_()
1274 return sr_isError(res) ? -1 : sr_Res(res); in VG_()
1277 SysRes res; in VG_()
1278 res = VG_(do_syscall3)( __NR_getpeername, in VG_()
1280 return sr_isError(res) ? -1 : sr_Res(res); in VG_()
1283 SysRes res; in VG_()
1284 res = VG_(do_syscall4)(__NR_getpeername, sd, (UWord)name, (UWord)namelen, in VG_()
1286 return sr_isError(res) ? -1 : sr_Res(res); in VG_()
1299 SysRes res; in VG_() local
1306 res = VG_(do_syscall2)(__NR_socketcall, VKI_SYS_GETSOCKOPT, (UWord)&args); in VG_()
1307 return sr_isError(res) ? -1 : sr_Res(res); in VG_()
1312 SysRes res; in VG_()
1313 res = VG_(do_syscall5)( __NR_getsockopt, in VG_()
1316 return sr_isError(res) ? -1 : sr_Res(res); in VG_()
1319 SysRes res; in VG_()
1320 res = VG_(do_syscall5)( __NR_getsockopt, in VG_()
1323 return sr_isError(res) ? -1 : sr_Res(res); in VG_()
1326 SysRes res; in VG_()
1327 res = VG_(do_syscall6)(__NR_getsockopt, sd, level, optname, (UWord)optval, in VG_()
1329 return sr_isError(res) ? -1 : sr_Res(res); in VG_()
1343 SysRes res; in VG_() local
1350 res = VG_(do_syscall2)(__NR_socketcall, VKI_SYS_SETSOCKOPT, (UWord)&args); in VG_()
1351 return sr_isError(res) ? -1 : sr_Res(res); in VG_()
1356 SysRes res; in VG_()
1357 res = VG_(do_syscall5)( __NR_setsockopt, in VG_()
1360 return sr_isError(res) ? -1 : sr_Res(res); in VG_()
1363 SysRes res; in VG_()
1364 res = VG_(do_syscall5)( __NR_setsockopt, in VG_()
1367 return sr_isError(res) ? -1 : sr_Res(res); in VG_()
1370 SysRes res; in VG_()
1371 res = VG_(do_syscall6)( __NR_setsockopt, in VG_()
1375 return sr_isError(res) ? -1 : sr_Res(res); in VG_()