* SUCH DAMAGE.
*/
+#include <sys/cdefs.h>
#ifndef lint
-static const char rcsid[] =
+__used static const char rcsid[] =
"$Id: ipcrm.c,v 1.3 2005/02/03 07:31:33 josborne Exp $";
#endif /* not lint */
int signaled;
-void usage()
+static void usage(void)
{
fprintf(stderr, "%s\n%s\n",
"usage: ipcrm [-q msqid] [-m shmid] [-s semid]",
exit(1);
}
-int msgrm(key, id)
- key_t key;
- int id;
+static int msgrm(key_t key, int id)
{
if (key) {
id = msgget(key, 0);
return msgctl(id, IPC_RMID, NULL);
}
-int shmrm(key, id)
- key_t key;
- int id;
+static int shmrm(key_t key, int id)
{
if (key) {
id = shmget(key, 0, 0);
return shmctl(id, IPC_RMID, NULL);
}
-int semrm(key, id)
- key_t key;
- int id;
+static int semrm(key_t key, int id)
{
- union semun arg;
-
if (key) {
id = semget(key, 0, 0);
if (id == -1)
return -1;
}
- return semctl(id, 0, IPC_RMID, arg);
+ return semctl(id, 0, IPC_RMID);
}
-void not_configured()
+static void not_configured(__unused int unused)
{
signaled++;
}
case 'q':
case 'm':
case 's':
- target_id = strtol(optarg, &en, 0);
+ target_id = (int)strtol(optarg, &en, 0);
if (*en) {
warnx("%s: '%s' is not a number",
IPC_TO_STRING(toupper(c)), optarg);
case 'Q':
case 'M':
case 'S':
- target_key = strtol(optarg, &en, 0);
+ target_key = (key_t)strtol(optarg, &en, 0);
if (*en) {
warnx("%s: '%s' is not a number", IPC_TO_STRING(c), optarg);
continue;
if (result < 0) {
errflg++;
if (!signaled)
- warn("%s key(%ld): ", IPC_TO_STRING(c), target_key);
+ warn("%s key(%d): ", IPC_TO_STRING(c), target_key);
else
warnx("%ss are not configured in the running kernel",
IPC_TO_STRING(c));