shmget.c 303 字节
Newer Older
R
Rich Felker 已提交
1
#include <sys/shm.h>
2
#include <stdint.h>
R
Rich Felker 已提交
3 4 5 6 7
#include "syscall.h"
#include "ipc.h"

int shmget(key_t key, size_t size, int flag)
{
8
	if (size > PTRDIFF_MAX) size = SIZE_MAX;
9
#ifndef SYS_ipc
10
	return syscall(SYS_shmget, key, size, flag);
R
Rich Felker 已提交
11
#else
12
	return syscall(SYS_ipc, IPCOP_shmget, key, size, flag);
R
Rich Felker 已提交
13 14
#endif
}