[Vala] Pseudo Terminal support in Vala



Hello everyone,

Anyone knows how to correctly open pseudo terminal in vala? All the
references on the web talks about using ptsname() but all i can see in
/usr/share/vala/vapi/linux.vapi is ptsname_r().

So my code goes like this:


int masterfd;
char[] slavedev = null;

if ((masterfd = Posix.posix_openpt(Posix.O_RDWR | Posix.O_NOCTTY)) == -1 ||
Posix.grantpt(masterfd) == -1 || Posix.unlockpt(masterfd) == -1) ||
(Linux.Termios.ptsname_r(masterfd, slavedev)) != 0){
    stdout.printf("Failed to create pts.\n");
    return(false);
}

but this fails. Help. :D

Thanks!


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]