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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

1 : monnier 2 /* dup.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_dup : int -> int
14 :     *
15 :     * Duplicate an open file descriptor
16 :     */
17 :     ml_val_t _ml_P_IO_dup (ml_state_t *msp, ml_val_t arg)
18 :     {
19 :     int fd0 = INT_MLtoC(arg);
20 :     int fd1;
21 :    
22 :     fd1 = dup(fd0);
23 :    
24 :     CHK_RETURN(msp, fd1)
25 :    
26 :     } /* end of _ml_P_IO_dup */

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