XINU
Functions
close.c File Reference
#include <xinu.h>
Include dependency graph for close.c:

Go to the source code of this file.

Functions

syscall close (did32 descrp)
 

Function Documentation

◆ close()

syscall close ( did32  descrp)

Definition at line 9 of file close.c.

References devtab, disable(), dentry::dvclose, isbaddev, restore(), and SYSERR.

Referenced by kill(), lfscreate(), xsh_cat(), and xsh_rdstest().

12 {
13  intmask mask; /* Saved interrupt mask */
14  struct dentry *devptr; /* Entry in device switch table */
15  int32 retval; /* Value to return to caller */
16 
17  mask = disable();
18  if (isbaddev(descrp)) {
19  restore(mask);
20  return SYSERR;
21  }
22  devptr = (struct dentry *) &devtab[descrp];
23  retval = (*devptr->dvclose) (devptr);
24  restore(mask);
25  return retval;
26 }
void restore(intmask)
#define SYSERR
処理が失敗した場合
Definition: kernel.h:79
devcall(* dvclose)(struct dentry *)
Definition: conf.h:12
Definition: conf.h:6
struct dentry devtab[]
Definition: conf.c:11
uint32 intmask
保存された割り込みマスク
Definition: kernel.h:38
int int32
符号あり32ビット整数(int)
Definition: kernel.h:11
#define isbaddev(f)
デバイスIDを検証するマクロ。
Definition: device.h:15
intmask disable(void)
割り込み禁止(intr.Sに定義がある)
Here is the call graph for this function:
Here is the caller graph for this function: