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

Go to the source code of this file.

Functions

devcall namopen (struct dentry *devptr, char *name, char *mode)
 

Function Documentation

◆ namopen()

devcall namopen ( struct dentry devptr,
char *  name,
char *  mode 
)

Definition at line 9 of file namopen.c.

References dentry::dvnum, nammap(), newdev(), NM_MAXLEN, open(), and SYSERR.

14 {
15  char newname[NM_MAXLEN]; /* Name with prefix replaced */
16  did32 newdev; /* Device ID after mapping */
17 
18  /* Use namespace to map name to a new name and new descriptor */
19 
20  newdev = nammap(name, newname, devptr->dvnum);
21 
22  if (newdev == SYSERR) {
23  return SYSERR;
24  }
25 
26  /* Open underlying device and return status */
27 
28  return open(newdev, newname, mode);
29 }
#define SYSERR
処理が失敗した場合
Definition: kernel.h:79
devcall nammap(char *, char[], did32)
void newdev(char *)
Definition: y.tab.c:2163
#define NM_MAXLEN
ファイル名の最大サイズ
Definition: name.h:11
int32 dvnum
Definition: conf.h:7
int32 did32
デバイスID
Definition: kernel.h:28
syscall open(did32, char *, char *)
Definition: open.c:9
Here is the call graph for this function: