[EMAIL PROTECTED] wrote:
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?
yes. It has an entry for every open file descriptor, just like /proc/self/fd.
The approach you suggest sounds good.
Tom

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


begin:vcard
fn:Tom Mueller
n:Mueller;Tom
org:Sun Microsystems, Inc.;SWI Install/Update Software
adr:;;21915 Hillandale Dr;Elkhorn;NE;68022;USA
email;internet:[EMAIL PROTECTED]
title:Senior Staff Engineer
tel;work:877-250-4011
tel;fax:877-250-4011
tel;home:402-916-9943
x-mozilla-html:TRUE
version:2.1
end:vcard

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

Reply via email to