]>
git.ipfire.org Git - thirdparty/util-linux.git/blob - sys-utils/ipcrm.c
2 * krishna balasubramanian 1993
10 #include <sys/types.h>
15 #if defined (__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED)
16 /* union semun is defined by including <sys/sem.h> */
18 /* according to X/OPEN we have to define it ourselves */
22 unsigned short int *array
;
23 struct seminfo
*__buf
;
28 int main(int argc
, char **argv
)
35 if (argc
!= 3 || strlen(argv
[1]) < 3) {
36 printf ("usage: %s [shm | msg | sem] id\n", argv
[0]);
42 if (!shmctl (id
, IPC_RMID
, NULL
))
48 if (!semctl (id
, 0, IPC_RMID
, arg
))
54 if (!msgctl (id
, IPC_RMID
, NULL
))
60 printf ("usage: %s [-shm | -msg | -sem] id\n", argv
[0]);
63 printf ("resource deleted\n");