version 1.10, 2005/12/19 19:13:50 |
version 1.11, 2015/04/18 18:28:37 |
|
|
#include <sys/shm.h> |
#include <sys/shm.h> |
#include <stdio.h> |
#include <stdio.h> |
#include <unistd.h> |
#include <unistd.h> |
|
#include <limits.h> |
#include <stdlib.h> |
#include <stdlib.h> |
#include <ctype.h> |
#include <ctype.h> |
#include <err.h> |
#include <err.h> |
|
|
main(int argc, char *argv[]) |
main(int argc, char *argv[]) |
{ |
{ |
int c, result, errflg, target_id; |
int c, result, errflg, target_id; |
|
const char *errstr; |
key_t target_key; |
key_t target_key; |
|
|
errflg = 0; |
errflg = 0; |
|
|
case 'q': |
case 'q': |
case 'm': |
case 'm': |
case 's': |
case 's': |
target_id = atoi(optarg); |
target_id = strtonum(optarg, 0, INT_MAX, &errstr); |
|
if (errstr) |
|
errx(1, "-%c %s: %s\n", c, optarg, &errstr); |
if (c == 'q') |
if (c == 'q') |
result = msgrm(0, target_id); |
result = msgrm(0, target_id); |
else if (c == 'm') |
else if (c == 'm') |