Lines Matching defs:buf
206 int handle_asan_path_open(int fd, const char *name, ns_t *namespace, char *buf, size_t buf_size);
1335 UT_STATIC bool get_random(void *buf, size_t buflen)
1343 ret = read(fd, buf, buflen);
1353 UT_STATIC void fill_random_data(void *buf, size_t buflen)
1360 if (!get_random(buf, buflen)) {
1365 memcpy((char *)buf + pos, &x, sizeof(x));
1377 char buf[HUGEPAGES_SUPPORTED_STR_SIZE] = {'0'};
1383 read_size = read(fd, buf, HUGEPAGES_SUPPORTED_STR_SIZE - 1);
1387 buf[HUGEPAGES_SUPPORTED_STR_SIZE - 1] = '\0';
1388 if (strstr(buf, "[never]") == NULL)
1422 Ehdr buf[(896+sizeof(Ehdr))/sizeof(Ehdr)];
1441 ssize_t l = read(fd, buf, sizeof buf);
1442 eh = buf;
1447 if (phsize > sizeof buf - sizeof *eh) {
1455 l = pread(fd, buf+1, phsize, eh->e_phoff);
1458 ph = ph0 = (void *)(buf + 1);
1460 ph = ph0 = (void *)((char *)buf + eh->e_phoff);
1668 static int path_open(const char *name, const char *s, char *buf, size_t buf_size)
1676 if (snprintf(buf, buf_size, "%.*s/%s", (int)l, s, name) < buf_size) {
1677 if ((fd = open(buf, O_RDONLY|O_CLOEXEC))>=0) return fd;
1694 UT_STATIC int fixup_rpath(struct dso *p, char *buf, size_t buf_size)
1723 l = readlink("/proc/self/exe", buf, buf_size);
1734 buf[l] = 0;
1735 origin = buf;
1971 char buf[PATH_MAX+1];
2046 if (namespace->env_paths) fd = path_open(name, namespace->env_paths, buf, sizeof buf);
2048 if (fixup_rpath(p, buf, sizeof buf) < 0) {
2053 fd = path_open(name, p->rpath, buf, sizeof buf);
2059 fd = handle_asan_path_open(fd, name, namespace, buf, sizeof buf);
2063 fd = path_open(name, namespace->lib_paths, buf, sizeof buf);
2067 pathname = buf;
2143 p->name = p->buf;
4467 int handle_asan_path_open(int fd, const char *name, ns_t *namespace, char *buf, size_t buf_size)
4482 fd_tmp = path_open(name, new_lib_paths, buf, buf_size);
4486 fd_tmp = path_open(name, namespace->asan_lib_paths, buf, buf_size);
4491 fd_tmp = path_open(name, namespace->lib_paths, buf, buf_size);
4521 char *buf = task->buf;
4522 size_t buf_size = sizeof task->buf;
4528 if (snprintf(buf, buf_size, "%.*s/%s", (int)l, s, name) < buf_size) {
4529 char *separator = strstr(buf, ZIP_FILE_PATH_SEPARATOR);
4531 int res = open_uncompressed_library_in_zipfile(buf, z_info, separator);
4540 if ((task->fd = open(buf, O_RDONLY|O_CLOEXEC))>=0) break;
5125 strncpy(task->buf, resolved_path, PATH_MAX);
5238 if (fixup_rpath(task->p, task->buf, sizeof task->buf) < 0) {
5244 if (!is_accessible(namespace, task->buf, g_is_asan, check_inherited)) {
5262 task->pathname = task->buf;
5344 task->p->name = task->p->buf;