Remove #+-win32 from the run-program docstring.
[sbcl.git] / contrib / sb-bsd-sockets / defpackage.lisp
blob6e2b6528ab32ae0db3fca8d02ad0c548a4905a2b
1 (defpackage "SB-BSD-SOCKETS-INTERNAL"
2 (:nicknames "SOCKINT")
3 (:shadow #:close #:listen)
4 (:shadowing-import-from "SB-KERNEL" #:with-array-data)
5 (:use "COMMON-LISP" "SB-ALIEN" "SB-EXT"))
7 (defpackage "SB-BSD-SOCKETS"
8 (:export #:socket
9 #-win32 #:local-socket #-win32 #:local-abstract-socket
10 #:inet-socket #:inet6-socket
11 #:make-inet-socket ; deprecated
13 #:socket-bind #:socket-accept #:socket-connect
14 #:socket-send #:socket-receive
15 #:socket-name #:socket-peername #:socket-listen
16 #:socket-close #:socket-shutdown #:socket-file-descriptor
17 #:socket-family #:socket-protocol #:socket-open-p
18 #:socket-type #:socket-make-stream #:get-protocol-by-name
20 #:get-host-by-name #:get-host-by-address
21 #:host-ent
22 #:host-ent-address-type #:host-ent-addresses #:host-ent-address
23 #:host-ent-aliases #:host-ent-name
24 #:name-service-error
25 ;; not sure if these are really good names or not
26 #:netdb-internal-error
27 #:netdb-success-error
28 #:host-not-found-error
29 #:try-again-error
30 #:no-recovery-error
32 #:unknown-protocol
34 ;; all socket options are also exported, by code in
35 ;; sockopt.lisp
37 #:socket-error
39 ;; other errno-based socket errors are exported by code in
40 ;; sockets.lisp
42 #:make-inet-address
43 #:make-inet6-address
45 #:non-blocking-mode)
46 (:use "COMMON-LISP" "SB-BSD-SOCKETS-INTERNAL")
47 (:import-from "SB-INT" "UNSUPPORTED-OPERATOR" "FEATUREP")
48 (:documentation
49 "A thinly-disguised BSD socket API for SBCL. Ideas stolen from the BSD
50 socket API for C and Graham Barr's IO::Socket classes for Perl.
52 We represent sockets as CLOS objects, and rename a lot of methods and
53 arguments to fit Lisp style more closely."))
55 ;;; gethostbyname/gethostbyaddr are generally not thread safe. POSIX
56 ;;; 1003.1-2003 defines an alternative API, which is specified in the
57 ;;; RFC to be thread-safe. If it seems to be available, use it.
58 ;;;
59 ;;; Unfortunately the manual page claims that these functions are not
60 ;;; thread-safe on OS X, but they probably can't be any worse than
61 ;;; gethostbyname and gethostbyaddr.
62 ;;;
63 ;;; CLH: getaddrinfo seems to be broken on x86-64/darwin
64 #-(or win32 (and x86-64 darwin))
65 (let ((addr (sb-alien::find-dynamic-foreign-symbol-address "getaddrinfo")))
66 (when addr
67 (pushnew :sb-bsd-sockets-addrinfo *features*)))