Libevent error 'Bad File Descriptor'

Brad Fitzpatrick brad@danga.com
Wed, 22 Oct 2003 15:49:25 -0700 (PDT)


In fixing this, I also noticed we're making the server socket at the wrong
time, after dropping root.  We want to be able to bind to low ports while
we still have root, then drop root, then daemonize, then setup libevent,
right?

Avva, can you commit a patch to rearrange all that?



On Thu, 23 Oct 2003, Anatoly Vorobey wrote:

> On Wed, Oct 22, 2003 at 03:36:16PM -0700, Brion Vibber wrote:
> > On Wednesday, Oct 22, 2003, at 15:26 US/Pacific, Anatoly Vorobey wrote:
> > >I don't object - just frustrated because I don't understand why this
> > >is happening and why moving the code solves it. Did you figure it out?
> >
> > Hmm... from the man page for kqueue(2):
> >
> >      The kqueue() system call creates a new kernel event queue and
> > returns a
> >      descriptor.  The queue is not inherited by a child created with
> > fork(2).
>
> Thanks!
>
> I'm not used to descriptors not surviving fork() ;)
> It didn't occur to me that the kqueue descriptor may be special in
> that regard.
>
> --
> avva
>
>