Lines Matching defs:path
117 static int ksem_create(struct thread *td, const char *path,
124 static void ksem_insert(char *path, Fnv32_t fnv, struct ksem *ks);
125 static struct ksem *ksem_lookup(char *path, Fnv32_t fnv);
128 static int ksem_remove(char *path, Fnv32_t fnv, struct ucred *ucred);
262 const char *path, *pr_path;
275 path = ks->ks_path;
280 if (strncmp(path, pr_path, pr_pathlen) == 0 &&
281 path[pr_pathlen] == '/')
282 path += pr_pathlen;
284 strlcpy(kif->kf_path, path, sizeof(kif->kf_path));
366 * paths to semaphore objects. We use the FNV hash on the path to
370 ksem_lookup(char *path, Fnv32_t fnv)
377 if (strcmp(map->km_path, path) == 0)
385 ksem_insert(char *path, Fnv32_t fnv, struct ksem *ks)
390 map->km_path = path;
393 ks->ks_path = path;
398 ksem_remove(char *path, Fnv32_t fnv, struct ucred *ucred)
406 if (strcmp(map->km_path, path) == 0) {
464 char *path;
502 path = malloc(MAXPATHLEN, M_KSEM, M_WAITOK);
507 : strlcpy(path, pr_path, MAXPATHLEN);
508 error = copyinstr(name, path + pr_pathlen,
512 if (error == 0 && path[pr_pathlen] != '/')
517 free(path, M_KSEM);
521 fnv = fnv_32_str(path, FNV1_32_INIT);
523 ks = ksem_lookup(path, fnv);
531 ksem_insert(path, fnv, ks);
532 path = NULL;
560 if (path)
561 free(path, M_KSEM);
647 char *path;
653 path = malloc(MAXPATHLEN, M_TEMP, M_WAITOK);
656 : strlcpy(path, pr_path, MAXPATHLEN);
657 error = copyinstr(uap->name, path + pr_pathlen, MAXPATHLEN - pr_pathlen,
660 free(path, M_TEMP);
664 fnv = fnv_32_str(path, FNV1_32_INIT);
666 error = ksem_remove(path, fnv, td->td_ucred);
668 free(path, M_TEMP);