2 Copyright © 1995-2012, The AROS Development Team. All rights reserved.
10 #include <dos/dosextens.h>
11 #include <proto/exec.h>
12 #include <proto/dos.h>
14 #include <aros/debug.h>
18 /*****************************************************************************
26 const void * restrict buf
,
29 FILE * restrict stream
)
32 Write an amount of bytes to a stream.
35 buf - The buffer to write to the stream
36 size - Size of one block to write
37 nblocks - The number of blocks to write
38 stream - Write to this stream
41 The number of blocks written. If no error occurred, this is
42 nblocks. Otherwise examine errno for the reason of the error.
47 ******************************************************************************/
51 D(bug("[fwrite]: buf=%p, size=%d, nblocks=%d, stream=%p\n",
52 buf
, size
, nblocks
, stream
55 fdesc
*fdesc
= __getfdesc(stream
->fd
);
64 if (nblocks
> 0 && size
> 0)
65 cnt
= FWrite (fdesc
->fcb
->handle
, (CONST APTR
)buf
, size
, nblocks
);
71 errno
= __stdc_ioerr2errno (IoErr ());