XINU
rflseek.c
Go to the documentation of this file.
1 /* rflseek.c - rflseek */
2 
3 #include <xinu.h>
4 
5 /*------------------------------------------------------------------------
6  * rflseek - Change the current position in an open file
7  *------------------------------------------------------------------------
8  */
10  struct dentry *devptr, /* Entry in device switch table */
11  uint32 pos /* New file position */
12  )
13 {
14  struct rflcblk *rfptr; /* Pointer to control block */
15 
16  /* Wait for exclusive access */
17 
19 
20  /* Verify remote file device is open */
21 
22  rfptr = &rfltab[devptr->dvminor];
23  if (rfptr->rfstate == RF_FREE) {
25  return SYSERR;
26  }
27 
28  /* Set the new position */
29 
30  rfptr->rfpos = pos;
32  return OK;
33 }
int32 dvminor
Definition: conf.h:8
全てのシステムヘッダファイルをインクルードする。
#define SYSERR
処理が失敗した場合
Definition: kernel.h:79
#define OK
処理が成功した場合
Definition: kernel.h:77
struct rflcblk rfltab[]
Definition: rflinit.c:5
int32 rfstate
Definition: rfilesys.h:50
Definition: conf.h:6
struct rfdata Rf_data
Definition: rfsinit.c:10
devcall rflseek(struct dentry *devptr, uint32 pos)
Definition: rflseek.c:9
sid32 rf_mutex
Definition: rfilesys.h:38
#define RF_FREE
Definition: rfilesys.h:46
uint32 rfpos
Definition: rfilesys.h:53
syscall wait(sid32)
Definition: wait.c:9
syscall signal(sid32)
セマフォにシグナルを送り、待機プロセスがある場合は解除する。
Definition: signal.c:18
unsigned int uint32
符号なし32ビット整数(unsigned int)
Definition: kernel.h:15
int32 devcall
デバイスコール関数 返り値の型
Definition: kernel.h:49