regex memory corruption regression test
[libc-test] / src / api / sys_shm.c
1 #include <sys/shm.h>
2 #define T(t) (t*)0;
3 #define F(t,n) {t *y = &x.n;}
4 #define C(n) switch(n){case n:;}
5 static void f()
6 {
7 T(shmatt_t)
8 T(pid_t)
9 T(size_t)
10 T(time_t)
11 C(SHM_RDONLY)
12 C(SHM_RND)
13 C(SHMLBA)
14 {
15 struct shmid_ds x;
16 F(struct ipc_perm, shm_perm)
17 F(size_t,shm_segsz)
18 F(pid_t, shm_lpid)
19 F(pid_t, shm_cpid)
20 F(shmatt_t,shm_nattch)
21 F(time_t,shm_atime)
22 F(time_t,shm_dtime)
23 F(time_t,shm_ctime)
24 }
25 {void*(*p)(int,const void*,int) = shmat;}
26 {int(*p)(int,int,struct shmid_ds*) = shmctl;}
27 {int(*p)(const void*) = shmdt;}
28 {int(*p)(key_t,size_t,int) = shmget;}
29
30 T(uid_t)
31 T(gid_t)
32 T(mode_t)
33 T(key_t)
34 {
35 struct ipc_perm x;
36 F(uid_t,uid)
37 F(gid_t,gid)
38 F(uid_t,cuid)
39 F(gid_t,cgid)
40 F(mode_t, mode)
41 }
42 C(IPC_CREAT)
43 C(IPC_EXCL)
44 C(IPC_NOWAIT)
45 C(IPC_PRIVATE)
46 C(IPC_RMID)
47 C(IPC_SET)
48 C(IPC_STAT)
49 {key_t(*p)(const char*,int) = ftok;}
50 }