summaryrefslogtreecommitdiffstats
path: root/lib/libc/net
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1997-09-16 06:03:54 +0000
committerpeter <peter@FreeBSD.org>1997-09-16 06:03:54 +0000
commitd9fa5d1fa233a5679640cf7041a6aa60a44c6bf9 (patch)
treec7c278d74bcd1de45210d2858537f69cf06253fc /lib/libc/net
parentd96eb92b4f98b9fd1ddf5feb196c628506966f3c (diff)
downloadFreeBSD-src-d9fa5d1fa233a5679640cf7041a6aa60a44c6bf9.zip
FreeBSD-src-d9fa5d1fa233a5679640cf7041a6aa60a44c6bf9.tar.gz
Some adjustments for the resolver use of poll(). For some reason I thought
an unimplemented syscall returned ENOSYS, rather than EINVAL. I have run statically linked code with this wrapper and it does appear to work fine on 2.2-stable which doesn't have poll(). ktrace shows the poll syscall fail once and the fallback to select() working.
Diffstat (limited to 'lib/libc/net')
-rw-r--r--lib/libc/net/res_send.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/libc/net/res_send.c b/lib/libc/net/res_send.c
index f3eee5b..70a5c17 100644
--- a/lib/libc/net/res_send.c
+++ b/lib/libc/net/res_send.c
@@ -56,7 +56,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)res_send.c 8.1 (Berkeley) 6/4/93";
static char orig_rcsid[] = "From: Id: res_send.c,v 8.13 1997/06/01 20:34:37 vixie Exp";
-static char rcsid[] = "$Id: res_send.c,v 1.18 1997/06/28 04:19:52 peter Exp $";
+static char rcsid[] = "$Id: res_send.c,v 1.19 1997/09/14 09:44:34 peter Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -608,19 +608,20 @@ read_len:
sigaction(SIGSYS, &osa, NULL);
errno = oerrno;
}
+ /* XXX why does nosys() return EINVAL? */
+ if (n < 0 && (errno == ENOSYS ||
+ errno == EINVAL)) {
+ use_poll = 0;
+ goto othersyscall;
+ } else if (use_poll == 1)
+ use_poll = 2;
if (n < 0) {
- if (errno == ENOSYS) {
- use_poll = 0;
- goto othersyscall;
- }
if (errno == EINTR)
goto wait;
Perror(stderr, "poll", errno);
res_close();
goto next_ns;
}
- if (use_poll == 1)
- use_poll = 2;
} else {
dsmasklen = howmany(s + 1, NFDBITS) *
sizeof(fd_mask);
OpenPOWER on IntegriCloud