1#ifndef __VSF_LINUX_SYS_SHM_H__
2#define __VSF_LINUX_SYS_SHM_H__
6#if VSF_LINUX_CFG_SUPPORT_SHM == ENABLED
8#if VSF_LINUX_CFG_RELATIVE_PATH == ENABLED
9# include "../sys/types.h"
10# include "../sys/ipc.h"
11# include "../simple_libc/time.h"
33#if VSF_LINUX_CFG_WRAPPER == ENABLED
34#define shmget VSF_LINUX_WRAPPER(shmget)
35#define shmat VSF_LINUX_WRAPPER(shmat)
36#define shmdt VSF_LINUX_WRAPPER(shmdt)
37#define shmctl VSF_LINUX_WRAPPER(shmctl)
40#if VSF_LINUX_APPLET_USE_SYS_SHM == ENABLED
49# ifndef __VSF_APPLET__
54#if defined(__VSF_APPLET__) && (defined(__VSF_APPLET_LIB__) || defined(__VSF_APPLET_LINUX_SYS_SHM_LIB__))\
55 && VSF_APPLET_CFG_ABI_PATCH != ENABLED && VSF_LINUX_APPLET_USE_SYS_SHM == ENABLED
57#ifndef VSF_LINUX_APPLET_SYS_SHM_VPLT
58# if VSF_LINUX_USE_APPLET == ENABLED
59# define VSF_LINUX_APPLET_SYS_SHM_VPLT \
60 ((vsf_linux_sys_shm_vplt_t *)(VSF_LINUX_APPLET_VPLT->sys_shm_vplt))
62# define VSF_LINUX_APPLET_SYS_SHM_VPLT \
63 ((vsf_linux_sys_shm_vplt_t *)vsf_vplt((void *)0))
67#define VSF_LINUX_APPLET_SYS_SHM_ENTRY(__NAME) \
68 VSF_APPLET_VPLT_ENTRY_FUNC_ENTRY(VSF_LINUX_APPLET_SYS_SHM_VPLT, __NAME)
69#define VSF_LINUX_APPLET_SYS_SHM_IMP(...) \
70 VSF_APPLET_VPLT_ENTRY_FUNC_IMP(VSF_LINUX_APPLET_SYS_SHM_VPLT, __VA_ARGS__)
72VSF_LINUX_APPLET_SYS_SHM_IMP(
shmget,
int,
key_t key,
size_t size,
int shmflg) {
74 return VSF_LINUX_APPLET_SYS_SHM_ENTRY(
shmget)(key,
size, shmflg);
76VSF_LINUX_APPLET_SYS_SHM_IMP(
shmat,
void *,
int shmid,
const void *shmaddr,
int shmflg) {
78 return VSF_LINUX_APPLET_SYS_SHM_ENTRY(
shmat)(shmid, shmaddr, shmflg);
80VSF_LINUX_APPLET_SYS_SHM_IMP(
shmdt,
int,
const void *shmaddr) {
82 return VSF_LINUX_APPLET_SYS_SHM_ENTRY(
shmdt)(shmaddr);
84VSF_LINUX_APPLET_SYS_SHM_IMP(
shmctl,
int,
int shmid,
int cmd,
struct shmid_ds *buf) {
86 return VSF_LINUX_APPLET_SYS_SHM_ENTRY(
shmctl)(shmid, cmd, buf);
92void *
shmat(
int shmid,
const void *shmaddr,
int shmflg);
93int shmdt(
const void *shmaddr);
int key_t
Definition types.h:84
__TIME_T time_t
Definition types.h:122
__VSF_VPLT_DECORATOR__ vsf_linux_sys_shm_vplt_t vsf_linux_sys_shm_vplt
Definition vsf_linux.c:4758
#define shmctl
Definition shm.h:37
#define shmdt
Definition shm.h:36
#define shmat
Definition shm.h:35
#define shmget
Definition shm.h:34
short shm_nattch
Definition shm.h:30
time_t shm_ctime
Definition shm.h:27
time_t shm_dtime
Definition shm.h:26
int shm_segsz
Definition shm.h:24
unsigned short shm_cpid
Definition shm.h:28
struct ipc_perm shm_perm
Definition shm.h:23
unsigned short shm_lpid
Definition shm.h:29
time_t shm_atime
Definition shm.h:25
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(shmdt)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(shmget)
vsf_vplt_info_t info
Definition shm.h:42
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(shmat)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(shmctl)
#define __VSF_VPLT_DECORATOR__
Definition vsf_cfg.h:93
#define VSF_APPLET_VPLT_ENTRY_FUNC_TRACE()
Definition vsf_cfg.h:165
uint32_t size
Definition vsf_memfs.h:50