tNetBSD.c - plan9port - [fork] Plan 9 from user space
git clone git://src.adamsgaard.dk/plan9port
Log
Files
Refs
README
LICENSE
---
tNetBSD.c (290B)
---
     1 #define getpts not_using_this_getpts
     2 #include "bsdpty.c"
     3 #undef getpts
     4 
     5 #include 
     6 
     7 int
     8 getpts(int fd[], char *slave)
     9 {
    10         if(openpty(&fd[1], &fd[0], NULL, NULL, NULL) >= 0){
    11                 fchmod(fd[1], 0620);
    12                 strcpy(slave, ttyname(fd[0]));
    13                 return 0;
    14         }
    15         sysfatal("no ptys: %r");
    16         return 0;
    17 }