Lines Matching defs:path
114 static void shm_insert(char *path, Fnv32_t fnv, struct shmfd *shmfd);
115 static struct shmfd *shm_lookup(char *path, Fnv32_t fnv);
116 static int shm_remove(char *path, Fnv32_t fnv, struct ucred *ucred);
607 * paths to shmfd objects. We use the FNV hash on the path to store
625 shm_lookup(char *path, Fnv32_t fnv)
632 if (strcmp(map->sm_path, path) == 0)
640 shm_insert(char *path, Fnv32_t fnv, struct shmfd *shmfd)
645 map->sm_path = path;
648 shmfd->shm_path = path;
653 shm_remove(char *path, Fnv32_t fnv, struct ucred *ucred)
661 if (strcmp(map->sm_path, path) == 0) {
690 char *path;
718 /* A SHM_ANON path pointer creates an anonymous object. */
728 path = malloc(MAXPATHLEN, M_SHMFD, M_WAITOK);
733 : strlcpy(path, pr_path, MAXPATHLEN);
734 error = copyinstr(userpath, path + pr_pathlen,
738 ktrnamei(path);
741 if (error == 0 && path[pr_pathlen] != '/')
746 free(path, M_SHMFD);
750 fnv = fnv_32_str(path, FNV1_32_INIT);
752 shmfd = shm_lookup(path, fnv);
758 path);
762 shm_insert(path, fnv, shmfd);
767 free(path, M_SHMFD);
775 free(path, M_SHMFD);
828 return (kern_shm_open(td, uap->path, uap->flags, uap->mode, NULL));
834 char *path;
840 path = malloc(MAXPATHLEN, M_TEMP, M_WAITOK);
843 : strlcpy(path, pr_path, MAXPATHLEN);
844 error = copyinstr(uap->path, path + pr_pathlen, MAXPATHLEN - pr_pathlen,
847 free(path, M_TEMP);
852 ktrnamei(path);
854 fnv = fnv_32_str(path, FNV1_32_INIT);
856 error = shm_remove(path, fnv, td->td_ucred);
858 free(path, M_TEMP);
1078 const char *path, *pr_path;
1092 path = shmfd->shm_path;
1097 if (strncmp(path, pr_path, pr_pathlen) == 0 &&
1098 path[pr_pathlen] == '/')
1099 path += pr_pathlen;
1101 strlcpy(kif->kf_path, path, sizeof(kif->kf_path));