• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #include <sys/shm.h>
2 #include "syscall.h"
3 #include "ipc.h"
4 
5 #ifndef SYS_ipc
shmat(int id,const void * addr,int flag)6 void *shmat(int id, const void *addr, int flag)
7 {
8 	return (void *)syscall(SYS_shmat, id, addr, flag);
9 }
10 #else
shmat(int id,const void * addr,int flag)11 void *shmat(int id, const void *addr, int flag)
12 {
13 	unsigned long ret;
14 	ret = syscall(SYS_ipc, IPCOP_shmat, id, flag, &addr, addr);
15 	return (ret > -(unsigned long)SHMLBA) ? (void *)ret : (void *)addr;
16 }
17 #endif
18