writing zero bytes in bash

Russell Coker russell at coker.com.au
Sat Feb 26 22:01:35 UTC 2005

On Sunday 27 February 2005 04:54, Tim Waugh <twaugh at redhat.com> wrote:
> On Sat, Feb 26, 2005 at 06:32:13PM +1100, Russell Coker wrote:
> > To unset the fscreate or exec context you have to write zero bytes
> > to /proc/self/attr/fscreate or /proc/self/attr/exec respectively.
> Oh dear, really?  How badly designed.  The man page for write() says
> that writing no bytes causes write() to return 0 "without causing any
> other effect".

Is an entry under /proc a "regular file" or a "special file"?

Sym-links under /proc/*/fd are not regular sym-links, which seems to imply 
that files under /proc are not "regular files".  That seems to indicate that 
the section "the results are not portable" applies.

Alexandre has a good point though, so it seems that changing the interface 
would be a good idea.

http://www.coker.com.au/selinux/   My NSA Security Enhanced Linux packages
http://www.coker.com.au/bonnie++/  Bonnie++ hard drive benchmark
http://www.coker.com.au/postal/    Postal SMTP/POP benchmark
http://www.coker.com.au/~russell/  My home page

More information about the fedora-devel-list mailing list