Date: Sat, 27 Feb 2016 09:48:05 -0500 From: Pedro Giffuni <pfg@FreeBSD.org> To: Ronald Klop <ronald-lists@klop.ws>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r296109 - head/libexec/rlogind Message-ID: <56D1B725.4000506@FreeBSD.org> In-Reply-To: <op.ydhtgxz8kndu52@53555a16.cm-6-6b.dynamic.ziggo.nl> References: <201602262002.u1QK2298094838@repo.freebsd.org> <op.ydhtgxz8kndu52@53555a16.cm-6-6b.dynamic.ziggo.nl>
next in thread | previous in thread | raw e-mail | index | archive | help
Hello; On 02/27/16 08:08, Ronald Klop wrote: > Hi, > > I'm not a FreeBSD commiter, but read these commits to stay informed > about what is happening. > This commit (and the one for talk) mentions _what_ is changed, but not > _why_ it is changed. I'm curious why this is better. Mind to share any > comments on this? > Sure. The difference is very small and it could even be argued if the change is worth it at all. Both poll(2) and select(2) do the same and have basically the same performance but poll(2) is a bit more scalable. > Regards, > Ronald. > > > On Fri, 26 Feb 2016 21:02:02 +0100, Pedro F. Giffuni <pfg@freebsd.org> > wrote: > ... >> Modified: head/libexec/rlogind/rlogind.c >> ============================================================================== >> >> --- head/libexec/rlogind/rlogind.c Fri Feb 26 19:49:04 2016 >> (r296108) >> +++ head/libexec/rlogind/rlogind.c Fri Feb 26 20:02:01 2016 >> (r296109) >> @@ -76,6 +76,7 @@ __FBSDID("$FreeBSD$"); >> #include <errno.h> >> #include <libutil.h> >> #include <paths.h> >> +#include <poll.h> >> #include <pwd.h> >> #include <syslog.h> >> #include <stdio.h> >> @@ -350,34 +351,27 @@ protocol(int f, int p) >> nfd = f + 1; >> else >> nfd = p + 1; >> - if (nfd > FD_SETSIZE) { >> - syslog(LOG_ERR, "select mask too small, increase FD_SETSIZE"); >> - fatal(f, "internal error (select mask too small)", 0); >> - } In the case of rlogind, note that the above limitation has disappeared by using poll(2). I will add that FreeBSD has a native poll(2) implementation, it is not a wrapper around select as some old postings would suggest. I don't have any plans to do a massive shakeup against select(2), this was some lower hanging fruit that was easy to change. For new code kqueue(2) should be preferred. Pedro.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?56D1B725.4000506>