Lines Matching refs:res

246   void *res = REAL(memchr)(s, c, n);
247 uptr len = res ? (char*)res - (char*)s + 1 : n;
249 return res;
276 double res = REAL(frexp)(x, exp);
277 return res;
292 float res = REAL(frexpf)(x, exp);
294 return res;
303 long double res = REAL(frexpl)(x, exp);
305 return res;
344 SSIZE_T res = REAL(read)(fd, ptr, count);
345 if (res > 0) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, ptr, res);
346 if (res >= 0 && fd >= 0) COMMON_INTERCEPTOR_FD_ACQUIRE(ctx, fd);
347 return res;
362 SSIZE_T res = REAL(pread)(fd, ptr, count, offset);
363 if (res > 0) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, ptr, res);
364 if (res >= 0 && fd >= 0) COMMON_INTERCEPTOR_FD_ACQUIRE(ctx, fd);
365 return res;
380 SSIZE_T res = REAL(pread64)(fd, ptr, count, offset);
381 if (res > 0) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, ptr, res);
382 if (res >= 0 && fd >= 0) COMMON_INTERCEPTOR_FD_ACQUIRE(ctx, fd);
383 return res;
396 SSIZE_T res = REAL(readv)(fd, iov, iovcnt);
397 if (res > 0) write_iovec(ctx, iov, iovcnt, res);
398 if (res >= 0 && fd >= 0) COMMON_INTERCEPTOR_FD_ACQUIRE(ctx, fd);
399 return res;
412 SSIZE_T res = REAL(preadv)(fd, iov, iovcnt, offset);
413 if (res > 0) write_iovec(ctx, iov, iovcnt, res);
414 if (res >= 0 && fd >= 0) COMMON_INTERCEPTOR_FD_ACQUIRE(ctx, fd);
415 return res;
428 SSIZE_T res = REAL(preadv64)(fd, iov, iovcnt, offset);
429 if (res > 0) write_iovec(ctx, iov, iovcnt, res);
430 if (res >= 0 && fd >= 0) COMMON_INTERCEPTOR_FD_ACQUIRE(ctx, fd);
431 return res;
444 SSIZE_T res = REAL(write)(fd, ptr, count);
446 if (res > 0) COMMON_INTERCEPTOR_READ_RANGE(ctx, ptr, res);
447 return res;
460 SSIZE_T res = REAL(pwrite)(fd, ptr, count, offset);
461 if (res > 0) COMMON_INTERCEPTOR_READ_RANGE(ctx, ptr, res);
462 return res;
476 SSIZE_T res = REAL(pwrite64)(fd, ptr, count, offset);
477 if (res > 0) COMMON_INTERCEPTOR_READ_RANGE(ctx, ptr, res);
478 return res;
492 SSIZE_T res = REAL(writev)(fd, iov, iovcnt);
493 if (res > 0) read_iovec(ctx, iov, iovcnt, res);
494 return res;
508 SSIZE_T res = REAL(pwritev)(fd, iov, iovcnt, offset);
509 if (res > 0) read_iovec(ctx, iov, iovcnt, res);
510 return res;
524 SSIZE_T res = REAL(pwritev64)(fd, iov, iovcnt, offset);
525 if (res > 0) read_iovec(ctx, iov, iovcnt, res);
526 return res;
540 int res = REAL(prctl(option, arg2, arg3, arg4, arg5));
547 return res;
559 unsigned long res = REAL(time)(&local_t);
560 if (t && res != (unsigned long)-1) {
564 return res;
584 __sanitizer_tm *res = REAL(localtime)(timep);
585 if (res) {
587 unpoison_tm(ctx, res);
589 return res;
594 __sanitizer_tm *res = REAL(localtime_r)(timep, result);
595 if (res) {
597 unpoison_tm(ctx, res);
599 return res;
604 __sanitizer_tm *res = REAL(gmtime)(timep);
605 if (res) {
607 unpoison_tm(ctx, res);
609 return res;
614 __sanitizer_tm *res = REAL(gmtime_r)(timep, result);
615 if (res) {
617 unpoison_tm(ctx, res);
619 return res;
627 char *res = REAL(ctime)(timep);
628 if (res) {
630 COMMON_INTERCEPTOR_WRITE_RANGE(ctx, res, REAL(strlen)(res) + 1);
632 return res;
640 char *res = REAL(ctime_r)(timep, result);
641 if (res) {
643 COMMON_INTERCEPTOR_WRITE_RANGE(ctx, res, REAL(strlen)(res) + 1);
645 return res;
653 char *res = REAL(asctime)(tm);
654 if (res) {
656 COMMON_INTERCEPTOR_WRITE_RANGE(ctx, res, REAL(strlen)(res) + 1);
658 return res;
666 char *res = REAL(asctime_r)(tm, result);
667 if (res) {
669 COMMON_INTERCEPTOR_WRITE_RANGE(ctx, res, REAL(strlen)(res) + 1);
671 return res;
683 long res = REAL(mktime)(tm);
684 if (res != -1) unpoison_tm(ctx, tm);
685 return res;
710 char *res = REAL(strptime)(s, format, tm);
711 if (res) {
712 COMMON_INTERCEPTOR_READ_RANGE(ctx, s, res - s);
718 return res;
734 int res = WRAP(vname)(__VA_ARGS__, ap); \
736 return res; \
749 int res = REAL(vname)(__VA_ARGS__); \
750 if (res > 0) \
751 scanf_common(ctx, res, allowGnuMalloc, format, aq); \
753 return res; \
839 int res = REAL(vname)(__VA_ARGS__); \
841 return res; \
853 int res = REAL(vname)(str, __VA_ARGS__); \
854 if (res >= 0) { \
855 COMMON_INTERCEPTOR_WRITE_RANGE(ctx, str, res + 1); \
858 return res; \
870 int res = REAL(vname)(str, size, __VA_ARGS__); \
871 if (res >= 0) { \
872 COMMON_INTERCEPTOR_WRITE_RANGE(ctx, str, Min(size, (SIZE_T)(res + 1))); \
875 return res; \
888 int res = REAL(vname)(strp, __VA_ARGS__); \
889 if (res >= 0) { \
890 COMMON_INTERCEPTOR_WRITE_RANGE(ctx, *strp, res + 1); \
893 return res; \
1020 int res = REAL(ioctl)(d, request, arg);
1022 if (desc && res != -1) ioctl_common_post(ctx, desc, res, d, request, arg);
1023 return res;
1087 __sanitizer_passwd *res = REAL(getpwnam)(name);
1088 if (res != 0) unpoison_passwd(ctx, res);
1089 return res;
1094 __sanitizer_passwd *res = REAL(getpwuid)(uid);
1095 if (res != 0) unpoison_passwd(ctx, res);
1096 return res;
1102 __sanitizer_group *res = REAL(getgrnam)(name);
1103 if (res != 0) unpoison_group(ctx, res);
1104 return res;
1109 __sanitizer_group *res = REAL(getgrgid)(gid);
1110 if (res != 0) unpoison_group(ctx, res);
1111 return res;
1131 int res = REAL(getpwnam_r)(name, pwd, buf, buflen, result);
1132 if (!res) {
1137 return res;
1146 int res = REAL(getpwuid_r)(uid, pwd, buf, buflen, result);
1147 if (!res) {
1152 return res;
1162 int res = REAL(getgrnam_r)(name, grp, buf, buflen, result);
1163 if (!res) {
1168 return res;
1177 int res = REAL(getgrgid_r)(gid, grp, buf, buflen, result);
1178 if (!res) {
1183 return res;
1198 __sanitizer_passwd *res = REAL(getpwent)(dummy);
1199 if (res != 0) unpoison_passwd(ctx, res);
1200 return res;
1205 __sanitizer_group *res = REAL(getgrent)(dummy);
1206 if (res != 0) unpoison_group(ctx, res);;
1207 return res;
1220 __sanitizer_passwd *res = REAL(fgetpwent)(fp);
1221 if (res != 0) unpoison_passwd(ctx, res);
1222 return res;
1227 __sanitizer_group *res = REAL(fgetgrent)(fp);
1228 if (res != 0) unpoison_group(ctx, res);
1229 return res;
1246 int res = REAL(getpwent_r)(pwbuf, buf, buflen, pwbufp);
1247 if (!res) {
1252 return res;
1261 int res = REAL(fgetpwent_r)(fp, pwbuf, buf, buflen, pwbufp);
1262 if (!res) {
1267 return res;
1276 int res = REAL(getgrent_r)(pwbuf, buf, buflen, pwbufp);
1277 if (!res) {
1282 return res;
1291 int res = REAL(fgetgrent_r)(fp, pwbuf, buf, buflen, pwbufp);
1292 if (!res) {
1297 return res;
1348 int res = REAL(clock_getres)(clk_id, tp);
1349 if (!res && tp) {
1352 return res;
1360 int res = REAL(clock_gettime)(clk_id, tp);
1361 if (!res) {
1364 return res;
1387 int res = REAL(getitimer)(which, curr_value);
1388 if (!res && curr_value) {
1391 return res;
1401 int res = REAL(setitimer)(which, new_value, old_value);
1402 if (!res && old_value) {
1405 return res;
1474 int res = REAL(glob)(pattern, flags, errfunc, pglob);
1483 if ((!res || res == glob_nomatch) && pglob) unpoison_glob_t(ctx, pglob);
1484 return res;
1504 int res = REAL(glob64)(pattern, flags, errfunc, pglob);
1513 if ((!res || res == glob_nomatch) && pglob) unpoison_glob_t(ctx, pglob);
1514 return res;
1533 int res = REAL(wait)(status);
1534 if (res != -1 && status)
1536 return res;
1545 int res = REAL(waitid)(idtype, id, infop, options);
1546 if (res != -1 && infop)
1548 return res;
1556 int res = REAL(waitpid)(pid, status, options);
1557 if (res != -1 && status)
1559 return res;
1567 int res = REAL(wait3)(status, options, rusage);
1568 if (res != -1) {
1572 return res;
1581 int res = REAL(__wait4)(pid, status, options, rusage);
1582 if (res != -1) {
1586 return res;
1596 int res = REAL(wait4)(pid, status, options, rusage);
1597 if (res != -1) {
1601 return res;
1625 char *res = REAL(inet_ntop)(af, src, dst, size);
1626 if (res) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, res, REAL(strlen)(res) + 1);
1627 return res;
1636 int res = REAL(inet_pton)(af, src, dst);
1637 if (res == 1) {
1641 return res;
1658 int res = REAL(inet_aton)(cp, dst);
1659 if (res != 0) {
1663 return res;
1677 int res = REAL(pthread_getschedparam)(thread, policy, param);
1678 if (res == 0) {
1682 return res;
1704 int res = REAL(getaddrinfo)(node, service, hints, out);
1705 if (res == 0 && out) {
1718 return res;
1736 int res =
1738 if (res == 0) {
1744 return res;
1760 int res = REAL(getsockname)(sock_fd, addr, addrlen);
1761 if (res == 0) {
1764 return res;
1797 struct __sanitizer_hostent *res = REAL(gethostbyname)(name);
1798 if (res) write_hostent(ctx, res);
1799 return res;
1807 struct __sanitizer_hostent *res = REAL(gethostbyaddr)(addr, len, type);
1808 if (res) write_hostent(ctx, res);
1809 return res;
1815 struct __sanitizer_hostent *res = REAL(gethostent)(fake);
1816 if (res) write_hostent(ctx, res);
1817 return res;
1823 struct __sanitizer_hostent *res = REAL(gethostbyname2)(name, af);
1824 if (res) write_hostent(ctx, res);
1825 return res;
1846 int res = REAL(gethostbyname_r)(name, ret, buf, buflen, result, h_errnop);
1849 if (res == 0 && *result) write_hostent(ctx, *result);
1853 return res;
1869 int res = REAL(gethostent_r)(ret, buf, buflen, result, h_errnop);
1872 if (res == 0 && *result) write_hostent(ctx, *result);
1876 return res;
1895 int res = REAL(gethostbyaddr_r)(addr, len, type, ret, buf, buflen, result,
1899 if (res == 0 && *result) write_hostent(ctx, *result);
1903 return res;
1921 int res =
1925 if (res == 0 && *result) write_hostent(ctx, *result);
1929 return res;
1947 int res = REAL(getsockopt)(sockfd, level, optname, optval, optlen);
1948 if (res == 0)
1950 return res;
2011 double res = REAL(modf)(x, iptr);
2015 return res;
2023 float res = REAL(modff)(x, iptr);
2027 return res;
2035 long double res = REAL(modfl)(x, iptr);
2039 return res;
2070 SSIZE_T res = REAL(recvmsg)(fd, msg, flags);
2071 if (res >= 0) {
2074 write_msghdr(ctx, msg, res);
2078 return res;
2094 int res = REAL(getpeername)(sockfd, addr, addrlen);
2095 if (!res && addr && addrlen)
2097 return res;
2111 int res = REAL(sysinfo)(info);
2112 if (!res && info)
2114 return res;
2128 __sanitizer_dirent *res = REAL(readdir)(dirp);
2129 if (res) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, res, res->d_reclen);
2130 return res;
2140 int res = REAL(readdir_r)(dirp, entry, result);
2141 if (!res) {
2146 return res;
2163 __sanitizer_dirent64 *res = REAL(readdir64)(dirp);
2164 if (res) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, res, res->d_reclen);
2165 return res;
2175 int res = REAL(readdir64_r)(dirp, entry, result);
2176 if (!res) {
2181 return res;
2213 uptr res = REAL(ptrace)(request, pid, addr, data);
2215 if (!res && data) {
2233 return res;
2247 char *res = REAL(setlocale)(category, locale);
2248 if (res) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, res, REAL(strlen)(res) + 1);
2249 return res;
2264 char *res = REAL(getcwd)(buf, size);
2265 if (res) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, res, REAL(strlen)(res) + 1);
2266 return res;
2280 char *res = REAL(get_current_dir_name)(fake);
2281 if (res) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, res, REAL(strlen)(res) + 1);
2282 return res;
2298 INTMAX_T res = REAL(strtoimax)(nptr, endptr, base);
2300 return res;
2309 INTMAX_T res = REAL(strtoumax)(nptr, endptr, base);
2311 return res;
2328 SIZE_T res = REAL(mbstowcs)(dest, src, len);
2329 if (res != (SIZE_T) - 1 && dest) {
2330 SIZE_T write_cnt = res + (res < len);
2333 return res;
2345 SIZE_T res = REAL(mbsrtowcs)(dest, src, len, ps);
2346 if (res != (SIZE_T)(-1) && dest && src) {
2349 SIZE_T write_cnt = res + !*src;
2352 return res;
2375 SIZE_T res = REAL(mbsnrtowcs)(dest, src, nms, len, ps);
2376 if (res != (SIZE_T)(-1) && dest && src) {
2377 SIZE_T write_cnt = res + !*src;
2380 return res;
2395 SIZE_T res = REAL(wcstombs)(dest, src, len);
2396 if (res != (SIZE_T) - 1 && dest) {
2397 SIZE_T write_cnt = res + (res < len);
2400 return res;
2412 SIZE_T res = REAL(wcsrtombs)(dest, src, len, ps);
2413 if (res != (SIZE_T) - 1 && dest && src) {
2414 SIZE_T write_cnt = res + !*src;
2417 return res;
2440 SIZE_T res = REAL(wcsnrtombs)(dest, src, nms, len, ps);
2441 if (res != (SIZE_T) - 1 && dest && src) {
2442 SIZE_T write_cnt = res + !*src;
2445 return res;
2460 int res = REAL(tcgetattr)(fd, termios_p);
2461 if (!res && termios_p)
2463 return res;
2485 char *res = REAL(realpath)(path, resolved_path);
2486 if (allocated_path && !res) WRAP(free)(allocated_path);
2487 if (res) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, res, REAL(strlen)(res) + 1);
2488 return res;
2500 char *res = REAL(canonicalize_file_name)(path);
2501 if (res) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, res, REAL(strlen)(res) + 1);
2502 return res;
2517 SIZE_T res = REAL(confstr)(name, buf, len);
2518 if (buf && res)
2519 COMMON_INTERCEPTOR_WRITE_RANGE(ctx, buf, res < len ? res : len);
2520 return res;
2534 int res = REAL(sched_getaffinity)(pid, cpusetsize, mask);
2535 if (mask && !res) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, mask, cpusetsize);
2536 return res;
2547 char *res = REAL(strerror)(errnum);
2548 if (res) COMMON_INTERCEPTOR_INITIALIZE_RANGE(res, REAL(strlen)(res) + 1);
2549 return res;
2563 char *res = REAL(strerror_r)(errnum, buf, buflen);
2569 SIZE_T posix_res = (SIZE_T)res;
2578 COMMON_INTERCEPTOR_WRITE_RANGE(ctx, res, REAL(strlen)(res) + 1);
2580 return res;
2594 int res = REAL(__xpg_strerror_r)(errnum, buf, buflen);
2598 return res;
2639 int res = REAL(scandir)(dirp, namelist, filter ? wrapped_scandir_filter : 0,
2643 if (namelist && res > 0) {
2645 COMMON_INTERCEPTOR_WRITE_RANGE(ctx, *namelist, sizeof(**namelist) * res);
2646 for (int i = 0; i < res; ++i)
2650 return res;
2691 int res =
2696 if (namelist && res > 0) {
2698 COMMON_INTERCEPTOR_WRITE_RANGE(ctx, *namelist, sizeof(**namelist) * res);
2699 for (int i = 0; i < res; ++i)
2703 return res;
2717 int res = REAL(getgroups)(size, lst);
2718 if (res && lst) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, lst, res * sizeof(*lst));
2719 return res;
2747 int res = COMMON_INTERCEPTOR_BLOCK_REAL(poll)(fds, nfds, timeout);
2749 return res;
2765 int res =
2768 return res;
2783 int res = REAL(wordexp)(s, p, flags);
2784 if (!res && p) {
2794 return res;
2809 int res = REAL(sigwait)(set, sig);
2810 if (!res && sig) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, sig, sizeof(*sig));
2811 return res;
2826 int res = REAL(sigwaitinfo)(set, info);
2827 if (res > 0 && info) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, info, siginfo_t_sz);
2828 return res;
2845 int res = REAL(sigtimedwait)(set, info, timeout);
2846 if (res > 0 && info) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, info, siginfo_t_sz);
2847 return res;
2861 int res = REAL(sigemptyset)(set);
2862 if (!res && set) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, set, sizeof(*set));
2863 return res;
2872 int res = REAL(sigfillset)(set);
2873 if (!res && set) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, set, sizeof(*set));
2874 return res;
2890 int res = REAL(sigpending)(set);
2891 if (!res && set) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, set, sizeof(*set));
2892 return res;
2908 int res = REAL(sigprocmask)(how, set, oldset);
2909 if (!res && oldset)
2911 return res;
2925 int res = REAL(backtrace)(buffer, size);
2926 if (res && buffer)
2927 COMMON_INTERCEPTOR_WRITE_RANGE(ctx, buffer, res * sizeof(*buffer));
2928 return res;
2939 char **res = REAL(backtrace_symbols)(buffer, size);
2940 if (res && size) {
2941 COMMON_INTERCEPTOR_WRITE_RANGE(ctx, res, size * sizeof(*res));
2943 COMMON_INTERCEPTOR_WRITE_RANGE(ctx, res[i], REAL(strlen(res[i])) + 1);
2945 return res;
2971 int res = REAL(pthread_mutex_lock)(m);
2972 if (res == errno_EOWNERDEAD)
2974 if (res == 0 || res == errno_EOWNERDEAD)
2976 return res;
3016 __sanitizer_mntent *res = REAL(getmntent)(fp);
3017 if (res) write_mntent(ctx, res);
3018 return res;
3030 __sanitizer_mntent *res = REAL(getmntent_r)(fp, mntbuf, buf, buflen);
3031 if (res) write_mntent(ctx, res);
3032 return res;
3047 int res = REAL(statfs)(path, buf);
3048 if (!res) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, buf, struct_statfs_sz);
3049 return res;
3057 int res = REAL(fstatfs)(fd, buf);
3058 if (!res) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, buf, struct_statfs_sz);
3059 return res;
3076 int res = REAL(statfs64)(path, buf);
3077 if (!res) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, buf, struct_statfs64_sz);
3078 return res;
3086 int res = REAL(fstatfs64)(fd, buf);
3087 if (!res) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, buf, struct_statfs64_sz);
3088 return res;
3105 int res = REAL(statvfs)(path, buf);
3106 if (!res) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, buf, struct_statvfs_sz);
3107 return res;
3115 int res = REAL(fstatvfs)(fd, buf);
3116 if (!res) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, buf, struct_statvfs_sz);
3117 return res;
3134 int res = REAL(statvfs64)(path, buf);
3135 if (!res) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, buf, struct_statvfs64_sz);
3136 return res;
3144 int res = REAL(fstatvfs64)(fd, buf);
3145 if (!res) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, buf, struct_statvfs64_sz);
3146 return res;
3160 int res = REAL(initgroups)(user, group);
3161 return res;
3173 char *res = REAL(ether_ntoa)(addr);
3174 if (res) COMMON_INTERCEPTOR_INITIALIZE_RANGE(res, REAL(strlen)(res) + 1);
3175 return res;
3181 __sanitizer_ether_addr *res = REAL(ether_aton)(buf);
3182 if (res) COMMON_INTERCEPTOR_INITIALIZE_RANGE(res, sizeof(*res));
3183 return res;
3200 int res = REAL(ether_ntohost)(hostname, addr);
3201 if (!res && hostname)
3203 return res;
3213 int res = REAL(ether_hostton)(hostname, addr);
3214 if (!res && addr) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, addr, sizeof(*addr));
3215 return res;
3225 int res = REAL(ether_line)(line, addr, hostname);
3226 if (!res) {
3231 return res;
3249 char *res = REAL(ether_ntoa_r)(addr, buf);
3250 if (res) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, res, REAL(strlen)(res) + 1);
3251 return res;
3261 __sanitizer_ether_addr *res = REAL(ether_aton_r)(buf, addr);
3262 if (res) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, res, sizeof(*res));
3263 return res;
3279 int res = REAL(shmctl)(shmid, cmd, buf);
3280 if (res >= 0) {
3290 return res;
3304 int res = REAL(random_r)(buf, result);
3305 if (!res && result)
3307 return res;
3327 int res = REAL(fn)(attr, r); \
3328 if (!res && r) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, r, sz); \
3329 return res; \
3356 int res = REAL(pthread_attr_getstack)(attr, addr, size);
3357 if (!res) {
3361 return res;
3405 int res = REAL(pthread_attr_getaffinity_np)(attr, cpusetsize, cpuset);
3406 if (!res && cpusetsize && cpuset)
3408 return res;
3509 char *res = REAL(tmpnam)(s);
3510 if (res) {
3517 COMMON_INTERCEPTOR_INITIALIZE_RANGE(res, REAL(strlen)(res) + 1);
3519 return res;
3533 char *res = REAL(tmpnam_r)(s);
3534 if (res && s) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, s, REAL(strlen)(s) + 1);
3535 return res;
3548 char *res = REAL(tempnam)(dir, pfx);
3549 if (res) COMMON_INTERCEPTOR_INITIALIZE_RANGE(res, REAL(strlen)(res) + 1);
3550 return res;
3615 double res = REAL(remquo)(x, y, quo);
3617 return res;
3625 float res = REAL(remquof)(x, y, quo);
3627 return res;
3635 long double res = REAL(remquol)(x, y, quo);
3637 return res;
3652 double res = REAL(lgamma)(x);
3654 return res;
3659 float res = REAL(lgammaf)(x);
3661 return res;
3666 long double res = REAL(lgammal)(x);
3668 return res;
3685 double res = REAL(lgamma_r)(x, signp);
3687 return res;
3695 float res = REAL(lgammaf_r)(x, signp);
3697 return res;
3713 long double res = REAL(lgammal_r)(x, signp);
3715 return res;
3729 int res = REAL(drand48_r)(buffer, result);
3731 return res;
3739 int res = REAL(lrand48_r)(buffer, result);
3741 return res;
3769 SSIZE_T res = REAL(getline)(lineptr, n, stream);
3770 if (res > 0) {
3773 COMMON_INTERCEPTOR_WRITE_RANGE(ctx, *lineptr, res + 1);
3775 return res;
3784 SSIZE_T res = REAL(__getdelim)(lineptr, n, delim, stream);
3785 if (res > 0) {
3788 COMMON_INTERCEPTOR_WRITE_RANGE(ctx, *lineptr, res + 1);
3790 return res;
3820 SIZE_T res = REAL(iconv)(cd, inbuf, inbytesleft, outbuf, outbytesleft);
3821 if (res != (SIZE_T) - 1 && outbuf && *outbuf > outbuf_orig) {
3825 return res;
3839 __sanitizer_clock_t res = REAL(times)(tms);
3840 if (res != (__sanitizer_clock_t)-1 && tms)
3842 return res;
3854 void *res = REAL(__tls_get_addr)(arg);
3855 DTLS::DTV *dtv = DTLS_on_tls_get_addr(arg, res);
3860 return res;
3874 SSIZE_T res = REAL(listxattr)(path, list, size);
3876 // buffer, and res contains the desired buffer size.
3877 if (size && res > 0 && list) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, list, res);
3878 return res;
3887 SSIZE_T res = REAL(llistxattr)(path, list, size);
3888 if (size && res > 0 && list) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, list, res);
3889 return res;
3897 SSIZE_T res = REAL(flistxattr)(fd, list, size);
3898 if (size && res > 0 && list) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, list, res);
3899 return res;
3919 SSIZE_T res = REAL(getxattr)(path, name, value, size);
3920 if (size && res > 0 && value) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, value, res);
3921 return res;
3932 SSIZE_T res = REAL(lgetxattr)(path, name, value, size);
3933 if (size && res > 0 && value) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, value, res);
3934 return res;
3944 SSIZE_T res = REAL(fgetxattr)(fd, name, value, size);
3945 if (size && res > 0 && value) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, value, res);
3946 return res;
3963 int res = REAL(getresuid)(ruid, euid, suid);
3964 if (res >= 0) {
3969 return res;
3977 int res = REAL(getresgid)(rgid, egid, sgid);
3978 if (res >= 0) {
3983 return res;
4002 int res = REAL(getifaddrs)(ifap);
4003 if (res == 0 && ifap) {
4023 return res;
4038 char *res = REAL(if_indextoname)(ifindex, ifname);
4039 if (res && ifname)
4041 return res;
4066 int res = REAL(capget)(hdrp, datap);
4067 if (res == 0 && datap)
4072 return res;
4167 int res = REAL(ftime)(tp);
4170 return res;
4213 int res = REAL(F)(xdrs, p); \
4214 if (res && p && xdrs->x_op == __sanitizer_XDR_DECODE) \
4216 return res; \
4261 int res = REAL(xdr_bytes)(xdrs, p, sizep, maxsize);
4265 if (res && *p && *sizep) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, *p, *sizep);
4267 return res;
4281 int res = REAL(xdr_string)(xdrs, p, maxsize);
4284 if (res && *p)
4287 return res;
4333 void *res = REAL(tsearch)(key, rootp, compar);
4334 if (res && *(void **)res == key)
4335 COMMON_INTERCEPTOR_WRITE_RANGE(ctx, res, sizeof(void *));
4336 return res;
4360 int res = REAL(__uflow)(fp);
4362 return res;
4367 int res = REAL(__underflow)(fp);
4369 return res;
4374 int res = REAL(__overflow)(fp, ch);
4376 return res;
4381 int res = REAL(__wuflow)(fp);
4383 return res;
4388 int res = REAL(__wunderflow)(fp);
4390 return res;
4395 int res = REAL(__woverflow)(fp, ch);
4397 return res;
4416 __sanitizer_FILE *res = REAL(fopen)(path, mode);
4417 COMMON_INTERCEPTOR_FILE_OPEN(ctx, res, path);
4418 if (res) unpoison_file(res);
4419 return res;
4425 __sanitizer_FILE *res = REAL(fdopen)(fd, mode);
4426 if (res) unpoison_file(res);
4427 return res;
4436 __sanitizer_FILE *res = REAL(freopen)(path, mode, fp);
4437 COMMON_INTERCEPTOR_FILE_OPEN(ctx, res, path);
4438 if (res) unpoison_file(res);
4439 return res;
4455 __sanitizer_FILE *res = REAL(fopen64)(path, mode);
4456 COMMON_INTERCEPTOR_FILE_OPEN(ctx, res, path);
4457 if (res) unpoison_file(res);
4458 return res;
4467 __sanitizer_FILE *res = REAL(freopen64)(path, mode, fp);
4468 COMMON_INTERCEPTOR_FILE_OPEN(ctx, res, path);
4469 if (res) unpoison_file(res);
4470 return res;
4486 __sanitizer_FILE *res = REAL(open_memstream)(ptr, sizeloc);
4487 if (res) {
4490 unpoison_file(res);
4492 SetInterceptorMetadata(res, file);
4494 return res;
4500 __sanitizer_FILE *res = REAL(open_wmemstream)(ptr, sizeloc);
4501 if (res) {
4504 unpoison_file(res);
4506 SetInterceptorMetadata(res, file);
4508 return res;
4517 __sanitizer_FILE *res = REAL(fmemopen)(buf, size, mode);
4518 if (res) unpoison_file(res);
4519 return res;
4543 int res = REAL(_obstack_begin_1)(obstack, sz, align, alloc_fn, free_fn);
4544 if (res) initialize_obstack(obstack);
4545 return res;
4552 int res = REAL(_obstack_begin)(obstack, sz, align, alloc_fn, free_fn);
4553 if (res) initialize_obstack(obstack);
4554 return res;
4576 int res = REAL(fflush)(fp);
4582 return res;
4612 void *res = REAL(dlopen)(filename, flag);
4613 COMMON_INTERCEPTOR_LIBRARY_LOADED(filename, res);
4614 return res;
4620 int res = REAL(dlclose)(handle);
4622 return res;