[comp.std.unix] _POSIX_VDISABLE

mcgrath%tully.Berkeley.EDU@ucbvax.Berkeley.EDU (Roland McGrath) (07/24/90)

From:  mcgrath%tully.Berkeley.EDU@ucbvax.Berkeley.EDU (Roland McGrath)


>From 1003.1 2.10.4 it seems that if _POSIX_VDISABLE is defined as -1 in
<unistd.h>, it is supposed to mean there is no VDISABLE value for any file.
This precludes the value being -1.  Was this the intent?

Similarly, 5.7.1.3 says:

If the variable corresponding to NAME has no limit for the path or file
descriptor, the pathconf() and fpathconf() functions shall return -1 without
changing `errno'.

Though in the case of NAME == _PC_VDISABLE, the value in question is not a
"limit", this seems to imply that if pathconf("file", _PC_VDISABLE) returns -1
without changing `errno', then there is no VDISABLE for value for "file".

The problem is that the wording of the standard and the sysconf, pathconf, and
fpathconf functions were designed for boolean options and for limits which are
required to be positive integers.  In these cases, -1 is a reasonable
out-of-range value.  But _POSIX_VDISABLE is a character value, not restricted
to any specific range, and doesn't fit in right.
--
	Roland McGrath
	Free Software Foundation, Inc.
roland@ai.mit.edu, uunet!ai.mit.edu!roland


Volume-Number: Volume 20, Number 139

karl@IMA.IMA.ISC.COM (Karl Heuer) (07/25/90)

In article <10462@cs.utexas.edu>:
>From: mcgrath%tully.Berkeley.EDU@ucbvax.Berkeley.EDU (Roland McGrath)
>The problem is that the wording of the standard and the sysconf, pathconf, and
>fpathconf functions were designed for boolean options and for limits which are
>required to be positive integers.  In these cases, -1 is a reasonable
>out-of-range value.  But _POSIX_VDISABLE is a character value, not restricted
>to any specific range, and doesn't fit in right.

The documented use of _POSIX_VDISABLE is to store it in an object of type
cc_t.  This is defined in 7.1.2.1 to be an unsigned integral type; hence -1
is indeed out-of-band.  Unless you're trying to make cc_t an unsigned long and
have _POSIX_VDISABLE be ULONG_MAX, you should be okay.

Karl W. Z. Heuer (karl@kelp.ima.isc.com or ima!kelp!karl), The Walking Lint

Volume-Number: Volume 20, Number 143