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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 224 - (download) (as text) (annotate)
Sat Apr 17 16:27:01 1999 UTC (21 years, 2 months ago) by monnier
File size: 786 byte(s)
This commit was generated by cvs2svn to compensate for changes in r223,
which included commits to RCS files with non-trunk default branches.
/* readbuf.c
 *
 * COPYRIGHT (c) 1995 by AT&T Bell Laboratories.
 */

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

/* _ml_P_IO_readbuf : (int * Word8Array.array * int * int) -> int
 *                     fd    data               nbytes start
 *
 * Read nbytes of data from the specified file into the given array, 
 * starting at start. Return the number of bytes read. Assume bounds
 * have been checked.
 */
ml_val_t _ml_P_IO_readbuf (ml_state_t *msp, ml_val_t arg)
{
    int		fd = REC_SELINT(arg, 0);
    ml_val_t	buf = REC_SEL(arg, 1);
    int		nbytes = REC_SELINT(arg, 2);
    char	*start = STR_MLtoC(buf) + REC_SELINT(arg, 3);
    int		n;

    n = read (fd, start, nbytes);

    CHK_RETURN (msp, n)

} /* end of _ml_P_IO_readbuf */


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