OS specific definitions for GNU Hurd by Andreas Voegele.
This commit is contained in:
parent
ecfbbfeaab
commit
8dc7a4af45
|
@ -283,6 +283,12 @@ AC_INIT(c/scheme48vm.c)
|
|||
EXEEXT=".exe"
|
||||
;;
|
||||
|
||||
## The GNU Hurd
|
||||
*-*-gnu* )
|
||||
machine=gnu
|
||||
SCSH_ELF
|
||||
;;
|
||||
|
||||
## Generic Configuration
|
||||
* )
|
||||
machine=generic
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
# Make `diff' happy.
|
|
@ -0,0 +1,13 @@
|
|||
;;; Flags that control buffering policy.
|
||||
;;; Copyright (c) 1993 by Olin Shivers. See file COPYING.
|
||||
;;; Copyright (c) 1995 by Brian D. Carlstrom.
|
||||
|
||||
;;; These are for the SET-PORT-BUFFERING procedure, essentially a Scheme
|
||||
;;; analog of the setbuf(3S) stdio call. We use the actual stdio values.
|
||||
;;; These constants are not likely to change from stdio lib to stdio lib,
|
||||
;;; but you need to check when you do a port.
|
||||
|
||||
(define-enum-constants bufpol
|
||||
(block 0) ; _IOFBF
|
||||
(line 1) ; _IOLBF
|
||||
(none 2)) ; _IONBF
|
|
@ -0,0 +1,110 @@
|
|||
;;; Errno constant definitions.
|
||||
;;; Copyright (c) 1993 by Olin Shivers. See file COPYING.
|
||||
|
||||
;;; These are the correct values for the GNU Hurd.
|
||||
|
||||
(define (hurd-errno n)
|
||||
(bitwise-ior (arithmetic-shift #x10 26) (bitwise-and n #x3fff)))
|
||||
|
||||
(define errno/perm (hurd-errno 1)) ; Operation not permitted
|
||||
(define errno/noent (hurd-errno 2)) ; No such file or directory
|
||||
(define errno/srch (hurd-errno 3)) ; No such process
|
||||
(define errno/intr (hurd-errno 4)) ; Interrupted system call
|
||||
(define errno/io (hurd-errno 5)) ; Input/output error
|
||||
(define errno/nxio (hurd-errno 6)) ; No such device or address
|
||||
(define errno/2big (hurd-errno 7)) ; Argument list too long
|
||||
(define errno/noexec (hurd-errno 8)) ; Exec format error
|
||||
(define errno/badf (hurd-errno 9)) ; Bad file descriptor
|
||||
(define errno/child (hurd-errno 10)) ; No child processes
|
||||
(define errno/deadlk (hurd-errno 11)) ; Resource deadlock avoided
|
||||
(define errno/nomem (hurd-errno 12)) ; Cannot allocate memory
|
||||
(define errno/acces (hurd-errno 13)) ; Permission denied
|
||||
(define errno/fault (hurd-errno 14)) ; Bad address
|
||||
(define errno/notblk (hurd-errno 15)) ; Block device required
|
||||
(define errno/busy (hurd-errno 16)) ; Device or resource busy
|
||||
(define errno/exist (hurd-errno 17)) ; File exists
|
||||
(define errno/xdev (hurd-errno 18)) ; Invalid cross-device link
|
||||
(define errno/nodev (hurd-errno 19)) ; No such device
|
||||
(define errno/notdir (hurd-errno 20)) ; Not a directory
|
||||
(define errno/isdir (hurd-errno 21)) ; Is a directory
|
||||
(define errno/inval (hurd-errno 22)) ; Invalid argument
|
||||
(define errno/nfile (hurd-errno 23)) ; Too many open files in system
|
||||
(define errno/mfile (hurd-errno 24)) ; Too many open files
|
||||
(define errno/notty (hurd-errno 25)) ; Inappropriate ioctl for device
|
||||
(define errno/txtbsy (hurd-errno 26)) ; Text file busy
|
||||
(define errno/fbig (hurd-errno 27)) ; File too large
|
||||
(define errno/nospc (hurd-errno 28)) ; No space left on device
|
||||
(define errno/spipe (hurd-errno 29)) ; Illegal seek
|
||||
(define errno/rofs (hurd-errno 30)) ; Read-only file system
|
||||
(define errno/mlink (hurd-errno 31)) ; Too many links
|
||||
(define errno/pipe (hurd-errno 32)) ; Broken pipe
|
||||
(define errno/dom (hurd-errno 33)) ; Numerical argument out of domain
|
||||
(define errno/range (hurd-errno 34)) ; Numerical result out of range
|
||||
(define errno/again (hurd-errno 35)) ; Resource temporarily unavailable
|
||||
(define errno/wouldblock (hurd-errno 35)) ; Operation would block
|
||||
(define errno/inprogress (hurd-errno 36)) ; Operation now in progress
|
||||
(define errno/already (hurd-errno 37)) ; Operation already in progress
|
||||
(define errno/notsock (hurd-errno 38)) ; Socket operation on non-socket
|
||||
(define errno/destaddrreq (hurd-errno 39)) ; Destination address required
|
||||
(define errno/msgsize (hurd-errno 40)) ; Message too long
|
||||
(define errno/prototype (hurd-errno 41)) ; Protocol wrong type for socket
|
||||
(define errno/noprotoopt (hurd-errno 42)) ; Protocol not available
|
||||
(define errno/protonosupport (hurd-errno 43)) ; Protocol not supported
|
||||
(define errno/socktnosupport (hurd-errno 44)) ; Socket type not supported
|
||||
(define errno/opnotsupp (hurd-errno 45)) ; Operation not supported
|
||||
(define errno/pfnosupport (hurd-errno 46)) ; Protocol family not supported
|
||||
(define errno/afnosupport (hurd-errno 47)) ; Address family not supported by protocol
|
||||
(define errno/addrinuse (hurd-errno 48)) ; Address already in use
|
||||
(define errno/addrnotavail (hurd-errno 49)) ; Cannot assign requested address
|
||||
(define errno/netdown (hurd-errno 50)) ; Network is down
|
||||
(define errno/netunreach (hurd-errno 51)) ; Network is unreachable
|
||||
(define errno/netreset (hurd-errno 52)) ; Network dropped connection on reset
|
||||
(define errno/connaborted (hurd-errno 53)) ; Software caused connection abort
|
||||
(define errno/connreset (hurd-errno 54)) ; Connection reset by peer
|
||||
(define errno/nobufs (hurd-errno 55)) ; No buffer space available
|
||||
(define errno/isconn (hurd-errno 56)) ; Transport endpoint is already connected
|
||||
(define errno/notconn (hurd-errno 57)) ; Transport endpoint is not connected
|
||||
(define errno/shutdown (hurd-errno 58)) ; Cannot send after transport endpoint shutdown
|
||||
(define errno/toomanyrefs (hurd-errno 59)) ; Too many references: cannot splice
|
||||
(define errno/timedout (hurd-errno 60)) ; Connection timed out
|
||||
(define errno/connrefused (hurd-errno 61)) ; Connection refused
|
||||
(define errno/loop (hurd-errno 62)) ; Too many levels of symbolic links
|
||||
(define errno/nametoolong (hurd-errno 63)) ; File name too long
|
||||
(define errno/hostdown (hurd-errno 64)) ; Host is down
|
||||
(define errno/hostunreach (hurd-errno 65)) ; No route to host
|
||||
(define errno/notempty (hurd-errno 66)) ; Directory not empty
|
||||
(define errno/proclim (hurd-errno 67)) ; Too many processes
|
||||
(define errno/users (hurd-errno 68)) ; Too many users
|
||||
(define errno/dquot (hurd-errno 69)) ; Disk quota exceeded
|
||||
(define errno/stale (hurd-errno 70)) ; Stale NFS file handle
|
||||
(define errno/remote (hurd-errno 71)) ; Object is remote
|
||||
(define errno/badrpc (hurd-errno 72)) ; RPC struct is bad
|
||||
(define errno/rpcmismatch (hurd-errno 73)) ; RPC version wrong
|
||||
(define errno/progunavail (hurd-errno 74)) ; RPC program not available
|
||||
(define errno/progmismatch (hurd-errno 75)) ; RPC program version wrong
|
||||
(define errno/procunavail (hurd-errno 76)) ; RPC bad procedure for program
|
||||
(define errno/nolck (hurd-errno 77)) ; No locks available
|
||||
(define errno/nosys (hurd-errno 78)) ; Function not implemented
|
||||
(define errno/ftype (hurd-errno 79)) ; Inappropriate file type or format
|
||||
(define errno/auth (hurd-errno 80)) ; Authentication error
|
||||
(define errno/needauth (hurd-errno 81)) ; Need authenticator
|
||||
(define errno/background (hurd-errno 100)) ; Inappropriate operation for background process
|
||||
(define errno/died (hurd-errno 101)) ; Translator died
|
||||
(define errno/d (hurd-errno 102)) ; ?
|
||||
(define errno/gregious (hurd-errno 103)) ; You really blew it this time
|
||||
(define errno/ieio (hurd-errno 104)) ; Computer bought the farm
|
||||
(define errno/gratuitous (hurd-errno 105)) ; Gratuitous error
|
||||
(define errno/ilseq (hurd-errno 106)) ; Invalid or incomplete multibyte or wide character
|
||||
(define errno/badmsg (hurd-errno 107)) ; Bad message
|
||||
(define errno/idrm (hurd-errno 108)) ; Identifier removed
|
||||
(define errno/multihop (hurd-errno 109)) ; Multihop attempted
|
||||
(define errno/nodata (hurd-errno 110)) ; No data available
|
||||
(define errno/nolink (hurd-errno 111)) ; Link has been severed
|
||||
(define errno/nomsg (hurd-errno 112)) ; No message of desired type
|
||||
(define errno/nosr (hurd-errno 113)) ; Out of streams resources
|
||||
(define errno/nostr (hurd-errno 114)) ; Device not a stream
|
||||
(define errno/overflow (hurd-errno 115)) ; Value too large for defined data type
|
||||
(define errno/proto (hurd-errno 116)) ; Protocol error
|
||||
(define errno/time (hurd-errno 117)) ; Timer expired
|
||||
(define errno/canceled (hurd-errno 118)) ; Operation cancelled
|
||||
(define errno/notsup (hurd-errno 118)) ; Not supported
|
|
@ -0,0 +1,59 @@
|
|||
;;; Flags for open(2) and fcntl(2).
|
||||
;;; Copyright (c) 1993 by Olin Shivers. See file COPYING.
|
||||
|
||||
(define-enum-constants open
|
||||
;; POSIX
|
||||
(read #x0001) ; Open for reading
|
||||
(write #x0002) ; Open for writing
|
||||
(read+write #x0003) ; Open for reading and writing
|
||||
(non-blocking #x0008) ; Non-blocking open or non-blocking I/O
|
||||
(append #x0100) ; Writes always append to the file
|
||||
(no-control-tty 0) ; Don't assign a controlling terminal
|
||||
(create #x0010) ; Create file if it doesn't exist
|
||||
(truncate #x00010000) ; Truncate file to zero length
|
||||
(exclusive #x0020) ; Fail if file already exists
|
||||
|
||||
;; BSD
|
||||
(shared-lock #x00020000) ; Open with shared file lock
|
||||
(exclusive-lock #x00040000) ; Open with exclusive file lock
|
||||
(async #x0200) ; Send SIGIO to owner when data is ready
|
||||
(fsync #x0400) ; Synchronous writes
|
||||
|
||||
;; GNU
|
||||
(execute #x0004) ; Open for execution
|
||||
(no-link #x0040) ; No name mappings on final component
|
||||
(no-translator #x0080) ; No translator on final component
|
||||
(no-access-time #x0800) ; Don't set access time on read
|
||||
(ignore-control-tty #x00080000)) ; Don't do any ctty magic at all
|
||||
|
||||
(define open/access-mask
|
||||
(bitwise-ior open/read
|
||||
(bitwise-ior open/write open/read+write)))
|
||||
|
||||
;;; fcntl() commands
|
||||
(define-enum-constants fcntl
|
||||
(dup-fdes 0) ; F_DUPFD
|
||||
(get-fdes-flags 1) ; F_GETFD
|
||||
(set-fdes-flags 2) ; F_SETFD
|
||||
(get-status-flags 3) ; F_GETFL
|
||||
(set-status-flags 4) ; F_SETFL
|
||||
(get-owner 5) ; F_GETOWN (Not POSIX)
|
||||
(set-owner 6) ; F_SETOWN (Not POSIX)
|
||||
(get-record-lock 7) ; F_GETLK
|
||||
(set-record-lock-no-block 8) ; F_SETLK
|
||||
(set-record-lock 9)) ; F_SETLKW
|
||||
|
||||
;;; fcntl fdes-flags (F_GETFD)
|
||||
|
||||
(define fdflags/close-on-exec 1)
|
||||
|
||||
;;; fcntl status-flags (F_GETFL)
|
||||
;;; Mostly, these are OPEN/... flags, like OPEN/APPEND.
|
||||
;;; (define fdstatus/... ...)
|
||||
|
||||
;;; fcntl lock values.
|
||||
|
||||
(define-enum-constants lock
|
||||
(read 1) ; F_RDLCK
|
||||
(write 2) ; F_WRLCK
|
||||
(release 3)) ; F_UNLCK
|
|
@ -0,0 +1,4 @@
|
|||
/* OS-dependent support for what is supposed to be the standard ANSI C Library.
|
||||
** Copyright (c) 1996 by Brian D. Carlstrom.
|
||||
*/
|
||||
|
|
@ -0,0 +1,139 @@
|
|||
;;; Magic Numbers for Networking
|
||||
;;; Copyright (c) 1994 by Brian D. Carlstrom. See file COPYING.
|
||||
|
||||
;;; magic numbers not from header file
|
||||
;;; but from man page
|
||||
;;; why can't unix make up its mind
|
||||
(define shutdown/receives 0)
|
||||
(define shutdown/sends 1)
|
||||
(define shutdown/sends+receives 2)
|
||||
|
||||
;;;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|
||||
;;; BELOW THIS POINT ARE BITS FROM:
|
||||
;;; <sys/socket.h>
|
||||
;;; <sys/un.h>
|
||||
;;; <netinet/in.h>
|
||||
;;; <netinet/tcp.h>
|
||||
;;; <netdb.h>
|
||||
;;;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|
||||
|
||||
;;; ADDRESS FAMILIES -- <sys/socket.h>
|
||||
(define address-family/unspecified 0) ; unspecified
|
||||
(define address-family/unix 1) ; local to host (pipes, portals)
|
||||
(define address-family/internet 2) ; internetwork: UDP, TCP, etc.
|
||||
|
||||
;;; SOCKET TYPES -- <sys/socket.h>
|
||||
(define socket-type/stream 1) ; stream socket
|
||||
(define socket-type/datagram 2) ; datagram socket
|
||||
(define socket-type/raw 3) ; raw-protocol interface
|
||||
;;(define socket-type/rdm 4) ; reliably-delivered message
|
||||
;;(define socket-type/seqpacket 5) ; sequenced packet stream
|
||||
|
||||
;;; PROTOCOL FAMILIES -- <sys/socket.h>
|
||||
(define protocol-family/unspecified 0) ; unspecified
|
||||
(define protocol-family/unix 1) ; local to host (pipes, portals)
|
||||
(define protocol-family/internet 2) ; internetwork: UDP, TCP, etc.
|
||||
|
||||
;;; Well know addresses -- <netinet/in.h>
|
||||
(define internet-address/any #x00000000)
|
||||
(define internet-address/loopback #x7f000001)
|
||||
(define internet-address/broadcast #xffffffff) ; must be masked
|
||||
|
||||
;;; errors from host lookup -- <netdb.h>
|
||||
(define herror/host-not-found 1) ;Authoritative Answer Host not found
|
||||
(define herror/try-again 2) ;Non-Authoritive Host not found, or SERVERFAIL
|
||||
(define herror/no-recovery 3) ;Non recoverable errors, FORMERR, REFUSED, NOTIMP
|
||||
(define herror/no-data 4) ;Valid name, no data record of requested type
|
||||
(define herror/no-address herror/no-data) ;no address, look for MX record
|
||||
|
||||
;;; flags for send/recv -- <sys/socket.h>
|
||||
(define message/out-of-band 1) ; process out-of-band data
|
||||
(define message/peek 2) ; peek at incoming message
|
||||
(define message/dont-route 4) ; send without using routing tables
|
||||
(define message/eor 8) ; data completes record
|
||||
(define message/trunc #x10) ; data discarded before delivery
|
||||
(define message/ctrunc #x20) ; control data lost before delivery
|
||||
(define message/wait-all #x40) ; wait for full request or error
|
||||
(define message/dont-wait #x80) ; this message should be nonblocking
|
||||
|
||||
;;; protocol level for socket options -- <sys/socket.h>
|
||||
(define level/socket #xffff) ; SOL_SOCKET: options for socket level
|
||||
|
||||
;;; socket options -- <sys/socket.h>
|
||||
(define socket/debug #x0001) ; turn on debugging info recording
|
||||
(define socket/accept-connect #x0002) ; socket has had listen()
|
||||
(define socket/reuse-address #x0004) ; allow local address reuse
|
||||
(define socket/keep-alive #x0008) ; keep connections alive
|
||||
(define socket/dont-route #x0010) ; just use interface addresses
|
||||
(define socket/broadcast #x0020) ; permit sending of broadcast msgs
|
||||
(define socket/use-loop-back #x0040) ; bypass hardware when possible
|
||||
(define socket/linger #x0080) ; linger on close if data present
|
||||
(define socket/oob-inline #x0100) ; leave received OOB data in line
|
||||
(define socket/reuse-port #x0200) ; allow local address & port reuse
|
||||
;(define socket/use-privileged #x4000) ; allocate from privileged port area
|
||||
;(define socket/cant-signal #x8000) ; prevent SIGPIPE on SS_CANTSENDMORE
|
||||
(define socket/send-buffer #x1001) ; send buffer size
|
||||
(define socket/receive-buffer #x1002) ; receive buffer size
|
||||
(define socket/send-low-water #x1003) ; send low-water mark
|
||||
(define socket/receive-low-water #x1004) ; receive low-water mark
|
||||
(define socket/send-timeout #x1005) ; send timeout
|
||||
(define socket/receive-timeout #x1006) ; receive timeout
|
||||
(define socket/error #x1007) ; get error status and clear
|
||||
(define socket/type #x1008) ; get socket type
|
||||
|
||||
;;; ip options -- <netinet/in.h>
|
||||
(define ip/options 1 ) ; buf/ip/opts; set/get ip options
|
||||
(define ip/header-included 2 ) ; int; header is included with data
|
||||
(define ip/type-of-service 3 ) ; int; ip type of service and preced.
|
||||
(define ip/time-to-live 4 ) ; int; ip time to live
|
||||
(define ip/receive-options 5 ) ; bool; receive all ip opts w/dgram
|
||||
(define ip/response-options 6 ) ; bool; receive ip opts for response
|
||||
(define ip/destination-address 7 ) ; bool; receive ip dst addr w/dgram
|
||||
(define ip/ret-options 8 ) ; ip_opts; set/get ip options
|
||||
(define ip/multicast-if 9 ) ; u_char; set/get ip multicast i/f
|
||||
(define ip/multicast-ttl 10 ) ; u_char; set/get ip multicast ttl
|
||||
(define ip/multicast-loop 11 ) ; u_char; set/get ip multicast loopback
|
||||
(define ip/add-membership 12 ) ; ip_mreq; add an ip group membership
|
||||
(define ip/drop-membership 13 ) ; ip_mreq; drop an ip group membership
|
||||
|
||||
;;; tcp options -- <netinet/tcp.h>
|
||||
(define tcp/no-delay #x01) ; don't delay send to coalesce packets
|
||||
(define tcp/max-segment #x02) ; set maximum segment size
|
||||
|
||||
;;; -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|
||||
;;; OPTION SETS FOR SOCKET-OPTION AND SET-SOCKET-OPTION
|
||||
|
||||
;;; Boolean Options
|
||||
(define options/boolean
|
||||
(list socket/debug
|
||||
socket/accept-connect
|
||||
socket/reuse-address
|
||||
socket/keep-alive
|
||||
socket/dont-route
|
||||
socket/broadcast
|
||||
socket/use-loop-back
|
||||
socket/oob-inline
|
||||
socket/reuse-port ;BSD4.4-Lite
|
||||
; socket/use-privileged
|
||||
; socket/cant-signal
|
||||
tcp/no-delay))
|
||||
|
||||
;;; Integer Options
|
||||
(define options/value
|
||||
(list socket/send-buffer
|
||||
socket/receive-buffer
|
||||
socket/send-low-water
|
||||
socket/receive-low-water
|
||||
socket/error
|
||||
socket/type
|
||||
ip/time-to-live
|
||||
tcp/max-segment))
|
||||
|
||||
;;; #f or Positive Integer
|
||||
(define options/linger
|
||||
(list socket/linger))
|
||||
|
||||
;;; Real Number
|
||||
(define options/timeout
|
||||
(list socket/send-timeout
|
||||
socket/receive-timeout))
|
|
@ -0,0 +1,163 @@
|
|||
;;; Interfaces and packages for the GNU Hurd specific parts of scsh.
|
||||
;;; Copyright (c) 1994 by Olin Shivers. See file COPYING.
|
||||
|
||||
(define-interface gnu-fdflags-extras-interface
|
||||
(export open/shared-lock
|
||||
open/exclusive-lock
|
||||
open/async
|
||||
open/fsync
|
||||
open/execute
|
||||
open/no-link
|
||||
open/no-translator
|
||||
open/no-access-time
|
||||
open/ignore-control-tty
|
||||
fcntl/get-owner
|
||||
fcntl/set-owner))
|
||||
|
||||
(define-interface gnu-errno-extras-interface
|
||||
(export errno/notblk
|
||||
errno/txtbsy
|
||||
errno/nospc
|
||||
errno/wouldblock
|
||||
errno/inprogress
|
||||
errno/already
|
||||
errno/notsock
|
||||
errno/destaddrreq
|
||||
errno/msgsize
|
||||
errno/prototype
|
||||
errno/noprotoopt
|
||||
errno/protonosupport
|
||||
errno/socktnosupport
|
||||
errno/opnotsupp
|
||||
errno/pfnosupport
|
||||
errno/afnosupport
|
||||
errno/addrinuse
|
||||
errno/addrnotavail
|
||||
errno/netdown
|
||||
errno/netunreach
|
||||
errno/netreset
|
||||
errno/connaborted
|
||||
errno/connreset
|
||||
errno/nobufs
|
||||
errno/isconn
|
||||
errno/notconn
|
||||
errno/shutdown
|
||||
errno/toomanyrefs
|
||||
errno/timedout
|
||||
errno/connrefused
|
||||
errno/loop
|
||||
errno/hostdown
|
||||
errno/hostunreach
|
||||
errno/proclim
|
||||
errno/users
|
||||
errno/dquot
|
||||
errno/stale
|
||||
errno/remote
|
||||
errno/badrpc
|
||||
errno/rpcmismatch
|
||||
errno/progunavail
|
||||
errno/progmismatch
|
||||
errno/procunavail
|
||||
errno/ftype
|
||||
errno/auth
|
||||
errno/needauth
|
||||
errno/background
|
||||
errno/died
|
||||
errno/d
|
||||
errno/gregious
|
||||
errno/ieio
|
||||
errno/gratuitous
|
||||
errno/ilseq
|
||||
errno/badmsg
|
||||
errno/idrm
|
||||
errno/multihop
|
||||
errno/nodata
|
||||
errno/nolink
|
||||
errno/nomsg
|
||||
errno/nosr
|
||||
errno/nostr
|
||||
errno/overflow
|
||||
errno/proto
|
||||
errno/time
|
||||
errno/canceled
|
||||
errno/notsup))
|
||||
|
||||
(define-interface gnu-signals-extras-interface
|
||||
(export signal/trap
|
||||
signal/emt
|
||||
signal/bus
|
||||
signal/sys
|
||||
signal/urg
|
||||
signal/cld
|
||||
signal/io
|
||||
signal/xcpu
|
||||
signal/xfsz
|
||||
signal/vtalrm
|
||||
signal/prof
|
||||
signal/winch
|
||||
signal/info
|
||||
signal/lost))
|
||||
|
||||
(define-interface gnu-network-extras-interface
|
||||
(export socket/debug
|
||||
socket/accept-connect
|
||||
socket/reuse-address
|
||||
socket/keep-alive
|
||||
socket/dont-route
|
||||
socket/broadcast
|
||||
socket/use-loop-back
|
||||
socket/linger
|
||||
socket/oob-inline
|
||||
socket/reuse-port ;bsd44lite
|
||||
; socket/use-privileged
|
||||
; socket/cant-signal
|
||||
socket/send-buffer
|
||||
socket/receive-buffer
|
||||
socket/send-low-water
|
||||
socket/receive-low-water
|
||||
socket/send-timeout
|
||||
socket/receive-timeout
|
||||
socket/error
|
||||
socket/type
|
||||
;;; all ip/* but ip/options and ip/time-to-live bsd44lite only
|
||||
ip/options
|
||||
ip/header-included
|
||||
ip/type-of-service
|
||||
ip/time-to-live
|
||||
ip/receive-options
|
||||
ip/response-options
|
||||
ip/destination-address
|
||||
ip/ret-options
|
||||
ip/multicast-if
|
||||
ip/multicast-ttl
|
||||
ip/multicast-loop
|
||||
ip/add-membership
|
||||
ip/drop-membership
|
||||
tcp/no-delay
|
||||
tcp/max-segment
|
||||
message/eor
|
||||
message/trunc
|
||||
message/ctrunc
|
||||
message/wait-all
|
||||
message/dont-wait))
|
||||
|
||||
(define-interface gnu-extras-interface
|
||||
(compound-interface gnu-errno-extras-interface
|
||||
gnu-fdflags-extras-interface
|
||||
gnu-network-extras-interface
|
||||
gnu-signals-extras-interface))
|
||||
|
||||
(define-interface gnu-defs-interface
|
||||
(compound-interface gnu-extras-interface
|
||||
sockets-network-interface
|
||||
posix-errno-interface
|
||||
posix-fdflags-interface
|
||||
posix-signals-interface
|
||||
signals-internals-interface))
|
||||
|
||||
(define-structure gnu-defs gnu-defs-interface
|
||||
(open scheme bitwise defenum-package)
|
||||
(files fdflags errno signals netconst))
|
||||
|
||||
(define-interface os-extras-interface gnu-extras-interface)
|
||||
(define os-dependent gnu-defs)
|
|
@ -0,0 +1,76 @@
|
|||
;;; Signal constant definitions for the GNU Hurd
|
||||
;;; Copyright (c) 1994 by Olin Shivers. See file COPYING.
|
||||
;;; Copyright (c) 1994 by Brian D. Carlstrom.
|
||||
|
||||
(define-enum-constants signal
|
||||
;; POSIX
|
||||
(hup 1) ; hangup
|
||||
(int 2) ; interrupt
|
||||
(quit 3) ; quit
|
||||
(ill 4) ; illegal instruction (not reset when caught)
|
||||
|
||||
;; BSD4.4-Lite
|
||||
(trap 5) ; trace trap (not reset when caught)
|
||||
|
||||
;; POSIX
|
||||
(iot 6) ; IOT instruction
|
||||
(abrt 6) ; used by abort, replace SIGIOT in the future
|
||||
|
||||
;; BSD4.4-Lite
|
||||
(emt 7) ; EMT instruction
|
||||
|
||||
;; POSIX
|
||||
(fpe 8) ; floating point exception
|
||||
(kill 9) ; kill (cannot be caught or ignored)
|
||||
|
||||
;; BSD4.4-Lite
|
||||
(bus 10) ; bus error
|
||||
|
||||
;; POSIX
|
||||
(segv 11) ; segmentation violation
|
||||
|
||||
;; BSD4.4-Lite
|
||||
(sys 12) ; bad argument to system call
|
||||
|
||||
;; POSIX
|
||||
(pipe 13) ; write on a pipe with no one to read it
|
||||
(alrm 14) ; alarm clock
|
||||
(term 15) ; software termination signal from kill
|
||||
|
||||
;; BSD4.4-Lite
|
||||
(urg 16) ; urgent condition on IO channel
|
||||
|
||||
;; POSIX
|
||||
(stop 17) ; sendable stop signal not from tty
|
||||
(tstp 18) ; stop signal from tty
|
||||
(cont 19) ; continue a stopped process
|
||||
(chld 20) ; to parent on child stop or exit
|
||||
|
||||
;; BSD4.4-Lite
|
||||
(cld 20) ; System V name for SIGCHLD
|
||||
|
||||
;; POSIX
|
||||
(ttin 21) ; to readers pgrp upon background tty read
|
||||
(ttou 22) ; like TTIN for output if (tp->t_local<OSTOP)
|
||||
|
||||
;; BSD4.4-Lite
|
||||
(io 23) ; input/output possible signal
|
||||
(poll 23) ; System V name for SIGIO
|
||||
(xcpu 24) ; exceeded CPU time limit
|
||||
(xfsz 25) ; exceeded file size limit
|
||||
(vtalrm 26) ; virtual time alarm
|
||||
(prof 27) ; profiling time alarm
|
||||
(winch 28) ; window changed
|
||||
(info 29) ; information request
|
||||
|
||||
;; User defined
|
||||
(usr1 30) ; user defined signal 1
|
||||
(usr2 31) ; user defined signal 2
|
||||
|
||||
;; GNU
|
||||
(lost 32) ; server died
|
||||
)
|
||||
|
||||
(define signals-ignored-by-default
|
||||
(list signal/chld signal/cont ; These are Posix.
|
||||
signal/info signal/io signal/urg signal/winch)) ; These are BSD.
|
|
@ -0,0 +1 @@
|
|||
/* Make `diff' happy. */
|
|
@ -0,0 +1,8 @@
|
|||
;;; OS-dependent time stuff
|
||||
;;; Copyright (c) 1995 by Olin Shivers. See file COPYING.
|
||||
|
||||
;;; This suffices for BSD systems with the gettimeofday()
|
||||
;;; microsecond-resolution timer.
|
||||
|
||||
(define (ticks/sec) 1000000) ; usec
|
||||
|
|
@ -0,0 +1,216 @@
|
|||
;;; Constant definitions for tty control code (POSIX termios).
|
||||
;;; Copyright (c) 1995 by Brian Carlstrom. See file COPYING.
|
||||
;;; Largely rehacked by Olin.
|
||||
|
||||
;;; These constants are for the GNU Hurd.
|
||||
;;; and are taken from /usr/include/bits/termios.h.
|
||||
|
||||
;;; Non-standard (POSIX, SVR4, 4.3+BSD) things:
|
||||
;;; - Some of the baud rates.
|
||||
|
||||
|
||||
;;; Special Control Characters
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;; Indices into the c_cc[] character array.
|
||||
|
||||
;;; Name Subscript Enabled by
|
||||
;;; ---- --------- ----------
|
||||
;;; POSIX
|
||||
(define ttychar/eof 0) ; ^d icanon
|
||||
(define ttychar/eol 1) ; icanon
|
||||
|
||||
(define ttychar/delete-char 3) ; ^? icanon
|
||||
|
||||
(define ttychar/delete-line 5) ; ^u icanon
|
||||
|
||||
(define ttychar/interrupt 8) ; ^c isig
|
||||
(define ttychar/quit 9) ; ^\ isig
|
||||
(define ttychar/suspend 10) ; ^z isig
|
||||
|
||||
(define ttychar/start 12) ; ^q ixon, ixoff
|
||||
(define ttychar/stop 13) ; ^s ixon, ixoff
|
||||
(define ttychar/min 16) ; !icanon ; Not exported
|
||||
(define ttychar/time 17) ; !icanon ; Not exported
|
||||
|
||||
;;; SVR4 & 4.3+BSD
|
||||
(define ttychar/eol2 2) ; icanon
|
||||
(define ttychar/delete-word 4) ; ^w icanon
|
||||
(define ttychar/reprint 6) ; ^r icanon
|
||||
(define ttychar/delayed-suspend 11) ; ^y isig
|
||||
(define ttychar/literal-next 14) ; ^v iexten
|
||||
(define ttychar/discard 15) ; ^o iexten
|
||||
|
||||
;;; 4.3+BSD
|
||||
(define ttychar/status 18) ; ^t icanon
|
||||
|
||||
;;; Length of control-char string -- *Not Exported*
|
||||
(define num-ttychars 20)
|
||||
|
||||
;;; Magic "disable feature" tty character
|
||||
(define disable-tty-char (ascii->char #xff)) ; _POSIX_VDISABLE
|
||||
|
||||
;;; Flags controllling input processing
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
;;; POSIX
|
||||
(define ttyin/ignore-break #x00001) ; ignbrk
|
||||
(define ttyin/interrupt-on-break #x00002) ; brkint
|
||||
(define ttyin/ignore-bad-parity-chars #x00004) ; ignpar
|
||||
(define ttyin/mark-parity-errors #x00008) ; parmrk
|
||||
(define ttyin/check-parity #x00010) ; inpck
|
||||
(define ttyin/7bits #x00020) ; istrip
|
||||
(define ttyin/nl->cr #x00040) ; inlcr
|
||||
(define ttyin/ignore-cr #x00080) ; igncr
|
||||
(define ttyin/cr->nl #x00100) ; icrnl
|
||||
(define ttyin/output-flow-ctl #x00200) ; ixon
|
||||
(define ttyin/input-flow-ctl #x00400) ; ixoff
|
||||
|
||||
;;; SVR4 & 4.3+BSD
|
||||
(define ttyin/xon-any #x00800) ; ixany: Any char restarts after stop
|
||||
(define ttyin/beep-on-overflow #x02000) ; imaxbel: queue full => ring bell
|
||||
|
||||
;;; SVR4
|
||||
(define ttyin/lowercase #x04000) ; iuclc: Map upper-case to lower case
|
||||
|
||||
|
||||
;;; Flags controlling output processing
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
;;; POSIX
|
||||
(define ttyout/enable #x000001) ; opost: enable output processing
|
||||
|
||||
;;; SVR4 & 4.3+BSD
|
||||
(define ttyout/nl->crnl #x000002) ; onlcr: map nl to cr-nl
|
||||
|
||||
;;; 4.3+BSD
|
||||
(define ttyout/discard-eot #x000008) ; onoeot
|
||||
(define ttyout/expand-tabs #x000004) ; oxtabs (NOT xtabs)
|
||||
|
||||
;;; SVR4
|
||||
(define ttyout/cr->nl #f) ; ocrnl
|
||||
(define ttyout/fill-w/del #f) ; ofdel
|
||||
(define ttyout/delay-w/fill-char #f) ; ofill
|
||||
(define ttyout/uppercase #x000200) ; olcuc
|
||||
(define ttyout/nl-does-cr #f) ; onlret
|
||||
(define ttyout/no-col0-cr #f) ; onocr
|
||||
|
||||
;;; Newline delay
|
||||
(define ttyout/nl-delay #f) ; mask (nldly)
|
||||
(define ttyout/nl-delay0 #f)
|
||||
(define ttyout/nl-delay1 #f) ; tty 37
|
||||
|
||||
;;; Horizontal-tab delay
|
||||
(define ttyout/tab-delay #f) ; mask (tabdly)
|
||||
(define ttyout/tab-delay0 #f)
|
||||
(define ttyout/tab-delay1 #f) ; tty 37
|
||||
(define ttyout/tab-delay2 #f)
|
||||
(define ttyout/tab-delayx #f) ; Expand tabs (xtabs, tab3)
|
||||
|
||||
;;; Carriage-return delay
|
||||
(define ttyout/cr-delay #f) ; mask (crdly)
|
||||
(define ttyout/cr-delay0 #f)
|
||||
(define ttyout/cr-delay1 #f) ; tn 300
|
||||
(define ttyout/cr-delay2 #f) ; tty 37
|
||||
(define ttyout/cr-delay3 #f) ; concept 100
|
||||
|
||||
;;; Vertical tab delay
|
||||
(define ttyout/vtab-delay #f) ; mask (vtdly)
|
||||
(define ttyout/vtab-delay0 #f)
|
||||
(define ttyout/vtab-delay1 #f) ; tty 37
|
||||
|
||||
;;; Backspace delay
|
||||
(define ttyout/bs-delay #f) ; mask (bsdly)
|
||||
(define ttyout/bs-delay0 #f)
|
||||
(define ttyout/bs-delay1 #f)
|
||||
|
||||
;;; Form-feed delay
|
||||
(define ttyout/ff-delay #f) ; mask (ffdly)
|
||||
(define ttyout/ff-delay0 #f)
|
||||
(define ttyout/ff-delay1 #f)
|
||||
|
||||
(define ttyout/all-delay #f)
|
||||
|
||||
;;; Control flags - hacking the serial-line.
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
;;; POSIX
|
||||
(define ttyc/char-size #x00300) ; csize: character size mask
|
||||
(define ttyc/char-size5 #x00000) ; 5 bits (cs5)
|
||||
(define ttyc/char-size6 #x00100) ; 6 bits (cs6)
|
||||
(define ttyc/char-size7 #x00200) ; 7 bits (cs7)
|
||||
(define ttyc/char-size8 #x00300) ; 8 bits (cs8)
|
||||
(define ttyc/2-stop-bits #x00400) ; cstopb: Send 2 stop bits.
|
||||
(define ttyc/enable-read #x00800) ; cread: Enable receiver.
|
||||
(define ttyc/enable-parity #x01000) ; parenb
|
||||
(define ttyc/odd-parity #x02000) ; parodd
|
||||
(define ttyc/hup-on-close #x04000) ; hupcl: Hang up on last close.
|
||||
(define ttyc/no-modem-sync #x08000) ; clocal: Ignore modem lines.
|
||||
|
||||
;;; 4.3+BSD
|
||||
(define ttyc/ignore-flags #x00001) ; cignore: ignore control flags
|
||||
(define ttyc/CTS-output-flow-ctl #x00010000) ; ccts_oflow: CTS flow control of output
|
||||
(define ttyc/RTS-input-flow-ctl #x00020000) ; crts_iflow: RTS flow control of input
|
||||
(define ttyc/carrier-flow-ctl #x00100000) ; mdmbuf
|
||||
|
||||
;;; Local flags -- hacking the tty driver / user interface.
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
;;; POSIX
|
||||
(define ttyl/visual-delete #x00000002) ; echoe: Visually erase chars
|
||||
(define ttyl/echo-delete-line #x00000004) ; echok: Echo nl after line kill
|
||||
(define ttyl/echo #x00000008) ; echo: Enable echoing
|
||||
(define ttyl/echo-nl #x00000010) ; echonl: Echo nl even if echo is off
|
||||
(define ttyl/canonical #x00000100) ; icanon: Canonicalize input
|
||||
(define ttyl/enable-signals #x00000080) ; isig: Enable ^c, ^z signalling
|
||||
(define ttyl/extended #x00000400) ; iexten: Enable extensions
|
||||
(define ttyl/ttou-signal #x00400000) ; tostop: SIGTTOU on background output
|
||||
(define ttyl/no-flush-on-interrupt #x80000000) ; noflsh
|
||||
|
||||
;;; SVR4 & 4.3+BSD
|
||||
(define ttyl/visual-delete-line #x00000001); echoke: visually erase a line-kill
|
||||
(define ttyl/hardcopy-delete #x00000020); echoprt: visual erase for hardcopy
|
||||
(define ttyl/echo-ctl #x00000040); echoctl: echo control chars as "^X"
|
||||
(define ttyl/flush-output #x00800000); flusho: output is being flushed
|
||||
(define ttyl/reprint-unread-chars #x20000000); pendin: retype pending input
|
||||
|
||||
;;; 4.3+BSD
|
||||
(define ttyl/alt-delete-word #x00000200) ; altwerase
|
||||
(define ttyl/no-kernel-status #x02000000) ; nokerninfo: no kernel status on ^T
|
||||
|
||||
;;; SVR4
|
||||
(define ttyl/case-map #f) ; xcase: canonical upper/lower presentation
|
||||
|
||||
;;; Vector of (speed . code) pairs.
|
||||
|
||||
(define baud-rates '#((0 . 0) (50 . 50) (75 . 75)
|
||||
(110 . 110) (134 . 134) (150 . 150)
|
||||
(200 . 200) (300 . 300) (600 . 600)
|
||||
(1200 . 1200) (1800 . 1800) (2400 . 2400)
|
||||
(4800 . 4800) (9600 . 9600) (19200 . 19200)
|
||||
(38400 . 38400) (19200 . exta) (38400 . extb)
|
||||
(57600 . 57600) (115200 . 115200) (230400 . 230400)))
|
||||
|
||||
;;; tcflush() constants
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(define %flush-tty/input 1) ; TCIFLUSH
|
||||
(define %flush-tty/output 2) ; TCOFLUSH
|
||||
(define %flush-tty/both 3) ; TCIOFLUSH
|
||||
|
||||
|
||||
;;; tcflow() constants
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(define %tcflow/start-out 2) ; TCOON
|
||||
(define %tcflow/stop-out 1) ; TCOOFF
|
||||
(define %tcflow/start-in 4) ; TCION
|
||||
(define %tcflow/stop-in 3) ; TCIOFF
|
||||
|
||||
|
||||
;;; tcsetattr() constants
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(define %set-tty-info/now 0) ; TCSANOW Make change immediately.
|
||||
(define %set-tty-info/drain 1) ; TCSADRAIN Drain output, then change.
|
||||
(define %set-tty-info/flush 2) ; TCSAFLUSH Drain output, flush input.
|
||||
(define %set-tty-info/soft #x10) ; flag: don't alter h.w. state
|
|
@ -0,0 +1,39 @@
|
|||
;;; Scsh routines for analysing exit codes returned by WAIT.
|
||||
;;; Copyright (c) 1994 by Olin Shivers. See file COPYING.
|
||||
;;;
|
||||
;;; To port these to a new OS, consult /usr/include/sys/wait.h,
|
||||
;;; and check the WIFEXITED, WEXITSTATUS, WIFSTOPPED, WSTOPSIG,
|
||||
;;; WIFSIGNALED, and WTERMSIG macros for the magic fields they use.
|
||||
;;; These definitions are for Linux.
|
||||
;;;
|
||||
;;; I could have done a portable version by making C calls for this,
|
||||
;;; but it's such overkill.
|
||||
|
||||
|
||||
;;; If process terminated normally, return the exit code, otw #f.
|
||||
|
||||
(define (status:exit-val status)
|
||||
(and (zero? (bitwise-and #x7F status))
|
||||
(bitwise-and #xFF (arithmetic-shift status -8))))
|
||||
|
||||
|
||||
;;; If the process was suspended, return the suspending signal, otw #f.
|
||||
|
||||
(define (status:stop-sig status)
|
||||
(and (= #x7F (bitwise-and status #xFF))
|
||||
(bitwise-and #xFF (arithmetic-shift status -8))))
|
||||
|
||||
|
||||
;;; If the process terminated abnormally,
|
||||
;;; return the terminating signal, otw #f.
|
||||
|
||||
(define (status:term-sig status)
|
||||
(let ((termsig (bitwise-and status #x7F)))
|
||||
(and (not (zero? termsig)) ; Didn't exit.
|
||||
(not (= #x7F (bitwise-and status #xFF))) ; Not suspended.
|
||||
termsig)))
|
||||
|
||||
|
||||
;;; Flags.
|
||||
(define wait/poll 1) ; Don't hang if nothing to wait for.
|
||||
(define wait/stopped-children 2) ; Report on suspended subprocs, too.
|
Loading…
Reference in New Issue