exit(0);
exit(rval);
main(argc, argv)	int argc;	char *argv[];{	static char dot[] = ".", *dotav[] = { dot, NULL };	struct winsize win;	int ch, fts_options, notused;	int kflag = 0;	char *p;	/* Terminal defaults to -Cq, non-terminal defaults to -1. */	if (isatty(STDOUT_FILENO)) {		if ((p = getenv("COLUMNS")) != NULL)			termwidth = atoi(p);		else if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &win) == 0 &&		    win.ws_col > 0)			termwidth = win.ws_col;		f_column = f_nonprint = 1;	} else		f_singlecol = 1;	/* Root is -A automatically. */	if (!getuid())		f_listdot = 1;	fts_options = FTS_PHYSICAL;	while ((ch = getopt(argc, argv, "1ACFLRSTWacdfgiklnoqrstu")) != -1) {		switch (ch) {		/*		 * The -1, -C and -l options all override each other so shell		 * aliasing works right.		 */		case '1':			f_singlecol = 1;			f_column = f_longform = 0;			break;		case 'C':			f_column = 1;			f_longform = f_singlecol = 0;			break;		case 'l':			f_longform = 1;			f_numericonly = 0;			f_column = f_singlecol = 0;			break;		case 'n':			f_longform = 1;			f_numericonly = 1;			f_column = f_singlecol = 0;			break;		/* The -c and -u options override each other. */		case 'c':			f_statustime = 1;			f_accesstime = 0;			break;		case 'u':			f_accesstime = 1;			f_statustime = 0;			break;		case 'F':			f_type = 1;			break;		case 'L':			fts_options &= ~FTS_PHYSICAL;			fts_options |= FTS_LOGICAL;			break;		case 'R':			f_recursive = 1;			break;		case 'a':			fts_options |= FTS_SEEDOT;			/* FALLTHROUGH */		case 'A':			f_listdot = 1;			break;		/* The -d option turns off the -R option. */		case 'd':			f_listdir = 1;			f_recursive = 0;			break;		case 'f':			f_nosort = 1;			break;		case 'g':		/* Compatibility with 4.3BSD. */			break;		case 'i':			f_inode = 1;			break;		case 'k':			blocksize = 1024;			kflag = 1;			break;		case 'o':			f_flags = 1;			break;		case 'q':			f_nonprint = 1;			break;		case 'r':			f_reversesort = 1;			break;		case 'S':			sortkey = BY_SIZE;			break;		case 's':			f_size = 1;			break;		case 'T':			f_sectime = 1;			break;		case 't':			sortkey = BY_TIME;			break;		case 'W':			f_whiteout = 1;			break;		default:			usage();		}	}	argc -= optind;	argv += optind;	/*	 * If not -F, -i, -l, -S, -s or -t options, don't require stat	 * information.	 */	if (!f_inode && !f_longform && !f_size && !f_type &&	    sortkey == BY_NAME)		fts_options |= FTS_NOSTAT;	/*	 * If not -F, -d or -l options, follow any symbolic links listed on	 * the command line.	 */	if (!f_longform && !f_listdir && !f_type)		fts_options |= FTS_COMFOLLOW;	/*	 * If -W, show whiteout entries	 */#ifdef FTS_WHITEOUT	if (f_whiteout)		fts_options |= FTS_WHITEOUT;#endif	/* If -l or -s, figure out block size. */	if (f_longform || f_size) {		if (!kflag)			(void)getbsize(&notused, &blocksize);		blocksize /= 512;	}	/* Select a sort function. */	if (f_reversesort) {		switch (sortkey) {		case BY_NAME:			sortfcn = revnamecmp;			break;		case BY_SIZE:			sortfcn = revsizecmp;			break;		case BY_TIME:			if (f_accesstime)				sortfcn = revacccmp;			else if (f_statustime)				sortfcn = revstatcmp;			else /* Use modification time. */				sortfcn = revmodcmp;			break;		}	} else {		switch (sortkey) {		case BY_NAME:			sortfcn = namecmp;			break;		case BY_SIZE:			sortfcn = sizecmp;			break;		case BY_TIME:			if (f_accesstime)				sortfcn = acccmp;			else if (f_statustime)				sortfcn = statcmp;			else /* Use modification time. */				sortfcn = modcmp;			break;		}	}	/* Select a print function. */	if (f_singlecol)		printfcn = printscol;	else if (f_longform)		printfcn = printlong;	else		printfcn = printcol;	if (argc)		traverse(argc, argv, fts_options);	else		traverse(1, dotav, fts_options);	exit(0);}