FreeBSD kernel kern code
|
#include <sys/cdefs.h>
#include "opt_capsicum.h"
#include <sys/param.h>
#include <sys/capability.h>
#include <sys/conf.h>
#include <sys/fcntl.h>
#include <sys/file.h>
#include <sys/filedesc.h>
#include <sys/fnv_hash.h>
#include <sys/kernel.h>
#include <sys/lock.h>
#include <sys/malloc.h>
#include <sys/mman.h>
#include <sys/mutex.h>
#include <sys/priv.h>
#include <sys/proc.h>
#include <sys/refcount.h>
#include <sys/resourcevar.h>
#include <sys/stat.h>
#include <sys/sysctl.h>
#include <sys/sysproto.h>
#include <sys/systm.h>
#include <sys/sx.h>
#include <sys/time.h>
#include <sys/vnode.h>
#include <security/mac/mac_framework.h>
#include <vm/vm.h>
#include <vm/vm_param.h>
#include <vm/pmap.h>
#include <vm/vm_extern.h>
#include <vm/vm_map.h>
#include <vm/vm_kern.h>
#include <vm/vm_object.h>
#include <vm/vm_page.h>
#include <vm/vm_pageout.h>
#include <vm/vm_pager.h>
#include <vm/swap_pager.h>
Go to the source code of this file.
Data Structures | |
struct | shm_mapping |
Macros | |
#define | SHM_HASH(fnv) (&shm_dictionary[(fnv) & shm_hash]) |
Functions | |
__FBSDID ("$BSDSUniX$") | |
static | MALLOC_DEFINE (M_SHMFD,"shmfd","shared memory file descriptor") |
static | LIST_HEAD (shm_mapping) |
FEATURE (posix_shm,"POSIX shared memory") | |
static int | shm_read (struct file *fp, struct uio *uio, struct ucred *active_cred, int flags, struct thread *td) |
static int | shm_write (struct file *fp, struct uio *uio, struct ucred *active_cred, int flags, struct thread *td) |
static int | shm_truncate (struct file *fp, off_t length, struct ucred *active_cred, struct thread *td) |
static int | shm_ioctl (struct file *fp, u_long com, void *data, struct ucred *active_cred, struct thread *td) |
static int | shm_poll (struct file *fp, int events, struct ucred *active_cred, struct thread *td) |
static int | shm_kqfilter (struct file *fp, struct knote *kn) |
static int | shm_stat (struct file *fp, struct stat *sb, struct ucred *active_cred, struct thread *td) |
static int | shm_close (struct file *fp, struct thread *td) |
static int | shm_dotruncate (struct shmfd *shmfd, off_t length) |
static struct shmfd * | shm_alloc (struct ucred *ucred, mode_t mode) |
static struct shmfd * | shm_hold (struct shmfd *shmfd) |
static void | shm_drop (struct shmfd *shmfd) |
static int | shm_access (struct shmfd *shmfd, struct ucred *ucred, int flags) |
static void | shm_init (void *arg) |
SYSINIT (shm_init, SI_SUB_SYSV_SHM, SI_ORDER_ANY, shm_init, NULL) | |
static struct shmfd * | shm_lookup (char *path, Fnv32_t fnv) |
static void | shm_insert (char *path, Fnv32_t fnv, struct shmfd *shmfd) |
static int | shm_remove (char *path, Fnv32_t fnv, struct ucred *ucred) |
int | sys_shm_open (struct thread *td, struct shm_open_args *uap) |
int | sys_shm_unlink (struct thread *td, struct shm_unlink_args *uap) |
int | shm_mmap (struct shmfd *shmfd, vm_size_t objsize, vm_ooffset_t foff, vm_object_t *obj) |
static int | shm_chmod (struct file *fp, mode_t mode, struct ucred *active_cred, struct thread *td) |
static int | shm_chown (struct file *fp, uid_t uid, gid_t gid, struct ucred *active_cred, struct thread *td) |
int | shm_map (struct file *fp, size_t size, off_t offset, void **memp) |
int | shm_unmap (struct file *fp, void *mem, size_t size) |
void | shm_path (struct shmfd *shmfd, char *path, size_t size) |
#define SHM_HASH | ( | fnv | ) | (&shm_dictionary[(fnv) & shm_hash]) |
Referenced by shm_insert(), shm_lookup(), and shm_remove().
__FBSDID | ( | "$BSDSUniX$" | ) |
FEATURE | ( | posix_shm | , |
"POSIX shared memory" | |||
) |
|
static |
Definition at line 95 of file uipc_shm.c.
|
static |
|
static |
Definition at line 428 of file uipc_shm.c.
References accmode, and vaccess().
Referenced by shm_remove(), and sys_shm_open().
|
static |
Definition at line 366 of file uipc_shm.c.
References alloc_unr(), malloc(), mode, and vfs_timestamp().
Referenced by sys_shm_open().
|
static |
Definition at line 703 of file uipc_shm.c.
References vaccess().
|
static |
Definition at line 732 of file uipc_shm.c.
References groupmember(), and priv_check_cred().
|
static |
Definition at line 240 of file uipc_shm.c.
References shm_drop().
|
static |
Definition at line 252 of file uipc_shm.c.
References vfs_timestamp().
Referenced by shm_truncate(), and sys_shm_open().
|
static |
Definition at line 409 of file uipc_shm.c.
References free(), and free_unr().
Referenced by shm_close(), and shm_remove().
|
static |
Definition at line 401 of file uipc_shm.c.
Referenced by shm_insert(), and sys_shm_open().
|
static |
Definition at line 451 of file uipc_shm.c.
References hashinit(), mtx_init(), and new_unrhdr().
|
static |
Definition at line 480 of file uipc_shm.c.
References malloc(), path, SHM_HASH, shm_hold(), shm_mapping::sm_fnv, shm_mapping::sm_path, and shm_mapping::sm_shmfd.
Referenced by sys_shm_open().
|
static |
Definition at line 177 of file uipc_shm.c.
|
static |
Definition at line 193 of file uipc_shm.c.
|
static |
Definition at line 465 of file uipc_shm.c.
References SHM_HASH, shm_mapping::sm_fnv, shm_mapping::sm_path, and shm_mapping::sm_shmfd.
Referenced by sys_shm_open().
int shm_map | ( | struct file * | fp, |
size_t | size, | ||
off_t | offset, | ||
void ** | memp | ||
) |
Definition at line 766 of file uipc_shm.c.
int shm_mmap | ( | struct shmfd * | shmfd, |
vm_size_t | objsize, | ||
vm_ooffset_t | foff, | ||
vm_object_t * | obj | ||
) |
Definition at line 682 of file uipc_shm.c.
References vfs_timestamp().
void shm_path | ( | struct shmfd * | shmfd, |
char * | path, | ||
size_t | size | ||
) |
Definition at line 864 of file uipc_shm.c.
Referenced by fill_shm_info().
|
static |
Definition at line 185 of file uipc_shm.c.
|
static |
Definition at line 143 of file uipc_shm.c.
|
static |
Definition at line 493 of file uipc_shm.c.
References free(), shm_access(), shm_drop(), SHM_HASH, shm_mapping::sm_fnv, shm_mapping::sm_path, and shm_mapping::sm_shmfd.
Referenced by sys_shm_unlink().
|
static |
Definition at line 200 of file uipc_shm.c.
|
static |
Definition at line 159 of file uipc_shm.c.
References shm_dotruncate().
int shm_unmap | ( | struct file * | fp, |
void * | mem, | ||
size_t | size | ||
) |
Definition at line 824 of file uipc_shm.c.
|
static |
Definition at line 151 of file uipc_shm.c.
int sys_shm_open | ( | struct thread * | td, |
struct shm_open_args * | uap | ||
) |
Definition at line 525 of file uipc_shm.c.
References falloc(), fd, fdclose(), finit(), free(), malloc(), path, shm_access(), shm_alloc(), shm_dotruncate(), shm_hold(), shm_insert(), and shm_lookup().
int sys_shm_unlink | ( | struct thread * | td, |
struct shm_unlink_args * | uap | ||
) |
Definition at line 655 of file uipc_shm.c.
References free(), malloc(), path, and shm_remove().