bug-coreutils
[Top][All Lists]
Advanced

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

FW: Documentation of POSIXLY_CORRECT


From: Schwarz, Konrad
Subject: FW: Documentation of POSIXLY_CORRECT
Date: Wed, 11 Nov 2009 14:39:47 +0100

 

-----Original Message-----
From: Schwarz, Konrad 
Sent: Wednesday, November 11, 2009 2:31 PM
To: 'Eric Blake'
Subject: RE: Documentation of POSIXLY_CORRECT

Hello Eric,

thanks for taking this up.

Here is a session transcript that exhibits the bug:

$ unset POSIXLY_CORRECT
$ du test_sequence_1_1_ENF
56      test_sequence_1_1_ENF
$ export POSIXLY_CORRECT
$ du test_sequence_1_1_ENF
56      test_sequence_1_1_ENF
$ POSIXLY_CORRECT=1
$ du test_sequence_1_1_ENF
112     test_sequence_1_1_ENF
$ 

Note that the number of blocks changes only after POSIXLY_CORRECT has been set 
to one.  POSIX mandates 512-byte blocks, Coreutils uses 1024-byte blocks by 
default.

Some version information:

$ du --version
du (GNU coreutils) 6.12
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Torbjörn Granlund, David MacKenzie, Paul Eggert,
and Jim Meyering.
$ uname -a
Linux mchn144c 2.6.27.29-0.1-default #1 SMP 2009-08-15 17:53:59 +0200 x86_64 x86
_64 x86_64 GNU/Linux
$

What else would you like to know?

Konrad

> -----Original Message-----
> From: Eric Blake [mailto:address@hidden 
> Sent: Wednesday, November 11, 2009 2:05 PM
> To: Schwarz, Konrad
> Cc: address@hidden
> Subject: Re: Documentation of POSIXLY_CORRECT
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> According to Schwarz, Konrad on 11/11/2009 4:45 AM:
> > The current text says "[...] define the `POSIXLY_CORRECT' 
> environment variable."  I took this to mean that the variable 
> needs to be exported (export POSIXLY_CORRECT),
> 
> Correct.
> 
> > but it needs to be set to a value as well, at least for du(1).
> 
> That would be a bug, if it were true.  But I can't see anything in the
> source for du that inspects the value of POSIXLY_CORRECT.  
> lib/getopt.c
> uses !!getenv ("POSIXLY_CORRECT") to decide whether to do POSIX option
> parsing, and src/du.c has no reference to POSIXLY_CORRECT.  In fact, I
> couldn't find anywhere in coreutils sources that dereferences 
> the value
> returned by getenv("POSIXLY_CORRECT").
> 
> What version of du are you using?
> 
> - --
> Don't work too hard, make some time for fun as well!
> 
> Eric Blake             address@hidden
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (Cygwin)
> Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
> 
> iEYEARECAAYFAkr6toEACgkQ84KuGfSFAYCX4QCgzXZPMX8aQlAs8RksD0Me44pA
> iZsAoM4Wijidy6CLgMGMTrtsrUicm5MF
> =YwDS
> -----END PGP SIGNATURE-----
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]