[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Possible bug in 'df' v5.2.1 (--portability switch)
From: |
Paul Eggert |
Subject: |
Re: Possible bug in 'df' v5.2.1 (--portability switch) |
Date: |
Mon, 06 Sep 2004 14:06:24 -0700 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) |
Torkel Bjørnson <address@hidden> writes:
> $ setenv BLOCK_SIZE human-readable
> $ df --portability /
> Filesystem Size Used Avail Use% Mounted on
> /dev/sda1 177M 111M 57M 66% /
>
> I think the last output is wrong. Since I request an output
> format in compability/POSIX mode, it should ignore the
> BLOCK_SIZE environment variable and display the blocksize
> in whatever blocksize POSIX define.
It is not a POSIX conformance bug, as the POSIX standard reserves all
environment variables like BLOCK_SIZE (see the 4th paragraph of
<http://www.opengroup.org/onlinepubs/000095399/basedefs/xbd_chap08.html>).
Implementations are allowed to place constraints on the values of such
variables for users who want conforming behavior. That is why it is
OK for df to insist on POSIXLY_CORRECT for full conformance.
So this is not a standards-conformance issue. It may desirable to
change the behavior here, but I'd like to know more about the context
first.
> Shouldn't the semantic be that when POSIXLY_CORRECT is set, this should
> override conflicting switches
No, POSIXLY_CORRECT merely causes "df" to conform to POSIX, typically
with the minimum changes to behavior. For example, if the user
specifies both POSIXLY_CORRECT=1 and BLOCK_SIZE=human-readable, "df"
is allowed to have the latter override the former, because BLOCK_SIZE
is reserved to the implementation.