Re: writing zero bytes in bash

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.
I personally think this is the problem - no interface should require writing
0 bytes.

To quote the POSIX spec:
| Before  any  action described below is taken, and if nbyte is zero and
| the file is a regular file, the write() function may detect and return
| errors  as  described  below.  In  the  absence of errors, or if error
| detection is not performed, the write() function shall return zero and
| have no other results.  If nbyte is zero and the file is not a regular
| file, the results are unspecified.

Files in /proc _are_ regular files, as far as stat() is concerned, so
I don't think you can require that portable programs give you the
possibility to write 0 bytes to these files.
	Mirek


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]
  Powered by Linux