IO-Tty-Util
view release on metacpan or search on metacpan
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.494 second using v1.01-cache-2.11-cpan-71847e10f99 )