diff options
-rw-r--r-- | libguile/ChangeLog | 5 | ||||
-rw-r--r-- | libguile/socket.c | 10 |
2 files changed, 12 insertions, 3 deletions
diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 4552f73ee..18e0ac098 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,8 @@ +2001-03-10 Gary Houston <ghouston@arglist.com> + + * socket.c: add a definition of SUN_LEN (from glibc) for when it's + not already defined. + 2001-03-09 Mikael Djurfeldt <mdj@linnaeus.mit.edu> * coop.c: Inserted #include <stdio.h>. 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, |