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

SCM Repository

[smlnj] Annotation of /sml/trunk/src/runtime/c-libs/posix-io/pipe.c
ViewVC logotype

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 9 - (view) (download) (as text)

1 : monnier 2 /* pipe.c
2 :     *
3 :     * COPYRIGHT (c) 1995 by AT&T Bell Laboratories.
4 :     */
5 :    
6 :     #include "ml-base.h"
7 :     #include "ml-values.h"
8 :     #include "ml-objects.h"
9 :     #include "ml-c.h"
10 :     #include "cfun-proto-list.h"
11 :     #include <unistd.h>
12 :    
13 :     /* _ml_P_IO_pipe : unit -> int * int
14 :     *
15 :     * Create a pipe and return its input and output descriptors.
16 :     */
17 :     ml_val_t _ml_P_IO_pipe (ml_state_t *msp, ml_val_t arg)
18 :     {
19 :     int fds[2];
20 :    
21 :     if (pipe(fds) == -1)
22 : monnier 8 return RAISE_SYSERR(msp, -1);
23 : monnier 2 else {
24 :     ml_val_t obj;
25 :     REC_ALLOC2 (msp, obj, INT_CtoML(fds[0]), INT_CtoML(fds[1]));
26 :     return obj;
27 :     }
28 :    
29 :     } /* end of _ml_P_IO_pipe */

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