2 #define _MINIX_SYSTEM 1
10 #include <sys/types.h>
17 static int get_ipc_endpt(endpoint_t
*pt
)
19 return minix_rs_lookup("ipc", pt
);
22 /* Shared memory control operation. */
23 int shmctl(int shmid
, int cmd
, struct shmid_ds
*buf
)
29 if (get_ipc_endpt(&ipc_pt
) != OK
) {
34 memset(&m
, 0, sizeof(m
));
35 m
.m_lc_ipc_shmctl
.id
= shmid
;
36 m
.m_lc_ipc_shmctl
.cmd
= cmd
;
37 m
.m_lc_ipc_shmctl
.buf
= buf
;
39 r
= _syscall(ipc_pt
, IPC_SHMCTL
, &m
);
40 if ((cmd
== IPC_INFO
|| cmd
== SHM_INFO
|| cmd
== SHM_STAT
)
42 return m
.m_lc_ipc_shmctl
.ret
;
46 #if defined(__minix) && defined(__weak_alias)
47 __weak_alias(shmctl
, __shmctl50
)