XINU
lflwrite.c
Go to the documentation of this file.
1 /* lflwrite.c - lflwrite */
2 
3 #include <xinu.h>
4 
5 /*------------------------------------------------------------------------
6  * lflwrite -- Write data to a previously opened local disk file
7  *------------------------------------------------------------------------
8  */
10  struct dentry *devptr, /* Entry in device switch table */
11  char *buff, /* Buffer holding data to write */
12  int32 count /* Number of bytes to write */
13  )
14 {
15  int32 i; /* Number of bytes written */
16 
17  if (count < 0) {
18  return SYSERR;
19  }
20 
21  /* Iteratate and write one byte at a time */
22 
23  for (i=0; i<count; i++) {
24  if (lflputc(devptr, *buff++) == SYSERR) {
25  return SYSERR;
26  }
27  }
28  return count;
29 }
全てのシステムヘッダファイルをインクルードする。
#define SYSERR
処理が失敗した場合
Definition: kernel.h:79
devcall lflputc(struct dentry *, char)
Definition: lflputc.c:9
Definition: conf.h:6
int int32
符号あり32ビット整数(int)
Definition: kernel.h:11
devcall lflwrite(struct dentry *devptr, char *buff, int32 count)
Definition: lflwrite.c:9
int32 devcall
デバイスコール関数 返り値の型
Definition: kernel.h:49