gid = -1;
gid = GID_MAX;
groupadd(int argc, char **argv){	int	dupgid;	int	gid;	int	c;	gid = -1;	dupgid = 0;	while ((c = getopt(argc, argv, "g:o" GROUP_ADD_OPT_EXTENSIONS)) != -1) {		switch(c) {		case 'g':			if (!is_number(optarg)) {				errx(EXIT_FAILURE, "When using [-g gid], the gid must be numeric");			}			gid = atoi(optarg);			break;		case 'o':			dupgid = 1;			break;#ifdef EXTENSIONS		case 'v':			verbose = 1;			break;#endif		}	}	argc -= optind;	argv += optind;	if (argc != 1) {		usermgmt_usage("groupadd");	}	checkeuid();	if (gid < 0 && !getnextgid(&gid, LowGid, HighGid)) {		err(EXIT_FAILURE, "can't add group: can't get next gid");	}	if (!dupgid && getgrgid((gid_t) gid) != NULL) {		errx(EXIT_FAILURE, "can't add group: gid %d is a duplicate", gid);	}	if (!valid_group(*argv)) {		warnx("warning - invalid group name `%s'", *argv);	}	if (!creategid(*argv, gid, "")) {		err(EXIT_FAILURE, "can't add group: problems with %s file",		    _PATH_GROUP);	}	return EXIT_SUCCESS;}