[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freebsd-hackers
Subject:    Re: Is it possible to have file removed upon process exit?
From:       Xin LI <delphij () delphij ! net>
Date:       2010-11-29 8:20:35
Message-ID: 4CF36253.2090902 () delphij ! net
[Download RAW message or body]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On 11/28/10 20:43, Garrett Cooper wrote:
> On Thu, Nov 25, 2010 at 12:14 PM, Xin LI <delphij@delphij.net> wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA256
>>
>> Hi,
>>
>> One pretty common way of having an i-node of a file removed when process
>> exit is to unlink() it while holding a descriptor of the file.  This
>> approach, however, have a side effect that other processes would not be
>> able to access the file via its name.
>>
>> For certain applications it is sometimes desirable to (e.g. for unix
>> domain sockets) have file removed when the process quit, regardless
>> whether the process is quit cleanly.  Is there a clean way to do this?
> 
>     Does it have to be nameless and/or unique?

Not nameless.

Speaking for uniqueness, I think it's unrelated (not good nor bad) for
the use case.  The name should be predictable (e.g. can be configured,
so non-child process can find it), though.

Cheers,
- -- 
Xin LI <delphij@delphij.net>	http://www.delphij.net/
FreeBSD - The Power to Serve!	       Live free or die
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (FreeBSD)

iQEcBAEBCAAGBQJM82JTAAoJEATO+BI/yjfBefYH/21GeUneFBCiTRUYqgjA6AIc
QB9D5zqFFNEOWK4fEfa78MnmS7mDGUojfuU36eRsppHYErZ8wLC0evapc/Q45c07
BisQZB4pETNGk+Qv61f9Dd18+bZk+XfqJ5RALAvKiuv1gu0DN/XqTW5PHK25c1YQ
nx187Uf6gB8sRHrCt/k5OZQ6hq/ACdWQOA2SvWYbgpPt3WbBRp2D3/qELATUyCRw
b10Egkh+c4ovewbmX7tvXYJpOKANp59iFA/q5k/YVEY9MKYTog2ARmkzqPDi4g2B
U7ertGMjXgWASfWKwp+mFjjf7stcsPlqpql/MHWMF4fm9Z1TpI91nQ9/wX4UCEs=
=uXVP
-----END PGP SIGNATURE-----
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic