URI:
       tFreeBSD.c - plan9port - [fork] Plan 9 from user space
  HTML git clone git://src.adamsgaard.dk/plan9port
   DIR Log
   DIR Files
   DIR Refs
   DIR README
   DIR LICENSE
       ---
       tFreeBSD.c (289B)
       ---
            1 #define getpts not_using_this_getpts
            2 #include "bsdpty.c"
            3 #undef getpts
            4 
            5 #include <libutil.h>
            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");
           16         return 0;
           17 }