[MLton-devel] Posix.FileSys.pathconf

Jesper Louis Andersen jlouis@mongers.org
Sun, 7 Sep 2003 00:23:59 +0200


Quoting Stephen Weeks (sweeks@sweeks.com):
> 
> The spec for Posix.FileSys.pathconf says that boolean values should be
> encoded as SOME 0 or SOME 1.  This implies that 
> 
> 	pathconf (..., "SYNC_IO")
> 
> should never return NONE.  However, on Linux, Poly/ML, SML/NJ, and
> (the latest internal version of) MLton do return NONE for such a call.
> This happens because pathconf returns -1 and leaves errno alone.
> Maybe this should be considered as a bug in Linux?  Or is the correct
> thing to change the spec to encode true as SOME 1 and false as NONE?

Am I totally wrong when I think the original intention was to have a map
between:

true 	=== 	SOME 1
false	===	SOME 0
__!__	===	NONE

where __!__ is the domain-theoretic bottom. It will have the advantage
that it enables the ML-part of the interface to cope with undefined
behaviour in the Posix semantics. I expect there to be at least a couple
without even having looked at it. Choosing int option as the type does
not create a 1-1 correspondance, but choosing bool option does.

As I read the NetBSD documentation they specifically say that upon
returning -1, there will be situations in which the errno is not set[1]

Though it does also specify that setting _PC_SYNC_IO should return 0 or
1 respectively.

[1] http://netbsd.gw.com/cgi-bin/man-cgi?pathconf++NetBSD-current
-- 
j. 



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
MLton-devel mailing list
MLton-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlton-devel