Mail Archives: djgpp-workers/2001/08/19/02:11:35
> From: sandmann AT clio DOT rice DOT edu (Charles Sandmann)
> Date: Sat, 18 Aug 2001 23:25:18 -0500 (CDT)
>
> Included below is my version of the selector code based on Andris code
> and my test code.
Thanks!
> Comments? Since the new code is rather conservative, I didn't see
> a reason to disable it.
I have only one comment:
> + if (workaround_descriptor_leaks)
> + desc_map = (char *)malloc(how_deep);
I'm nervous about calling malloc at that stage. We are past the point
where the transfer buffer can be freely used by system calls (since
some of the data for invoking the child program is already in the
transfer buffer). Although I know malloc currently doesn't use the
transfer buffer, I'm still nervous. In addition, calling malloc might
cause trickery with our selectors which could potentially disrupt the
(purely phenomenological) idea behind this work-around.
I guess the upshot of this is that if it's possible to use a static
buffer, I'd prefer that. I realize that there could be up to 8KB in
that buffer, but v2.04 is going to bloat executables anyway, due to
support for symlinks. If 8KB is deemed too much nonetheless, perhaps
we could have a static buffer for some small size that is sufficient
in most cases, and switch to a malloc'ed buffer if it's not enough?
Also, maybe the comments in the code could be made more explicit about
things that are done by each of the options, to avoid maintenance
problems in the future.
- Raw text -