XINU
rflclose.c
Go to the documentation of this file.
1 /* rflclose.c - rflclose */
2 
3 #include <xinu.h>
4 
5 /*------------------------------------------------------------------------
6  * rflclose - Close a remote file device
7  *------------------------------------------------------------------------
8  */
10  struct dentry *devptr /* Entry in device switch table */
11  )
12 {
13  struct rflcblk *rfptr; /* Pointer to control block */
14 
15  /* Wait for exclusive access */
16 
18 
19  /* Verify remote file device is open */
20 
21  rfptr = &rfltab[devptr->dvminor];
22  if (rfptr->rfstate == RF_FREE) {
24  return SYSERR;
25  }
26 
27  /* Mark device closed */
28 
29  rfptr->rfstate = RF_FREE;
31  return OK;
32 }
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 rflclose(struct dentry *devptr)
Definition: rflclose.c:9
sid32 rf_mutex
Definition: rfilesys.h:38
#define RF_FREE
Definition: rfilesys.h:46
syscall wait(sid32)
Definition: wait.c:9
syscall signal(sid32)
セマフォにシグナルを送り、待機プロセスがある場合は解除する。
Definition: signal.c:18
int32 devcall
デバイスコール関数 返り値の型
Definition: kernel.h:49