diff options
author | Gary Houston <ghouston@arglist.com> | 2001-03-10 10:30:16 +0000 |
---|---|---|
committer | Gary Houston <ghouston@arglist.com> | 2001-03-10 10:30:16 +0000 |
commit | 97d0e20b2e19ac8e8b7310ce2a72a69f02ee6a60 (patch) | |
tree | 8ae8c300c6c1b12b60d759ec562f44f82779f535 /libguile/socket.c | |
parent | 7d4351201ff2388871319ba3b4b5878ea6888648 (diff) | |
download | guile-97d0e20b2e19ac8e8b7310ce2a72a69f02ee6a60.tar.gz |
* socket.c: add a definition of SUN_LEN (from glibc) for when it's
not already defined.
Diffstat (limited to 'libguile/socket.c')
-rw-r--r-- | libguile/socket.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/libguile/socket.c b/libguile/socket.c index 52e0fff57..0f90e6416 100644 --- a/libguile/socket.c +++ b/libguile/socket.c @@ -69,6 +69,11 @@ #include <netdb.h> #include <arpa/inet.h> +#if defined (HAVE_UNIX_DOMAIN_SOCKETS) && !defined (SUN_LEN) +#define SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path) \ + + strlen ((ptr)->sun_path)) +#endif + /* we are not currently using socklen_t. it's not defined on all systems, so would need to be checked by configure. in the meantime, plain int is the best alternative. */ @@ -810,9 +815,8 @@ SCM_DEFINE (scm_recvfrom, "recvfrom!", 2, 3, 0, else SCM_VALIDATE_ULONG_COPY (3, flags, flg); - /* recvfrom will not necessarily return an address. e.g., linux - 2.4.2 doesn't change addr or addr_size if socket is - AF_INET/SOCK_STREAM. */ + /* recvfrom will not necessarily return an address. usually nothing + is returned for stream sockets. */ addr->sa_family = AF_UNSPEC; SCM_SYSCALL (rv = recvfrom (fd, buf + offset, cend - offset, flg, |