]>
cygwin.com Git - cygwin-apps/cygutils.git/blob - src/ipc/ipcrm.c
6 * Copyright (C) 1997 Philippe CHAPUY
7 * Copyright (C) 1998 Ludovic LANGE
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28 * 13/05/1998 : Version 1.00 released
29 * First public release
30 * adress any comments to llange@capgemini.fr
31 * 2003/06/13 : (C. Wilson) Ported to the cygutils package from
36 /************************************************************************/
37 /* Philippe Chapuy, le 19/05/97 */
38 /************************************************************************/
59 /* These includes moved to common.h
65 /* arg for semctl system calls. */
67 int val
; /* value for SETVAL */
68 struct semid_ds
*buf
; /* buffer for IPC_STAT & IPC_SET */
69 ushort
*array
; /* array for GETALL & SETALL */
70 struct seminfo
*__buf
; /* buffer for IPC_INFO */
74 int main(int argc
, char **argv
)
82 if (argc
< 3 || strlen(argv
[1]) < 3) {
83 printf ("usage: %s [shm | msg | sem] id1 ... idn\n", argv
[0]);
89 for (LBoucle
= 2; LBoucle
< argc
; LBoucle
++)
91 id
= atoi (argv
[LBoucle
]) ;
92 if (!shmctl (id
, IPC_RMID
, NULL
))
99 for (LBoucle
= 2; LBoucle
< argc
; LBoucle
++)
101 id
= atoi (argv
[LBoucle
]) ;
102 if (!semctl (id
, 0, IPC_RMID
, arg
))
109 for (LBoucle
= 2; LBoucle
< argc
; LBoucle
++)
111 id
= atoi (argv
[LBoucle
]) ;
112 if (!msgctl (id
, IPC_RMID
, NULL
))
119 printf ("usage: %s [-shm | -msg | -sem] id\n", argv
[0]);
123 printf ("resource deleted\n");
This page took 0.03902 seconds and 5 git commands to generate.