Home
last modified time | relevance | path

Searched refs:shmfd (Results 1 – 18 of 18) sorted by relevance

/freebsd/sys/security/mac/
H A Dmac_posix_shm.c66 mac_posixshm_init(struct shmfd *shmfd) in mac_posixshm_init() argument
70 shmfd->shm_label = mac_posixshm_label_alloc(); in mac_posixshm_init()
72 shmfd->shm_label = NULL; in mac_posixshm_init()
84 mac_posixshm_destroy(struct shmfd *shmfd) in mac_posixshm_destroy() argument
87 if (shmfd->shm_label != NULL) { in mac_posixshm_destroy()
88 mac_posixshm_label_free(shmfd->shm_label); in mac_posixshm_destroy()
89 shmfd->shm_label = NULL; in mac_posixshm_destroy()
94 mac_posixshm_create(struct ucred *cred, struct shmfd *shmfd) in mac_posixshm_create() argument
97 MAC_POLICY_PERFORM_NOSLEEP(posixshm_create, cred, shmfd, in mac_posixshm_create()
98 shmfd->shm_label); in mac_posixshm_create()
[all …]
H A Dmac_framework.h78 struct shmfd;
328 int mac_posixshm_check_mmap(struct ucred *cred, struct shmfd *shmfd,
330 int mac_posixshm_check_open(struct ucred *cred, struct shmfd *shmfd,
333 struct ucred *file_cred, struct shmfd *shmfd);
334 int mac_posixshm_check_setmode(struct ucred *cred, struct shmfd *shmfd,
336 int mac_posixshm_check_setowner(struct ucred *cred, struct shmfd *shmfd,
339 struct ucred *file_cred, struct shmfd *shmfd);
341 struct ucred *file_cred, struct shmfd *shmfd);
342 int mac_posixshm_check_unlink(struct ucred *cred, struct shmfd *shmfd);
344 struct ucred *file_cred, struct shmfd *shmfd);
[all …]
H A Dmac_policy.h94 struct shmfd;
380 struct shmfd *shmfd, struct label *shmlabel, int prot,
383 struct shmfd *shmfd, struct label *shmlabel,
386 struct ucred *file_cred, struct shmfd *shmfd,
389 struct shmfd *shmfd, struct label *shmlabel,
392 struct shmfd *shmfd, struct label *shmlabel,
395 struct ucred *file_cred, struct shmfd *shmfd,
398 struct ucred *file_cred, struct shmfd *shmfd,
401 struct shmfd *shmfd, struct label *shmlabel);
403 struct ucred *file_cred, struct shmfd *shmfd,
[all …]
/freebsd/sys/kern/
H A Duipc_shm.c108 struct shmfd *sm_shmfd;
123 static void shm_insert(char *path, Fnv32_t fnv, struct shmfd *shmfd);
124 static struct shmfd *shm_lookup(char *path, Fnv32_t fnv);
127 static int shm_dotruncate_cookie(struct shmfd *shmfd, off_t length,
129 static int shm_dotruncate_locked(struct shmfd *shmfd, off_t length,
133 static int shm_deallocate(struct shmfd *shmfd, off_t *offset,
186 #define shm_rangelock_unlock(shmfd, cookie) \ argument
187 rangelock_unlock(&(shmfd)->shm_rl, (cookie))
188 #define shm_rangelock_rlock(shmfd, start, end) \ argument
189 rangelock_rlock(&(shmfd)->shm_rl, (start), (end))
[all …]
H A Dkern_sendfile.c564 struct vnode **vp_res, struct shmfd **shmfd_res, off_t *obj_size, in sendfile_getobj()
569 struct shmfd *shmfd; in sendfile_getobj() local
575 shmfd = *shmfd_res = NULL; in sendfile_getobj()
611 shmfd = fp->f_data; in sendfile_getobj()
612 obj = shmfd->shm_object; in sendfile_getobj()
614 *obj_size = shmfd->shm_size; in sendfile_getobj()
635 *shmfd_res = shmfd; in sendfile_getobj()
685 struct shmfd *shmfd; in vn_sendfile() local
706 error = sendfile_getobj(td, fp, &obj, &vp, &shmfd, &obj_size, &bsize); in vn_sendfile()
H A Dkern_umtx.c4303 struct shmfd *ushm_obj;
4491 struct shmfd *shm; in umtx_shm_create_reg()
/freebsd/sys/sys/
H A Dmman.h265 struct shmfd { struct
306 int shm_access(struct shmfd *shmfd, struct ucred *ucred, int flags); argument
307 struct shmfd *shm_alloc(struct ucred *ucred, mode_t mode, bool largepage);
308 struct shmfd *shm_hold(struct shmfd *shmfd);
309 void shm_drop(struct shmfd *shmfd);
310 int shm_dotruncate(struct shmfd *shmfd, off_t length);
311 bool shm_largepage(struct shmfd *shmfd);
/freebsd/tools/test/stress2/misc/
H A Dsendfile_shm.sh88 load(int infd, int shmfd, off_t size)
99 write(shmfd, buf, r);
104 sendfd(int s, int shmfd, off_t size)
109 error = sendfile(shmfd, s, 0, size, NULL, &sbytes, 0);
111 err(1, "sendfile(%d, %d, %jd)", s, shmfd, size);
147 int s[2], infd, outfd, shmfd, error;
171 shmfd = shm_open(SHM_ANON, O_CREAT | O_RDWR, 0600);
172 if (shmfd == -1)
174 error = ftruncate(shmfd, st.st_size);
177 load(infd, shmfd, st.st_size);
[all …]
H A Dshm3.sh30 int error, shmfd;
33 shmfd = shm_open(SHM_ANON, O_CREAT | O_RDWR, 0600);
34 if (shmfd == -1)
36 error = ftruncate(shmfd, SZ);
41 error = write(shmfd, buf, sizeof(buf));
48 shmfd, 0);
53 close(shmfd);
H A Dshm_super.sh53 int error, shmfd;
55 shmfd = shm_open(SHM_ANON, O_CREAT | O_RDWR, 0600);
56 if (shmfd == -1)
58 error = ftruncate(shmfd, SZ);
63 error = write(shmfd, buf, sizeof(buf));
70 MAP_ALIGNED_SUPER, shmfd, 0);
/freebsd/tests/sys/vm/
H A Dmlock_test.c186 int count, error, shmfd; in ATF_TC_BODY() local
203 shmfd = shm_open(SHM_ANON, O_RDWR | O_CREAT, 0600); in ATF_TC_BODY()
204 ATF_REQUIRE_MSG(shmfd >= 0, "shm_open: %s", strerror(errno)); in ATF_TC_BODY()
205 error = ftruncate(shmfd, len); in ATF_TC_BODY()
209 MAP_SHARED | MAP_ALIGNED_SUPER, shmfd, 0); in ATF_TC_BODY()
214 MAP_SHARED | MAP_ALIGNED_SUPER, shmfd, 0); in ATF_TC_BODY()
235 error = ftruncate(shmfd, len - pagesizes[0]); in ATF_TC_BODY()
241 error = ftruncate(shmfd, len); in ATF_TC_BODY()
274 ATF_REQUIRE(close(shmfd) == 0); in ATF_TC_BODY()
H A Dmmap_test.c136 int devstatfd, pagesize, shmfd, zerofd; in ATF_TC_BODY() local
140 ATF_REQUIRE((shmfd = shm_open(SHM_ANON, O_RDWR, 0644)) >= 0); in ATF_TC_BODY()
141 ATF_REQUIRE(ftruncate(shmfd, pagesize) == 0); in ATF_TC_BODY()
147 checked_mmap(PROT_READ | PROT_WRITE, MAP_SHARED, shmfd, 0, in ATF_TC_BODY()
149 checked_mmap(PROT_READ | PROT_WRITE, MAP_PRIVATE, shmfd, 0, in ATF_TC_BODY()
161 checked_mmap(0xffff, MAP_SHARED, shmfd, EINVAL, in ATF_TC_BODY()
171 checked_mmap(PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_SHARED, shmfd, in ATF_TC_BODY()
175 checked_mmap(PROT_READ | PROT_WRITE, 0, shmfd, EINVAL, in ATF_TC_BODY()
200 close(shmfd); in ATF_TC_BODY()
/freebsd/tools/tools/syscall_timing/
H A Dsyscall_timing.c696 int shmfd; in test_shmfd() local
698 shmfd = shm_open(SHM_ANON, O_CREAT | O_RDWR, 0600); in test_shmfd()
699 if (shmfd < 0) in test_shmfd()
701 close(shmfd); in test_shmfd()
704 shmfd = shm_open(SHM_ANON, O_CREAT | O_RDWR, 0600); in test_shmfd()
705 if (shmfd < 0) in test_shmfd()
707 close(shmfd); in test_shmfd()
717 int fd, shmfd; in test_shmfd_dup() local
719 shmfd = shm_open(SHM_ANON, O_CREAT | O_RDWR, 0600); in test_shmfd_dup()
720 if (shmfd < 0) in test_shmfd_dup()
[all …]
/freebsd/sys/security/mac_stub/
H A Dmac_stub.c777 stub_posixshm_check_mmap(struct ucred *cred, struct shmfd *shmfd, in stub_posixshm_check_mmap() argument
785 stub_posixshm_check_open(struct ucred *cred, struct shmfd *shmfd, in stub_posixshm_check_open() argument
794 struct shmfd *shm, struct label *shmlabel) in stub_posixshm_check_read()
801 stub_posixshm_check_setmode(struct ucred *cred, struct shmfd *shmfd, in stub_posixshm_check_setmode() argument
809 stub_posixshm_check_setowner(struct ucred *cred, struct shmfd *shmfd, in stub_posixshm_check_setowner() argument
818 struct shmfd *shmfd, struct label *shmlabel) in stub_posixshm_check_stat() argument
826 struct ucred *file_cred, struct shmfd *shmfd, struct label *shmlabel) in stub_posixshm_check_truncate() argument
833 stub_posixshm_check_unlink(struct ucred *cred, struct shmfd *shmfd, in stub_posixshm_check_unlink() argument
842 struct shmfd *shm, struct label *shmlabel) in stub_posixshm_check_write()
849 stub_posixshm_create(struct ucred *cred, struct shmfd *shmfd, in stub_posixshm_create() argument
/freebsd/sys/security/mac_mls/
H A Dmac_mls.c1589 mls_posixshm_check_mmap(struct ucred *cred, struct shmfd *shmfd, in mls_posixshm_check_mmap() argument
1613 mls_posixshm_check_open(struct ucred *cred, struct shmfd *shmfd, in mls_posixshm_check_open() argument
1638 struct shmfd *shm, struct label *shmlabel) in mls_posixshm_check_read()
1655 mls_posixshm_check_setmode(struct ucred *cred, struct shmfd *shmfd, in mls_posixshm_check_setmode() argument
1673 mls_posixshm_check_setowner(struct ucred *cred, struct shmfd *shmfd, in mls_posixshm_check_setowner() argument
1692 struct shmfd *shmfd, struct label *shmlabel) in mls_posixshm_check_stat() argument
1710 struct ucred *file_cred, struct shmfd *shmfd, struct label *shmlabel) in mls_posixshm_check_truncate() argument
1727 mls_posixshm_check_unlink(struct ucred *cred, struct shmfd *shmfd, in mls_posixshm_check_unlink() argument
1746 struct shmfd *shm, struct label *shmlabel) in mls_posixshm_check_write()
1763 mls_posixshm_create(struct ucred *cred, struct shmfd *shmfd, in mls_posixshm_create() argument
/freebsd/sys/security/mac_test/
H A Dmac_test.c1451 test_posixshm_check_mmap(struct ucred *cred, struct shmfd *shmfd, in test_posixshm_check_mmap() argument
1463 test_posixshm_check_open(struct ucred *cred, struct shmfd *shmfd, in test_posixshm_check_open() argument
1476 struct ucred *file_cred, struct shmfd *shm, struct label *shmlabel) in test_posixshm_check_read()
1490 test_posixshm_check_setmode(struct ucred *cred, struct shmfd *shmfd, in test_posixshm_check_setmode() argument
1502 test_posixshm_check_setowner(struct ucred *cred, struct shmfd *shmfd, in test_posixshm_check_setowner() argument
1515 struct ucred *file_cred, struct shmfd *shmfd, struct label *shmfdlabel) in test_posixshm_check_stat() argument
1528 struct ucred *file_cred, struct shmfd *shmfd, struct label *shmfdlabel) in test_posixshm_check_truncate() argument
1540 test_posixshm_check_unlink(struct ucred *cred, struct shmfd *shmfd, in test_posixshm_check_unlink() argument
1553 struct ucred *file_cred, struct shmfd *shm, struct label *shmlabel) in test_posixshm_check_write()
1567 test_posixshm_create(struct ucred *cred, struct shmfd *shmfd, in test_posixshm_create() argument
/freebsd/sys/security/mac_biba/
H A Dmac_biba.c1694 biba_posixshm_check_mmap(struct ucred *cred, struct shmfd *shmfd, in biba_posixshm_check_mmap() argument
1718 biba_posixshm_check_open(struct ucred *cred, struct shmfd *shmfd, in biba_posixshm_check_open() argument
1743 struct shmfd *vp, struct label *shmlabel) in biba_posixshm_check_read()
1760 biba_posixshm_check_setmode(struct ucred *cred, struct shmfd *shmfd, in biba_posixshm_check_setmode() argument
1778 biba_posixshm_check_setowner(struct ucred *cred, struct shmfd *shmfd, in biba_posixshm_check_setowner() argument
1797 struct shmfd *shmfd, struct label *shmlabel) in biba_posixshm_check_stat() argument
1815 struct ucred *file_cred, struct shmfd *shmfd, struct label *shmlabel) in biba_posixshm_check_truncate() argument
1832 biba_posixshm_check_unlink(struct ucred *cred, struct shmfd *shmfd, in biba_posixshm_check_unlink() argument
1851 struct shmfd *vp, struct label *shmlabel) in biba_posixshm_check_write()
1868 biba_posixshm_create(struct ucred *cred, struct shmfd *shmfd, in biba_posixshm_create() argument
/freebsd/lib/libprocstat/
H A Dlibprocstat.c1181 struct shmfd shmfd; in procstat_get_shm_info_kvm() local
1193 if (!kvm_read_all(kd, (unsigned long)shmfdp, &shmfd, in procstat_get_shm_info_kvm()
1194 sizeof(struct shmfd))) { in procstat_get_shm_info_kvm()
1198 shm->mode = S_IFREG | shmfd.shm_mode; in procstat_get_shm_info_kvm()
1199 shm->size = shmfd.shm_size; in procstat_get_shm_info_kvm()
1200 if (fst->fs_path == NULL && shmfd.shm_path != NULL) { in procstat_get_shm_info_kvm()
1203 if (!kvm_read_all(kd, (unsigned long)shmfd.shm_path + i, in procstat_get_shm_info_kvm()