FreeBSD mods, mostly in comments
This commit is contained in:
parent
4a47a768c6
commit
702f0126c5
|
@ -2,7 +2,8 @@
|
||||||
;;; Copyright (c) 1993 by Olin Shivers.
|
;;; Copyright (c) 1993 by Olin Shivers.
|
||||||
;;; Copyright (c) 1994 by Brian D. Carlstrom.
|
;;; Copyright (c) 1994 by Brian D. Carlstrom.
|
||||||
|
|
||||||
;;; These are the correct values for NetBSD 1.0 systems.
|
;;; These are the correct values for BSD4.4-Lite-based systems
|
||||||
|
;;; such as NetBSD 1.0 and FreeBSD 2.0.
|
||||||
|
|
||||||
(define-syntax define-errnos
|
(define-syntax define-errnos
|
||||||
(syntax-rules ()
|
(syntax-rules ()
|
||||||
|
@ -23,14 +24,14 @@
|
||||||
(noexec 8) ; Exec format error
|
(noexec 8) ; Exec format error
|
||||||
(badf 9) ; Bad file descriptor
|
(badf 9) ; Bad file descriptor
|
||||||
(child 10) ; No child processes
|
(child 10) ; No child processes
|
||||||
;; NetBSD
|
;; BSD4.4-Lite
|
||||||
(deadlk 11) ; Resource deadlock avoided
|
(deadlk 11) ; Resource deadlock avoided
|
||||||
;; POSIX:
|
;; POSIX:
|
||||||
(nomem 12) ; Not enough space
|
(nomem 12) ; Not enough space
|
||||||
(acces 13) ; Permission denied
|
(acces 13) ; Permission denied
|
||||||
(fault 14) ; Bad address
|
(fault 14) ; Bad address
|
||||||
|
|
||||||
;; NetBSD
|
;; BSD4.4-Lite
|
||||||
(notblk 15) ; Block device required
|
(notblk 15) ; Block device required
|
||||||
|
|
||||||
;; POSIX
|
;; POSIX
|
||||||
|
@ -44,7 +45,7 @@
|
||||||
(nfile 23) ; Too many open files in system
|
(nfile 23) ; Too many open files in system
|
||||||
(mfile 24) ; Too many open files
|
(mfile 24) ; Too many open files
|
||||||
(notty 25) ; Inappropriate I/O control operation
|
(notty 25) ; Inappropriate I/O control operation
|
||||||
;; NetBSD
|
;; BSD4.4-Lite
|
||||||
(txtbsy 26) ; Text file busy
|
(txtbsy 26) ; Text file busy
|
||||||
;; POSIX
|
;; POSIX
|
||||||
(fbig 27) ; File too large
|
(fbig 27) ; File too large
|
||||||
|
@ -62,7 +63,7 @@
|
||||||
;; POSIX
|
;; POSIX
|
||||||
(again 35) ; Resource temporarily unavaile (note overlap)
|
(again 35) ; Resource temporarily unavaile (note overlap)
|
||||||
|
|
||||||
;; NetBSD
|
;; BSD4.4-Lite
|
||||||
;; non-blocking and interrupt i/o
|
;; non-blocking and interrupt i/o
|
||||||
(wouldblock 35) ; Operation would block
|
(wouldblock 35) ; Operation would block
|
||||||
(inprogress 36) ; Operation now in progress
|
(inprogress 36) ; Operation now in progress
|
||||||
|
@ -103,14 +104,14 @@
|
||||||
;; POSIX:
|
;; POSIX:
|
||||||
(nametoolong 63) ; File name too long
|
(nametoolong 63) ; File name too long
|
||||||
|
|
||||||
;; NetBSD
|
;; BSD4.4-Lite
|
||||||
(hostdown 64) ; Host is down
|
(hostdown 64) ; Host is down
|
||||||
(hostunreach 65) ; No route to host
|
(hostunreach 65) ; No route to host
|
||||||
|
|
||||||
;; POSIX:
|
;; POSIX:
|
||||||
(notempty 66) ; Directory not empty
|
(notempty 66) ; Directory not empty
|
||||||
|
|
||||||
;; NetBSD
|
;; BSD4.4-Lite
|
||||||
;; quotas & mush
|
;; quotas & mush
|
||||||
(proclim 67) ; Too many processes
|
(proclim 67) ; Too many processes
|
||||||
(users 68) ; Too many users
|
(users 68) ; Too many users
|
||||||
|
@ -130,7 +131,7 @@
|
||||||
;; POSIX
|
;; POSIX
|
||||||
(nosys 78) ; Function not implemented
|
(nosys 78) ; Function not implemented
|
||||||
|
|
||||||
;; NetBSD
|
;; BSD4.4-Lite
|
||||||
(ftype 79) ; Inappropriate file type or format
|
(ftype 79) ; Inappropriate file type or format
|
||||||
(auth 80) ; Authentication error
|
(auth 80) ; Authentication error
|
||||||
(needauth 81) ; Need authenticator
|
(needauth 81) ; Need authenticator
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
(nonblocking #x0004) ; no delay
|
(nonblocking #x0004) ; no delay
|
||||||
(append #x0008) ; set append mode
|
(append #x0008) ; set append mode
|
||||||
|
|
||||||
;; NetBSD
|
;; BSD4.4-Lite
|
||||||
(shlock #x0010) ; open with shared file lock
|
(shlock #x0010) ; open with shared file lock
|
||||||
(exlock #x0020) ; open with exclusive file lock
|
(exlock #x0020) ; open with exclusive file lock
|
||||||
(async #x0040) ; signal pgrep when data ready
|
(async #x0040) ; signal pgrep when data ready
|
||||||
|
|
|
@ -113,7 +113,7 @@
|
||||||
socket/broadcast
|
socket/broadcast
|
||||||
socket/use-loop-back
|
socket/use-loop-back
|
||||||
socket/oob-inline
|
socket/oob-inline
|
||||||
socket/reuse-port ;netbsd
|
socket/reuse-port ;BSD4.4-Lite
|
||||||
; socket/use-privileged
|
; socket/use-privileged
|
||||||
; socket/cant-signal
|
; socket/cant-signal
|
||||||
tcp/no-delay))
|
tcp/no-delay))
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
;;; Interfaces and packages for the NetBSD specific parts of scsh.
|
;;; Interfaces and packages for the BSD4.4-Lite specific parts of scsh.
|
||||||
;;; Copyright (c) 1994 by Olin Shivers.
|
;;; Copyright (c) 1994 by Olin Shivers.
|
||||||
;;; Copyright (c) 1994 by Brian D. Carlstrom.
|
;;; Copyright (c) 1994 by Brian D. Carlstrom.
|
||||||
|
|
||||||
(define-interface netbsd-fdflags-extras-interface
|
(define-interface bsd44lite-fdflags-extras-interface
|
||||||
(export open/shlock
|
(export open/shlock
|
||||||
open/exlock
|
open/exlock
|
||||||
open/async
|
open/async
|
||||||
|
@ -10,7 +10,7 @@
|
||||||
fcntl/get-owner
|
fcntl/get-owner
|
||||||
fcntl/set-owner))
|
fcntl/set-owner))
|
||||||
|
|
||||||
(define-interface netbsd-errno-extras-interface
|
(define-interface bsd44lite-errno-extras-interface
|
||||||
(export errno/deadlk
|
(export errno/deadlk
|
||||||
errno/notblk
|
errno/notblk
|
||||||
errno/txtbsy
|
errno/txtbsy
|
||||||
|
@ -59,7 +59,7 @@
|
||||||
errno/needauth
|
errno/needauth
|
||||||
errno/last))
|
errno/last))
|
||||||
|
|
||||||
(define-interface netbsd-signals-extras-interface
|
(define-interface bsd44lite-signals-extras-interface
|
||||||
(export signal/trap
|
(export signal/trap
|
||||||
signal/emt
|
signal/emt
|
||||||
signal/bus
|
signal/bus
|
||||||
|
@ -74,7 +74,7 @@
|
||||||
signal/winch
|
signal/winch
|
||||||
signal/info))
|
signal/info))
|
||||||
|
|
||||||
(define-interface netbsd-network-extras-interface
|
(define-interface bsd44lite-network-extras-interface
|
||||||
(export socket/debug
|
(export socket/debug
|
||||||
socket/accept-connect
|
socket/accept-connect
|
||||||
socket/reuse-address
|
socket/reuse-address
|
||||||
|
@ -84,7 +84,7 @@
|
||||||
socket/use-loop-back
|
socket/use-loop-back
|
||||||
socket/linger
|
socket/linger
|
||||||
socket/oob-inline
|
socket/oob-inline
|
||||||
socket/reuse-port ;netbsd
|
socket/reuse-port ;bsd44lite
|
||||||
; socket/use-privileged
|
; socket/use-privileged
|
||||||
; socket/cant-signal
|
; socket/cant-signal
|
||||||
socket/send-buffer
|
socket/send-buffer
|
||||||
|
@ -95,7 +95,7 @@
|
||||||
socket/receive-timeout
|
socket/receive-timeout
|
||||||
socket/error
|
socket/error
|
||||||
socket/type
|
socket/type
|
||||||
;;; all ip/* but ip/options and ip/time-to-live netbsd only
|
;;; all ip/* but ip/options and ip/time-to-live bsd44lite only
|
||||||
ip/options
|
ip/options
|
||||||
ip/header-included
|
ip/header-included
|
||||||
ip/type-of-service
|
ip/type-of-service
|
||||||
|
@ -117,22 +117,22 @@
|
||||||
message/wait-all
|
message/wait-all
|
||||||
message/dont-wait))
|
message/dont-wait))
|
||||||
|
|
||||||
(define-interface netbsd-extras-interface
|
(define-interface bsd44lite-extras-interface
|
||||||
(compound-interface netbsd-errno-extras-interface
|
(compound-interface bsd44lite-errno-extras-interface
|
||||||
netbsd-fdflags-extras-interface
|
bsd44lite-fdflags-extras-interface
|
||||||
netbsd-network-extras-interface
|
bsd44lite-network-extras-interface
|
||||||
netbsd-signals-extras-interface))
|
bsd44lite-signals-extras-interface))
|
||||||
|
|
||||||
(define-interface netbsd-defs-interface
|
(define-interface bsd44lite-defs-interface
|
||||||
(compound-interface netbsd-extras-interface
|
(compound-interface bsd44lite-extras-interface
|
||||||
sockets-network-interface
|
sockets-network-interface
|
||||||
posix-errno-interface
|
posix-errno-interface
|
||||||
posix-fdflags-interface
|
posix-fdflags-interface
|
||||||
posix-signals-interface))
|
posix-signals-interface))
|
||||||
|
|
||||||
(define-structure netbsd-defs netbsd-defs-interface
|
(define-structure bsd44lite-defs bsd44lite-defs-interface
|
||||||
(open scheme bitwise defenum-package)
|
(open scheme bitwise defenum-package)
|
||||||
(files fdflags errno signals netconst))
|
(files fdflags errno signals netconst))
|
||||||
|
|
||||||
(define-interface os-extras-interface netbsd-extras-interface)
|
(define-interface os-extras-interface bsd44lite-extras-interface)
|
||||||
(define os-dependent netbsd-defs)
|
(define os-dependent bsd44lite-defs)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
;;; Signal constant definitions for NetBSD
|
;;; Signal constant definitions for BSD4.4-Lite
|
||||||
;;; Copyright (c) 1994 by Olin Shivers.
|
;;; Copyright (c) 1994 by Olin Shivers.
|
||||||
;;; Copyright (c) 1994 by Brian D. Carlstrom.
|
;;; Copyright (c) 1994 by Brian D. Carlstrom.
|
||||||
|
|
||||||
|
@ -14,27 +14,27 @@
|
||||||
(quit 3) ; quit
|
(quit 3) ; quit
|
||||||
(ill 4) ; illegal instruction (not reset when caught)
|
(ill 4) ; illegal instruction (not reset when caught)
|
||||||
|
|
||||||
;; NetBSD
|
;; BSD4.4-Lite
|
||||||
(trap 5) ; trace trap (not reset when caught)
|
(trap 5) ; trace trap (not reset when caught)
|
||||||
|
|
||||||
;; POSIX
|
;; POSIX
|
||||||
(iot 6) ; IOT instruction
|
(iot 6) ; IOT instruction
|
||||||
(abrt 6) ; used by abort, replace SIGIOT in the future
|
(abrt 6) ; used by abort, replace SIGIOT in the future
|
||||||
|
|
||||||
;; NetBSD
|
;; BSD4.4-Lite
|
||||||
(emt 7) ; EMT instruction
|
(emt 7) ; EMT instruction
|
||||||
|
|
||||||
;; POSIX
|
;; POSIX
|
||||||
(fpe 8) ; floating point exception
|
(fpe 8) ; floating point exception
|
||||||
(kill 9) ; kill (cannot be caught or ignored)
|
(kill 9) ; kill (cannot be caught or ignored)
|
||||||
|
|
||||||
;; NetBSD
|
;; BSD4.4-Lite
|
||||||
(bus 10) ; bus error
|
(bus 10) ; bus error
|
||||||
|
|
||||||
;; POSIX
|
;; POSIX
|
||||||
(segv 11) ; segmentation violation
|
(segv 11) ; segmentation violation
|
||||||
|
|
||||||
;; NetBSD
|
;; BSD4.4-Lite
|
||||||
(sys 12) ; bad argument to system call
|
(sys 12) ; bad argument to system call
|
||||||
|
|
||||||
;; POSIX
|
;; POSIX
|
||||||
|
@ -42,7 +42,7 @@
|
||||||
(alrm 14) ; alarm clock
|
(alrm 14) ; alarm clock
|
||||||
(term 15) ; software termination signal from kill
|
(term 15) ; software termination signal from kill
|
||||||
|
|
||||||
;; NetBSD
|
;; BSD4.4-Lite
|
||||||
(urg 16) ; urgent condition on IO channel
|
(urg 16) ; urgent condition on IO channel
|
||||||
|
|
||||||
;; POSIX
|
;; POSIX
|
||||||
|
@ -51,14 +51,14 @@
|
||||||
(cont 19) ; continue a stopped process
|
(cont 19) ; continue a stopped process
|
||||||
(chld 20) ; to parent on child stop or exit
|
(chld 20) ; to parent on child stop or exit
|
||||||
|
|
||||||
;; NetBSD
|
;; BSD4.4-Lite
|
||||||
(cld 20) ; System V name for SIGCHLD
|
(cld 20) ; System V name for SIGCHLD
|
||||||
|
|
||||||
;; POSIX
|
;; POSIX
|
||||||
(ttin 21) ; to readers pgrp upon background tty read
|
(ttin 21) ; to readers pgrp upon background tty read
|
||||||
(ttou 22) ; like TTIN for output if (tp->t_local<OSTOP)
|
(ttou 22) ; like TTIN for output if (tp->t_local<OSTOP)
|
||||||
|
|
||||||
;; NetBSD
|
;; BSD4.4-Lite
|
||||||
(io 23) ; input/output possible signal
|
(io 23) ; input/output possible signal
|
||||||
(xcpu 24) ; exceeded CPU time limit
|
(xcpu 24) ; exceeded CPU time limit
|
||||||
(xfsz 25) ; exceeded file size limit
|
(xfsz 25) ; exceeded file size limit
|
||||||
|
|
|
@ -4,7 +4,8 @@
|
||||||
;;; Constants from NetBSD header files substituted by Bill Sommerfeld
|
;;; Constants from NetBSD header files substituted by Bill Sommerfeld
|
||||||
|
|
||||||
;;; These constants are for NetBSD 1.1 pre-alpha
|
;;; These constants are for NetBSD 1.1 pre-alpha
|
||||||
;;; and are taken from /usr/include/sys/termios.h.
|
;;; and are taken from /usr/include/sys/termios.h. These should
|
||||||
|
;;; work with any BSD4.4-Lite derived system (such as FreeBSD).
|
||||||
|
|
||||||
;;; Non-standard (POSIX, SVR4, 4.3+BSD) things:
|
;;; Non-standard (POSIX, SVR4, 4.3+BSD) things:
|
||||||
;;; - Some of the baud rates.
|
;;; - Some of the baud rates.
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
;;; To port these to a new OS, consult /usr/include/sys/wait.h,
|
;;; To port these to a new OS, consult /usr/include/sys/wait.h,
|
||||||
;;; and check the WIFEXITED, WEXITSTATUS, WIFSTOPPED, WSTOPSIG,
|
;;; and check the WIFEXITED, WEXITSTATUS, WIFSTOPPED, WSTOPSIG,
|
||||||
;;; WIFSIGNALED, and WTERMSIG macros for the magic fields they use.
|
;;; WIFSIGNALED, and WTERMSIG macros for the magic fields they use.
|
||||||
;;; These definitions are for NetBSD.
|
;;; These definitions are for BSD4.4-Lite.
|
||||||
;;;
|
;;;
|
||||||
;;; I could have done a portable version by making C calls for this,
|
;;; I could have done a portable version by making C calls for this,
|
||||||
;;; but it's such overkill.
|
;;; but it's such overkill.
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
4.1
|
4.2
|
||||||
|
|
2
unix.c
2
unix.c
|
@ -175,7 +175,7 @@ char_ready_p( FILE* stream )
|
||||||
#elif defined(__linux__)
|
#elif defined(__linux__)
|
||||||
if (stream->_IO_read_ptr < stream->_IO_read_end)
|
if (stream->_IO_read_ptr < stream->_IO_read_end)
|
||||||
return 1;
|
return 1;
|
||||||
#elif defined(__NetBSD__)
|
#elif defined(BSD) && (BSD >= 199306)
|
||||||
if (stream->_r)
|
if (stream->_r)
|
||||||
return 1;
|
return 1;
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Reference in New Issue