mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-18 21:29:19 +02:00
* 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.
18 lines
636 B
Text
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))
|