URI: 
       t9term: fix getpts on FreeBSD 11.2 (#199) - 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
       ---
   DIR commit 014fd65a5ca780823c0e75787f193d3c6597de8f
   DIR parent 13ed1c423ecbd45d2ca982f2a7a433b785873629
  HTML Author: Xiao-Yong <jinxiaoyong@gmail.com>
       Date:   Tue, 13 Nov 2018 22:09:10 -0600
       
       9term: fix getpts on FreeBSD 11.2 (#199)
       
       Opening /dev/ptyXX files fails on recent
       FreeBSD versions.
       
       Following the same fix being applied to
       Linux, OpenBSD, and Darwin, we use openpty
       tto open a pseudoterminal in openpts.
       Diffstat:
         M src/cmd/9term/FreeBSD.c             |      16 ++++++++++++++++
       
       1 file changed, 16 insertions(+), 0 deletions(-)
       ---
   DIR diff --git a/src/cmd/9term/FreeBSD.c b/src/cmd/9term/FreeBSD.c
       t@@ -1 +1,17 @@
       +#define getpts not_using_this_getpts
        #include "bsdpty.c"
       +#undef getpts
       +
       +#include <libutil.h>
       +
       +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;
       +}