On Fri, Nov 07, 2008 at 05:33:09PM -0600, Tom Mueller wrote:
> /proc/self/fd is there on Linux but it's not there on Mac OS. However, they 
> ported the file descriptor access part of /proc to /dev/fd on Mac OS.  On 
> Linux /dev/fd is a link to /proc/self/fd. /dev/fd is actually there on 
> Solaris 10 too, but it appears to have different semantics (looks like all 
> fds rather than just the open ones).
>
> So maybe /dev/fd could be used on those platforms to implement a closeall.
> Thanks.
> Tom

What about trying /proc/self/fd first, and if it doesn't exist, then try
/dev/fd/?  Is /dev/fd/ a directory on MacOS?

Another approach is to use fcntl(2) and the F_GETFD option, but that
requires that we iterate over all fds, something I'd rather avoid.

Thanks,

-j

_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to