summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/defs.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>2000-10-09 21:18:23 +0000
committerbrian <brian@FreeBSD.org>2000-10-09 21:18:23 +0000
commit38c4d01137dc7f3cd19b75f9b4513c9bab16388e (patch)
tree5fca605418aeeecc4aab375a4c4d001d27a1906d /usr.sbin/ppp/defs.c
parentecc37ebaa1badd59b516817d9bab52a82eaf84b8 (diff)
downloadFreeBSD-src-38c4d01137dc7f3cd19b75f9b4513c9bab16388e.zip
FreeBSD-src-38c4d01137dc7f3cd19b75f9b4513c9bab16388e.tar.gz
Create fd_sets big enough to handle getdtablesize() descriptors.
Diffstat (limited to 'usr.sbin/ppp/defs.c')
-rw-r--r--usr.sbin/ppp/defs.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/usr.sbin/ppp/defs.c b/usr.sbin/ppp/defs.c
index c1b193d..3c72128 100644
--- a/usr.sbin/ppp/defs.c
+++ b/usr.sbin/ppp/defs.c
@@ -376,3 +376,15 @@ SetTitle(const char *title)
else
setproctitle("%s", title);
}
+
+fd_set *
+mkfdset()
+{
+ return (fd_set *)malloc(howmany(getdtablesize(), NFDBITS) * sizeof (fd_mask));
+}
+
+void
+zerofdset(fd_set *s)
+{
+ memset(s, '\0', howmany(getdtablesize(), NFDBITS) * sizeof (fd_mask));
+}
OpenPOWER on IntegriCloud