summaryrefslogtreecommitdiffstats
path: root/mdk-stage1/dietlibc/sparc/shmat.c
blob: 73b2d89a96c4d8ccd3c408ccc43dc4b402f20d5a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <asm/ipc.h>

extern void* __ipc();

#ifndef PAGE_SIZE
#define PAGE_SIZE 4096
#endif

void* shmat(int shmid,const void* shmaddr,int shmflg) {
  void* raddr;
  register void* result;
  result=__ipc(SHMAT,shmid,shmflg,&raddr,shmaddr);
  if ((unsigned long)result <= -(unsigned long)PAGE_SIZE)
    result=raddr;
  return result;
}