Commit a5ee0505 authored by rrt's avatar rrt
Browse files

[project @ 2001-07-13 11:11:34 by rrt]

Explain why errno is imported via a function
parent c51aae8f
% -----------------------------------------------------------------------------
% $Id: PrelCError.lhs,v 1.9 2001/05/18 21:45:43 qrczak Exp $
% $Id: PrelCError.lhs,v 1.10 2001/07/13 11:11:34 rrt Exp $
%
% (c) The FFI task force, 2000
%
......@@ -117,7 +117,8 @@ import IO (IOError, Handle, ioError)
-- ------------
-- import of C function that gives address of errno
--
-- This function exists because errno is a variable on some systems, but on
-- Windows it is a macro for a function...
foreign import "ghcErrno" unsafe _errno :: Ptr CInt
-- Haskell representation for "errno" values
......
/*
* (c) The University of Glasgow, 2000-2001
*
* $Id: errno.c,v 1.5 2001/05/18 16:54:06 simonmar Exp $
* $Id: errno.c,v 1.6 2001/07/13 11:11:34 rrt Exp $
*
* GHC Error Number Conversion
*/
......@@ -9,6 +9,7 @@
#include "HsStd.h"
/* Raw errno */
/* Covers up the fact that on Windows this is a function */
int *ghcErrno(void) {
return &errno;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment