This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch: close-on-exec files



Tom Tromey <tromey@redhat.com> writes:
> +  fcntl (sock, F_SETFD, FD_CLOEXEC);

> Adam, please advise.  Will this work on Windows?  Is it even
> necessary?

Well, it definately won't work since Win32 doesn't have an 'fcntl'
function. There is an equivalent, called SetHandleInformation (use the
HANDLE_FLAG_INHERIT flag). However, right now, GCJ's Win32 binaries
can't fork(), so it doesn't (yet) matter much.

Could you throw a FIXME into Win32Process.java noting that when the
class is implemented, we need to add HANDLE_FLAG_INHERIT in
natFileDescriptor.cc, and just make sure that your fcntl()'s are
#ifndef_WIN32'd out? I'll take care of the rest.

  - a

-- 
"If I put copyrighted material into the 'chewy nougat center', I can
 claim the crunchy chocolate coating is an 'Access Control
 Mechanism'."                                     --lynx_user_abroad

Why Windows NT/2k/XP is unreliable: www.zappadoodle.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]