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/runtime/c-libs/posix-error/errmsg.c
ViewVC logotype

View of /sml/trunk/src/runtime/c-libs/posix-error/errmsg.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 651 - (download) (as text) (annotate)
Thu Jun 1 18:34:03 2000 UTC (20 years, 1 month ago) by monnier
File size: 741 byte(s)
bring revisions from the vendor branch to the trunk
/* errmsg.c
 *
 * COPYRIGHT (c) 1995 by AT&T Bell Laboratories.
 */

#include "ml-unixdep.h"
#include <stdio.h>
#include <errno.h>
#include "ml-base.h"
#include "ml-values.h"
#include "tags.h"
#include "ml-objects.h"
#include "ml-c.h"
#include "cfun-proto-list.h"

/* _ml_P_Error_errmsg : int -> string
 *
 * Return the OS-dependent error message associated with error.
 */
ml_val_t _ml_P_Error_errmsg (ml_state_t *msp, ml_val_t arg)
{
    int		    errnum = INT_MLtoC(arg);
    ml_val_t	    s;

    if ((0 <= errnum) && (errnum < sys_nerr))
	s = ML_CString (msp, sys_errlist[errnum]);
    else {
	char		buf[32];
	sprintf(buf, "<unknown error %d>", errnum);
	s = ML_CString (msp, buf);
    }

    return s;

} /* end of _ml_P_Error_errmsg */

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