FreeBSD/sbin/growfs/growfs.c
/*
 * Figure out how many lines our current terminal has. For more details again
 * please see the source of newfs(8), as this function is taken over almost
 * unchanged.
 */
Figure out how many lines our current terminal has. For more details again
please see the source of newfs(8), as this function is taken over almost
unchanged.
Figure out how many lines our current terminal has . For more details again please see the source of newfs ( 8 ) as this function is taken over almost unchanged .
static int
charsperline(void)
{
	DBG_FUNC("charsperline")
	int columns;
	char *cp;
	struct winsize ws;
	DBG_ENTER;
	columns = 0;
	if (ioctl(0, TIOCGWINSZ, &ws) != -1)
		columns = ws.ws_col;
	if (columns == 0 && (cp = getenv("COLUMNS")))
		columns = atoi(cp);
	if (columns == 0)
		columns = 80;	
	DBG_LEAVE;
	return (columns);
}
static int charsperline ( void ) { DBG_FUNC ( " " ) int columns ; char * cp ; struct winsize ws ; DBG_ENTER ; columns = 0 ; if ( ioctl ( 0 , TIOCGWINSZ , & ws ) != -1 ) columns = ws . ws_col ; if ( columns == 0 && ( cp = getenv ( " " ) ) ) columns = atoi ( cp ) ; if ( columns == 0 ) columns = 80 ; DBG_LEAVE ; return ( columns ) ; }
Figure out how many lines our current terminal has.
Figure out how many lines our current terminal has .
/* last resort */