Hello.
Could you please advise a good way to obtain the errno value.
I use the following way but I don't like it:

> cat errno.c
#include <errno.h>
int get_errno (void) { return errno; }

> cat errno.sml
open Foreign
val errnolib = loadLibrary "errno.so"
val get_errno = buildCall0 ((getSymbol errnolib "get_errno"), (), cInt)
fun main () = print ("errno=" ^ (Int.toString (get_errno())) ^ "\n")

> cc -shared -o errno.so errno.c
> polyc -o errno errno.sml

> env LD_LIBRARY_PATH=. ./errno
errno=0
_______________________________________________
polyml mailing list
polyml@inf.ed.ac.uk
http://lists.inf.ed.ac.uk/mailman/listinfo/polyml

Reply via email to