summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1998-06-14 11:25:46 +0000
committerpeter <peter@FreeBSD.org>1998-06-14 11:25:46 +0000
commit7321b44b39b5b8d73378f7c295c2508f5d73a09a (patch)
tree1f6502b4108d83c3369ed110c44fe30edb83dc4b
parentf38597edce3bcec6507debd9e0984d84cd2a8874 (diff)
downloadFreeBSD-src-7321b44b39b5b8d73378f7c295c2508f5d73a09a.zip
FreeBSD-src-7321b44b39b5b8d73378f7c295c2508f5d73a09a.tar.gz
Don't compile in the use of poll() when building libc_r. This isn't
so much a "fix", rather a bandaid to buy time to fix it properly within the thread engine.
-rw-r--r--lib/libc/net/res_send.c16
-rw-r--r--lib/libc_r/Makefile4
-rw-r--r--lib/libkse/Makefile4
-rw-r--r--lib/libpthread/Makefile4
4 files changed, 21 insertions, 7 deletions
diff --git a/lib/libc/net/res_send.c b/lib/libc/net/res_send.c
index 45c9661..c06e26a 100644
--- a/lib/libc/net/res_send.c
+++ b/lib/libc/net/res_send.c
@@ -71,7 +71,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.20 1998/04/06 23:27:51 halley Exp $";
-static char rcsid[] = "$Id: res_send.c,v 1.22 1998/05/02 15:51:54 peter Exp $";
+static char rcsid[] = "$Id: res_send.c,v 1.23 1998/06/11 09:03:01 peter Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -99,8 +99,12 @@ static char rcsid[] = "$Id: res_send.c,v 1.22 1998/05/02 15:51:54 peter Exp $";
#include "res_config.h"
+#ifdef NOPOLL /* libc_r doesn't wrap poll yet() */
+static int use_poll = 0;
+#else
static int use_poll = 1; /* adapt to poll() syscall availability */
/* 0 = not present, 1 = try it, 2 = exists */
+#endif
static int s = -1; /* socket used for communications */
static int connected = 0; /* is the socket connected */
@@ -519,8 +523,10 @@ read_len:
/*
* Use datagrams.
*/
+#ifndef NOPOLL
struct pollfd pfd;
int msec;
+#endif
struct timeval timeout;
fd_set dsmask, *dsmaskp;
int dsmasklen;
@@ -626,6 +632,7 @@ read_len:
/*
* Wait for reply
*/
+#ifndef NOPOLL
othersyscall:
if (use_poll) {
msec = (_res.retrans << try) * 1000;
@@ -634,19 +641,23 @@ read_len:
if (msec <= 0)
msec = 1000;
} else {
+#endif
timeout.tv_sec = (_res.retrans << try);
if (try > 0)
timeout.tv_sec /= _res.nscount;
if ((long) timeout.tv_sec <= 0)
timeout.tv_sec = 1;
timeout.tv_usec = 0;
+#ifndef NOPOLL
}
+#endif
wait:
if (s < 0) {
Perror(stderr, "s out-of-bounds", EMFILE);
res_close();
goto next_ns;
}
+#ifndef NOPOLL
if (use_poll) {
struct sigaction sa, osa;
int sigsys_installed = 0;
@@ -680,6 +691,7 @@ read_len:
goto next_ns;
}
} else {
+#endif
dsmasklen = howmany(s + 1, NFDBITS) *
sizeof(fd_mask);
if (dsmasklen > sizeof(fd_set)) {
@@ -704,7 +716,9 @@ read_len:
res_close();
goto next_ns;
}
+#ifndef NOPOLL
}
+#endif
if (n == 0) {
/*
diff --git a/lib/libc_r/Makefile b/lib/libc_r/Makefile
index 0e05949..84497f2 100644
--- a/lib/libc_r/Makefile
+++ b/lib/libc_r/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.11 1998/06/09 23:25:13 jb Exp $
+# $Id: Makefile,v 1.12 1998/06/12 02:21:27 jb Exp $
#
# All library objects contain rcsid strings by default; they may be
# excluded as a space-saving measure. To produce a library that does
@@ -9,7 +9,7 @@ LIB=c_r
SHLIB_MAJOR= 3
SHLIB_MINOR= 0
CFLAGS+=-DLIBC_RCS -DSYSLIBC_RCS -I${.CURDIR}/../libc/include
-CFLAGS+=-DPTHREAD_KERNEL -D_THREAD_SAFE -I${.CURDIR}/uthread
+CFLAGS+=-DPTHREAD_KERNEL -D_THREAD_SAFE -DNOPOLL -I${.CURDIR}/uthread
# Uncomment this if you want libc_r to contain debug information for
# thread locking.
diff --git a/lib/libkse/Makefile b/lib/libkse/Makefile
index 0e05949..84497f2 100644
--- a/lib/libkse/Makefile
+++ b/lib/libkse/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.11 1998/06/09 23:25:13 jb Exp $
+# $Id: Makefile,v 1.12 1998/06/12 02:21:27 jb Exp $
#
# All library objects contain rcsid strings by default; they may be
# excluded as a space-saving measure. To produce a library that does
@@ -9,7 +9,7 @@ LIB=c_r
SHLIB_MAJOR= 3
SHLIB_MINOR= 0
CFLAGS+=-DLIBC_RCS -DSYSLIBC_RCS -I${.CURDIR}/../libc/include
-CFLAGS+=-DPTHREAD_KERNEL -D_THREAD_SAFE -I${.CURDIR}/uthread
+CFLAGS+=-DPTHREAD_KERNEL -D_THREAD_SAFE -DNOPOLL -I${.CURDIR}/uthread
# Uncomment this if you want libc_r to contain debug information for
# thread locking.
diff --git a/lib/libpthread/Makefile b/lib/libpthread/Makefile
index 0e05949..84497f2 100644
--- a/lib/libpthread/Makefile
+++ b/lib/libpthread/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.11 1998/06/09 23:25:13 jb Exp $
+# $Id: Makefile,v 1.12 1998/06/12 02:21:27 jb Exp $
#
# All library objects contain rcsid strings by default; they may be
# excluded as a space-saving measure. To produce a library that does
@@ -9,7 +9,7 @@ LIB=c_r
SHLIB_MAJOR= 3
SHLIB_MINOR= 0
CFLAGS+=-DLIBC_RCS -DSYSLIBC_RCS -I${.CURDIR}/../libc/include
-CFLAGS+=-DPTHREAD_KERNEL -D_THREAD_SAFE -I${.CURDIR}/uthread
+CFLAGS+=-DPTHREAD_KERNEL -D_THREAD_SAFE -DNOPOLL -I${.CURDIR}/uthread
# Uncomment this if you want libc_r to contain debug information for
# thread locking.
OpenPOWER on IntegriCloud