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-io/pipe.c
ViewVC logotype

View of /sml/trunk/src/runtime/c-libs/posix-io/pipe.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3 - (download) (as text) (annotate)
Sat Oct 4 23:33:46 1997 UTC (22 years, 10 months ago)
Original Path: sml/branches/SMLNJ/src/runtime/c-libs/posix-io/pipe.c
File size: 630 byte(s)
This commit was manufactured by cvs2svn to create branch 'SMLNJ'.
/* pipe.c
 *
 * COPYRIGHT (c) 1995 by AT&T Bell Laboratories.
 */

#include "ml-base.h"
#include "ml-values.h"
#include "ml-objects.h"
#include "ml-c.h"
#include "cfun-proto-list.h"
#include <unistd.h>

/* _ml_P_IO_pipe : unit -> int * int
 *
 * Create a pipe and return its input and output descriptors.
 */
ml_val_t _ml_P_IO_pipe (ml_state_t *msp, ml_val_t arg)
{
    int         fds[2];

    if (pipe(fds) == -1)
        return RaiseSysError (msp, NIL(char *));
    else {
        ml_val_t        obj;
        REC_ALLOC2 (msp, obj, INT_CtoML(fds[0]), INT_CtoML(fds[1]));
        return obj;
    }

} /* end of _ml_P_IO_pipe */

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