chibi-scheme/lib/chibi/pty.stub
Kris Katterjohn 8b6e236b09 (chibi pty): fix compilation errors on the BSDs
* Include util.h instead of pty.h on OpenBSD and NetBSD

* Include libutil.h instead of pty.h on FreeBSD and DragonFly BSD

* Include utmp.h only on non-BSD systems (FreeBSD does not have that
  header and none of these BSDs require it)

Tested on all four of these BSDs.
2019-08-22 16:33:10 -05:00

18 lines
636 B
Text

(cond-expand
((or macosx openbsd netbsd) (c-system-include "util.h"))
((or freebsd dragonfly) (c-system-include "libutil.h"))
(else (c-system-include "pty.h")))
(cond-expand
((not bsd) (c-system-include "utmp.h")))
(c-link "util")
(declare-c-struct termios)
(declare-c-struct winsize)
(define-c errno openpty
((result fileno) (result fileno) (result (array char 256)) (maybe-null default NULL termios) (maybe-null default NULL winsize)))
(define-c pid_t forkpty
((result fileno) (result (array char 256)) (maybe-null default NULL termios) (maybe-null default NULL winsize)))
(define-c int (login-tty "login_tty") (fileno))