Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] View of /sml/trunk/src/compiler/PervEnv/Posix/posix-error.sml
ViewVC logotype

View of /sml/trunk/src/compiler/PervEnv/Posix/posix-error.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 94 - (download) (annotate)
Tue May 12 21:56:22 1998 UTC (22 years ago) by monnier
File size: 2476 byte(s)
This commit was generated by cvs2svn to compensate for changes in r93,
which included commits to RCS files with non-trunk default branches.
(* posix-error.sml
 *
 * COPYRIGHT (c) 1995 AT&T Bell Laboratories.
 *
 * Structure for POSIX error codes.
 *
 *)

structure POSIX_Error =
  struct

    type syserror = int (* = PreBasis.syserror *)

    fun cfun x = CInterface.c_function "POSIX-Error" x

    val errors : CInterface.system_const list = cfun "listerrors" ()

    fun osVal s = #1(CInterface.bindSysConst(s, errors))

    fun syserror s = (case CInterface.findSysConst(s, errors)
	   of NONE => NONE
	    | (SOME(e, _)) => SOME e
	  (* end case *))

    val errmsg : int -> string = cfun "errmsg"
    val geterror : int -> CInterface.system_const = cfun "geterror"

    fun toWord i = SysWord.fromInt i
    fun fromWord w = SysWord.toInt w
    fun errorMsg i = errmsg i
    fun errorName err = #2(geterror err)

    val toobig      = osVal "toobig"
    val acces       = osVal "acces"
    val again       = osVal "again"
    val badf        = osVal "badf"
    val badmsg      = osVal "badmsg"
    val busy        = osVal "busy"
    val canceled    = osVal "canceled"
    val child       = osVal "child"
    val deadlk      = osVal "deadlk"
    val dom         = osVal "dom"
    val exist       = osVal "exist"
    val fault       = osVal "fault"
    val fbig        = osVal "fbig"
    val inprogress  = osVal "inprogress"
    val intr        = osVal "intr"
    val inval       = osVal "inval"
    val io          = osVal "io"
    val isdir       = osVal "isdir"
    val loop        = osVal "loop"
    val mfile       = osVal "mfile"
    val mlink       = osVal "mlink"
    val msgsize     = osVal "msgsize"
    val nametoolong = osVal "nametoolong"
    val nfile       = osVal "nfile"
    val nodev       = osVal "nodev"
    val noent       = osVal "noent"
    val noexec      = osVal "noexec"
    val nolck       = osVal "nolck"
    val nomem       = osVal "nomem"
    val nospc       = osVal "nospc"
    val nosys       = osVal "nosys"
    val notdir      = osVal "notdir"
    val notempty    = osVal "notempty"
    val notsup      = osVal "notsup"
    val notty       = osVal "notty"
    val nxio        = osVal "nxio"
    val perm        = osVal "perm"
    val pipe        = osVal "pipe"
    val range       = osVal "range"
    val rofs        = osVal "rofs"
    val spipe       = osVal "spipe"
    val srch        = osVal "srch"
    val xdev        = osVal "xdev"

  end (* structure POSIX_Error *)

(*
 * $Log: posix-error.sml,v $
 * Revision 1.1.1.1  1998/04/08 18:39:56  george
 * Version 110.5
 *
 *)

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0