File: shmsys.c

package info (click to toggle)
acm 5.0-19
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 7,852 kB
  • ctags: 4,792
  • sloc: ansic: 42,427; makefile: 706; cpp: 293; perl: 280; sh: 198
file content (43 lines) | stat: -rw-r--r-- 730 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include "/usr/include/sys/types.h"
#include "/usr/include/sys/ipc.h"
#include "/usr/include/sys/shm.h"
#include "/usr/include/sys.s"

#define	SHMSYS	SYS_shmsys

#define	SHMAT	0
#define	SHMCTL	1
#define	SHMDT	2
#define	SHMGET	3

char     *
shmat(shmid, shmaddr, shmflg)
int       shmid;
char     *shmaddr;
int       shmflg;
{
	return (char *) syscall(SHMSYS, SHMAT, shmid, shmaddr, shmflg);
}

int
shmctl(shmid, cmd, buf)
int       shmid, cmd;
struct shmid_ds *buf;
{
	return syscall(SHMSYS, SHMCTL, shmid, cmd, buf);
}

int
shmdt(shmaddr)
char     *shmaddr;
{
	return syscall(SHMSYS, SHMDT, shmaddr);
}

int
shmget(key, size, shmflg)
key_t     key;
int       size, shmflg;
{
	return syscall(SHMSYS, SHMGET, key, size, shmflg);
}