hg: bsd-port/bsd-port/jdk: . Merge all of the special *BSD version of closeDescriptors() with the

Martin Buchholz martinrb at google.com
Tue Nov 11 20:12:21 PST 2008


Looks good to me,
....
but I am tempted to try very hard to avoid constructs of the form
#ifdef OS_FLAVOR

At startup time (in a static init method),
you can determine whether /proc/self/fd is a directory and
contains only entries that look like smallish integers.
Similarly for /dev/fd.
If we can assume dlopen/dlsym,
we could dynamically check for the presence of
_thread_sys_closefrom
And if all else fails, we can simply loop up to some maximum.

One way to only use readdir64 if available is to use readdir64
only if _LFS64_LARGEFILE is defined to 1, else fall back to readdir.

Martin

On Tue, Nov 11, 2008 at 19:08,  <glewis at eyesbeyond.com> wrote:
> Changeset: c20eddeb23e3
> Author:    glewis at misty.eyesbeyond.com
> Date:      2008-11-11 19:07 -0800
> URL:       http://hg.openjdk.java.net/bsd-port/bsd-port/jdk/rev/c20eddeb23e3
>
> . Merge all of the special *BSD version of closeDescriptors() with the
>  Linux and Solaris, save for OpenBSD.  OpenBSD had its own version of
>  closeDescriptors() and based on the comments in the code the issues
>  that lead to it being separate still apply.
>
>  This fixes exec'ing external programmes on FreeBSD and Mac OS X at
>  least and reduces the number of variants of this function from 3 to 2.
>
>  This is different from submitted version in that it keeps the OpenBSD
>  version.  It would be good to remove that, but we need someone to test
>  on OpenBSD before doing so.
>
> Submitted by:   Michael Franz <mvfranz at gmail.com>
>
> ! src/solaris/native/java/lang/UNIXProcess_md.c
>
>
>



More information about the bsd-port-dev mailing list