commit 3694b738b883dec5b93f11d4025541af5f713482 from: rsc date: Mon Dec 27 00:38:00 2004 UTC handle pty correctly on linux commit - 2b9172c7d4f8f3f773946e1aab4f9376f50b4cf7 commit + 3694b738b883dec5b93f11d4025541af5f713482 blob - eec79c286b4360f3f20ac5f3478d7b949e150ddf blob + a9bf6f9a9d101958413c25df0f1cd8e1126e8c3c --- src/cmd/9term/Linux.c +++ src/cmd/9term/Linux.c @@ -1 +1,15 @@ +#define getpts not_using_this_getpts #include "bsdpty.c" +#undef getpts + +int +getpts(int fd[], char *slave) +{ + if(openpty(&fd[1], &fd[0], NULL, NULL, NULL) >= 0){ + fchmod(fd[1], 0620); + strcpy(slave, ttyname(fd[0])); + return 0; + } + sysfatal("no ptys"); + return 0; +}