0.7.12.50

It's easier to port a shell than a shell script. -- Larry Wall

	Contrib-related fixes -
	... multiple uses of test -e are now test -f
	... don't run make test in install, it's more work than we
	    want to do as root
	... instead, touch $i/test-passed in make-target-contrib.sh
            (if, indeed, it has) and test for presence of that file
	    when installing
	... Rationalise AF-* constants in sb-bsd-sockets: AF-LOCAL
            is the One True Name.
	... In sb-bsd-sockets build, don't hardcode gcc to be in /usr/bin
This commit is contained in:
Daniel Barlow 2003-02-21 16:21:02 +00:00
parent f27b79bae2
commit 3b91bf9e9d
10 changed files with 41 additions and 38 deletions

View file

@ -18,7 +18,7 @@ tar -cf $b-binary.tar \
$b/pubring.pgp \
$b/contrib/vanilla-module.mk \
`for dir in $b/contrib/*; do
if test -d $dir && test -e $dir/Makefile; then
if test -d $dir && test -f $dir/test-passed; then
echo $dir
fi
done`

View file

@ -1,4 +1,6 @@
SYSTEM=sb-bsd-sockets
CC=gcc
export CC
all:
$(MAKE) -C ../asdf

View file

@ -11,12 +11,13 @@
;;; then the stuff we're looking for
((:integer af-inet "AF_INET" "IP Protocol family")
(:integer af-unspec "AF_UNSPEC" "Unspecified.")
#-solaris (:integer af-local "AF_LOCAL" "Local to host (pipes and file-domain).")
(:integer af-unix "AF_UNIX" "Old BSD name for af-local. ")
#-(or solaris freebsd) (:integer af-file "AF_FILE" "POSIX name for af-local. ")
#+linux (:integer af-inet6 "AF_INET6" "IP version 6. ")
#+linux (:integer af-route "AF_NETLINK" "Alias to emulate 4.4BSD ")
(:integer af-local
#+(or sunos solaris) "AF_UNIX"
#-(or sunos solaris) "AF_LOCAL"
"Local to host (pipes and file-domain).")
#+linux (:integer af-inet6 "AF_INET6" "IP version 6. ")
#+linux (:integer af-route "AF_NETLINK" "Alias to emulate 4.4BSD ")
(:integer sock-stream "SOCK_STREAM"
"Sequenced, reliable, connection-based byte streams.")
(:integer sock-dgram "SOCK_DGRAM"

View file

@ -30,8 +30,8 @@
(add-package-nickname "SYSTEM" "SB-SYS"))
(defpackage "SB-BSD-SOCKETS"
(:export socket unix-socket inet-socket
make-unix-socket make-inet-socket
(:export socket local-socket inet-socket
make-local-socket make-inet-socket
socket-bind socket-accept socket-connect
socket-send socket-receive socket-recv
socket-name socket-peername socket-listen
@ -92,7 +92,7 @@ arguments to fit Lisp style more closely.
<li> Methods applicable to a particular subclass
<ol>
<li> <a href="#internet">INET-SOCKET</a> - Internet Protocol (TCP, UDP, raw) sockets
<li> Methods on <a href="#UNIX-SOCKET">UNIX-SOCKET</a> - Unix-domain sockets
<li> Methods on <a href="#LOCAL-SOCKET">LOCAL-SOCKET</a> - Local-domain sockets
</ol>
<li> <a href="#name-service">Name resolution</a> (DNS, /etc/hosts, &amp;c)
</ol>
@ -105,11 +105,12 @@ available on a variety of systems, and documented. There are some
differences in approach where we have taken advantage of some of the more useful features of Common Lisp - briefly
<ul>
<li> Where the C API would typically return -1 and set errno, bsd-sockets
signals an error. All the errors are subclasses of SOCKET-CONDITION
<li> Where the C API would typically return -1 and set errno, we
signal an error. All the errors are subclasses of SOCKET-CONDITION
and generally correspond one for one with possible <tt>errno</tt> values
<li> We use multiple return values in many places where the C API would use p[ass-by-reference values
<li> We use multiple return values in many places where the C API would use
pass-by-reference values
<li> We can often avoid supplying an explicit <i>length</i> argument to
functions because we already know how long the argument is.

View file

@ -1,23 +1,23 @@
(in-package :sb-bsd-sockets)
#|| <h2>File-domain sockets</h2>
#|| <h2>Local (unix) domain sockets</h2>
File-domain (AF_FILE) sockets are also known as Unix-domain sockets, but were
Local domain (AF_LOCAL) sockets are also known as Unix-domain sockets, but were
renamed by POSIX presumably on the basis that they may be
available on other systems too.
A file-domain socket address is a string, which is used to create a node
A local socket address is a string, which is used to create a node
in the local filesystem. This means of course that they cannot be used across
a network.
||#
(defclass unix-socket (socket)
((family :initform sockint::af-unix)))
(defclass local-socket (socket)
((family :initform sockint::af-local)))
(defmethod make-sockaddr-for ((socket unix-socket) &optional sockaddr &rest address &aux (filename (first address)))
(defmethod make-sockaddr-for ((socket local-socket) &optional sockaddr &rest address &aux (filename (first address)))
(let ((sockaddr (or sockaddr (sockint::allocate-sockaddr-un))))
(setf (sockint::sockaddr-un-family sockaddr) sockint::af-unix)
(setf (sockint::sockaddr-un-family sockaddr) sockint::af-local)
(when filename
(loop for c across filename
;; XXX magic constant ew ew ew. should grovel this from
@ -28,10 +28,10 @@ a network.
(setf (sockint::sockaddr-un-path sockaddr (1+ i)) 0)))
sockaddr))
(defmethod size-of-sockaddr ((socket unix-socket))
(defmethod size-of-sockaddr ((socket local-socket))
sockint::size-of-sockaddr-un)
(defmethod bits-of-sockaddr ((socket unix-socket) sockaddr)
(defmethod bits-of-sockaddr ((socket local-socket) sockaddr)
"Returns filename of SOCKADDR"
(let ((name (sb-c-call::%naturalize-c-string
(sb-sys:sap+ (sockint::array-data-address sockaddr)

View file

@ -28,8 +28,7 @@
(find-package "SB-BSD-SOCKETS-SYSTEM"))
filename tmp-c-source :sb-bsd-sockets-internal)
(and
(= (run-shell-command
"/usr/bin/gcc -o ~S ~S" (namestring tmp-a-dot-out)
(= (run-shell-command "gcc -o ~S ~S" (namestring tmp-a-dot-out)
(namestring tmp-c-source)) 0)
(= (run-shell-command "~A >~A"
(namestring tmp-a-dot-out)
@ -78,7 +77,7 @@
(component-pathname c))))
(defmethod perform ((op compile-op) (c c-source-file))
(unless
(= 0 (run-shell-command "/usr/bin/gcc -fPIC -o ~S -c ~S"
(= 0 (run-shell-command "gcc -fPIC -o ~S -c ~S"
(unix-name (car (output-files op c)))
(unix-name (component-pathname c))))
(error 'operation-error :operation op :component c)))
@ -111,7 +110,7 @@
(:file "sockopt" :depends-on ("sockets"))
(:file "inet" :depends-on ("sockets" "split" "constants" ))
(:file "unix" :depends-on ("sockets" "split" "constants" ))
(:file "local" :depends-on ("sockets" "split" "constants" ))
(:file "name-service" :depends-on ("sockets" "constants" "alien"))
(:file "misc" :depends-on ("sockets" "constants"))

View file

@ -129,20 +129,20 @@ Tests are in the file <tt>tests.lisp</tt> and also make good examples.
t)
#||
<h2>Unix-domain sockets</h2>
<h2>Local-domain sockets</h2>
A fairly rudimentary test that connects to the syslog socket and sends a
message. Priority 7 is kern.debug; you'll probably want to look at
/etc/syslog.conf or local equivalent to find out where the message ended up
||#
(deftest simple-unix-client
(let ((s (make-instance 'unix-socket :type :datagram)))
(deftest simple-local-client
(let ((s (make-instance 'local-socket :type :datagram)))
(format t "~A~%" s)
(socket-connect s "/dev/log")
(let ((stream (socket-make-stream s :input t :output t :buffering :none)))
(format stream
"<7>bsd-sockets: Don't panic. We're testing unix-domain client code; this message can safely be ignored")
"<7>bsd-sockets: Don't panic. We're testing local-domain client code; this message can safely be ignored")
t))
t)

View file

@ -41,7 +41,7 @@ export SBCL SBCL_BUILDING_CONTRIB
gnumake=${GNUMAKE:-gmake}
for i in contrib/*; do
test -d $i && test -e $i/Makefile || continue;
test -d $i && test -f $i/test-passed || continue;
export INSTALL_DIR=$SBCL_HOME/`basename $i `
$gnumake -C $i test && ensure_dirs $INSTALL_DIR && $gnumake -C $i install
ensure_dirs $INSTALL_DIR && $gnumake -C $i install
done

View file

@ -1,9 +1,8 @@
#!/bin/sh
# This is a script to be run as part of make.sh. The only time you'd
# probably want to run it by itself is if you're trying to
# cross-compile the system or if you're doing some kind of
# troubleshooting.
# probably want to run it by itself is if you're cross-compiling the
# system or doing some kind of troubleshooting.
# This software is part of the SBCL system. See the README file for
# more information.
@ -27,7 +26,8 @@ export SBCL SBCL_BUILDING_CONTRIB
gnumake=${GNUMAKE:-gmake}
for i in contrib/*; do
test -d $i && test -e $i/Makefile || continue;
test -d $i && test -f $i/Makefile || continue;
# export INSTALL_DIR=$SBCL_HOME/`basename $i `
$gnumake -C $i test
test -f $i/test-passed && rm $i/test-passed
$gnumake -C $i test && touch $i/test-passed
done

View file

@ -18,4 +18,4 @@
;;; versions, especially for internal versions off the main CVS
;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
"0.7.12.49"
"0.7.12.50"