1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 11:40:18 +02:00

* socket.c: add a definition of SUN_LEN (from glibc) for when it's

not already defined.
This commit is contained in:
Gary Houston 2001-03-10 10:30:16 +00:00
parent 7d4351201f
commit 97d0e20b2e
2 changed files with 12 additions and 3 deletions

View file

@ -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>.

View file

@ -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,