mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-12 11:10:07 +00:00
handle pty correctly on linux
This commit is contained in:
parent
2b9172c7d4
commit
3694b738b8
1 changed files with 14 additions and 0 deletions
|
@ -1 +1,15 @@
|
||||||
|
#define getpts not_using_this_getpts
|
||||||
#include "bsdpty.c"
|
#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;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue