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

Bug#948275: is Debian POSIX compliant?



On Mon, 06 Jan 2020 at 12:12:23 +0100, Harald Dunkel wrote:
> I haven't found it mentioned in the policy manual, so I wonder if
> Debian is supposed to be POSIX compliant (unless noted otherwise)?

I suspect what we aim for is "approximately POSIX". Neither the
Linux kernel nor the various user-space components within the scope
of POSIX (mostly GNU, but probably also some non-GNU packages like
util-linux) aim to be pedantically POSIX-compliant: they will implement
non-POSIX-compliant behaviours if their maintainers think there is a
good reason to do so.

For example, GNU grep has command-line parsing behaviour that is
technically not POSIX-compliant (option arguments given after filenames
are interpreted as options, but POSIX says they are filenames), unless
the environment variable POSIXLY_CORRECT is set:

$ grep nobody /etc/passwd -v
... all of /etc/passwd, except nobody ...
$ POSIXLY_CORRECT=1 grep nobody /etc/passwd -v
/etc/passwd:nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
grep: -v: No such file or directory

Another classic example is that POSIX requires df and du to count in
512-byte blocks, but the GNU tools default to counting 1 KiB blocks.

    smcv


Reply to: