IO-Tty-Util

 view release on metacpan or  search on metacpan

Util.xs  view on Meta::CPAN

void _openpty(rows, cols)
	int rows
	int cols 

	PREINIT:
	int amaster ;
	int aslave ;
	int rc ;
	struct winsize win ;

	PPCODE:
	win.ws_row = rows ;
	win.ws_col = cols ;
	rc = openpty(&amaster, &aslave, NULL, NULL, &win) ;
	if (rc == -1){
		XPUSHs(&PL_sv_undef) ;
	}
	else {
		XPUSHs(sv_2mortal(newSVnv(amaster))) ;
		XPUSHs(sv_2mortal(newSVnv(aslave))) ;
	}



# int login_tty(int fd); 
void _login_tty(fd)
	int fd

	PPCODE:
	XPUSHs(sv_2mortal(newSVnv(login_tty(fd)))) ;



( run in 0.555 second using v1.01-cache-2.11-cpan-5511b514fd6 )