tid = strtoul(optarg, NULL, 10);
tid = strtol(optarg, NULL, 10);
int main(int argc, char **argv){	int ch, longindex;	int err = -EINVAL, op = -1, len;	int tid = -1;	uint32_t cid = 0, set = 0;	uint64_t sid = 0, lun = 0;	char *params = NULL;	struct tgtadm_req *req;	char sbuf[8192], rbuf[8912];	while ((ch = getopt_long(argc, argv, "o:t:s:c:l:p:uvh",				 long_options, &longindex)) >= 0) {		switch (ch) {		case 'o':			op = str_to_op(optarg);			break;		case 't':			tid = strtoul(optarg, NULL, 10);			set |= SET_TARGET;			break;		case 's':			sid = strtoull(optarg, NULL, 10);			set |= SET_SESSION;			break;		case 'c':			cid = strtoul(optarg, NULL, 10);			set |= SET_CONNECTION;			break;		case 'l':			lun = strtoull(optarg, NULL, 10);			set |= SET_DEVICE;			break;		case 'p':			params = optarg;			break;		case 'u':			set |= SET_USER;			break;		case 'v':/* 			printf("%s version %s\n", program_name, IET_VERSION_STRING); */			exit(0);			break;		case 'h':			usage(0);			break;		default:			usage(-1);		}	}	if (op < 0) {		fprintf(stderr, "You must specify the operation type\n");		goto out;	}	if (optind < argc) {		fprintf(stderr, "unrecognized: ");		while (optind < argc)			fprintf(stderr, "%s", argv[optind++]);		fprintf(stderr, "\n");		usage(-1);	}	memset(sbuf, 0, sizeof(sbuf));	memset(rbuf, 0, sizeof(rbuf));	req = (struct tgtadm_req *) sbuf;	req->op = op;	req->set = set;	req->tid = tid;	req->sid = sid;	req->lun = lun;	len = sizeof(struct tgtadm_req);	if (params) {		memcpy(sbuf + sizeof(struct tgtadm_req), params, strlen(params));		len += strlen(params);	}	err = ipc_mgmt_call(sbuf, len, rbuf);	ipc_mgmt_result(rbuf);out:	return err;}