Lines Matching defs:buf

240 int handle_asan_path_open(int fd, const char *name, ns_t *namespace, char *buf, size_t buf_size);
1370 UT_STATIC bool get_random(void *buf, size_t buflen)
1378 ret = read(fd, buf, buflen);
1388 UT_STATIC void fill_random_data(void *buf, size_t buflen)
1395 if (!get_random(buf, buflen)) {
1400 memcpy((char *)buf + pos, &x, sizeof(x));
1412 char buf[HUGEPAGES_SUPPORTED_STR_SIZE] = {'0'};
1418 read_size = read(fd, buf, HUGEPAGES_SUPPORTED_STR_SIZE - 1);
1422 buf[HUGEPAGES_SUPPORTED_STR_SIZE - 1] = '\0';
1423 if (strstr(buf, "[never]") == NULL)
1571 Ehdr buf[(896+sizeof(Ehdr))/sizeof(Ehdr)];
1593 ssize_t l = read(fd, buf, sizeof buf);
1594 eh = buf;
1599 if (phsize > sizeof buf - sizeof *eh) {
1607 l = pread(fd, buf+1, phsize, eh->e_phoff);
1610 ph = ph0 = (void *)(buf + 1);
1612 ph = ph0 = (void *)((char *)buf + eh->e_phoff);
1838 (void)is_section_exist(buf, sizeof(buf), fd, ".kernelpermission");
1856 static int path_open(const char *name, const char *s, char *buf, size_t buf_size)
1864 if (snprintf(buf, buf_size, "%.*s/%s", (int)l, s, name) < buf_size) {
1865 if ((fd = open(buf, O_RDONLY|O_CLOEXEC))>=0) return fd;
1882 UT_STATIC int fixup_rpath(struct dso *p, char *buf, size_t buf_size)
1911 l = readlink("/proc/self/exe", buf, buf_size);
1922 buf[l] = 0;
1923 origin = buf;
2159 char buf[PATH_MAX + 1];
2234 if (namespace->env_paths) fd = path_open(name, namespace->env_paths, buf, sizeof buf);
2236 if (fixup_rpath(p, buf, sizeof buf) < 0) {
2241 fd = path_open(name, p->rpath, buf, sizeof buf);
2247 fd = handle_asan_path_open(fd, name, namespace, buf, sizeof buf);
2251 fd = path_open(name, namespace->lib_paths, buf, sizeof buf);
2255 pathname = buf;
2331 p->name = p->buf;
4817 int handle_asan_path_open(int fd, const char *name, ns_t *namespace, char *buf, size_t buf_size)
4832 fd_tmp = path_open(name, new_lib_paths, buf, buf_size);
4836 fd_tmp = path_open(name, namespace->asan_lib_paths, buf, buf_size);
4841 fd_tmp = path_open(name, namespace->lib_paths, buf, buf_size);
4871 char *buf = task->buf;
4872 size_t buf_size = sizeof task->buf;
4878 if (snprintf(buf, buf_size, "%.*s/%s", (int)l, s, name) < buf_size) {
4879 char *separator = strstr(buf, ZIP_FILE_PATH_SEPARATOR);
4881 int res = open_uncompressed_library_in_zipfile(buf, z_info, separator);
4890 if ((task->fd = open(buf, O_RDONLY|O_CLOEXEC))>=0) break;
5514 strncpy(task->buf, resolved_path, PATH_MAX);
5627 if (fixup_rpath(task->p, task->buf, sizeof task->buf) < 0) {
5633 if (!is_accessible(namespace, task->buf, g_is_asan, check_inherited)) {
5651 task->pathname = task->buf;
5733 task->p->name = task->p->buf;