2 Copyright © 1995-2003, The AROS Development Team. All rights reserved.
5 ANSI C function fwrite().
10 #include <dos/dosextens.h>
11 #include <proto/exec.h>
12 #include <proto/dos.h>
13 #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 fdesc
*fdesc
= __getfdesc(stream
->fd
);
60 if (nblocks
> 0 && size
> 0)
61 cnt
= FWrite ((BPTR
)fdesc
->fcb
->fh
, (CONST APTR
)buf
, size
, nblocks
);
67 errno
= IoErr2errno (IoErr ());