home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s053 / 8.ddi / usr / include / sys / nami.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-12-08  |  4.4 KB  |  129 lines

  1. /*    Copyright (c) 1990 UNIX System Laboratories, Inc.    */
  2. /*    Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T    */
  3. /*      All Rights Reserved      */
  4.  
  5. /*    THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF         */
  6. /*    UNIX System Laboratories, Inc.                         */
  7. /*    The copyright notice above does not evidence any       */
  8. /*    actual or intended publication of such source code.    */
  9.  
  10. /*    Copyright (c) 1987, 1988 Microsoft Corporation    */
  11. /*      All Rights Reserved    */
  12.  
  13. /*    This Module contains Proprietary Information of Microsoft  */
  14. /*    Corporation and should be treated as Confidential.       */
  15.  
  16. #ident    "@(#)/usr/include/sys/nami.h.sl 1.1 4.0 12/08/90 13794 AT&T-USL"
  17.  
  18. /*
  19.  * Structure used by system calls to pass parameters
  20.  * to the file system independent namei and attribute
  21.  * functions.
  22.  */
  23. struct argnamei {    /* namei's flag argument */
  24.     ushort    cmd;    /* command type (see below) */
  25.     short    rcode;    /* a scratch for return codes (see below) */
  26.     long    ino;    /* ino for link */
  27.     long    mode;    /* mode for creat and chmod */
  28.     ushort    ftype;    /* file type */
  29.     ushort    uid;    /* uid for chown */
  30.     ushort    gid;    /* gid for chown */
  31.     dev_t    idev;    /* dev for link and creat */
  32. };
  33.  
  34. /*
  35.  * Possible values for argnamei.cmd field 
  36.  */
  37. #define    NI_DEL        0x1    /* unlink this file */
  38. #define    NI_CREAT    0x2    /* create */
  39. #define    NI_XCREAT    0x3    /* Exclusive create, error if */
  40.                 /* the file exists */
  41. #define    NI_LINK        0x4    /* make a link */
  42. #define    NI_MKDIR    0x5    /* mkdir */
  43. #define    NI_RMDIR    0x6    /* rmdir */
  44. #define    NI_MKNOD    0x7    /* mknod */
  45.  
  46. /* Requests to fs_setattr */
  47. #define    NI_CHOWN    0x1    /* change owner */
  48. #define    NI_CHMOD    0x2    /* change mode (permissions and 
  49.                 /* ISUID, ISGID, ISVTX) */
  50.  
  51. /* Codes to fs_notify */
  52. #define    NI_OPEN        0x1    /* open - some fstyps may want */
  53.                 /* to know when a file is opened */
  54. #define    NI_CLOSE    0x2    /* close */
  55. #define    NI_CHDIR    0x3    /* let fstyp know that a cd */
  56.                 /* is happening (e.g., some fstyp */
  57.                 /* may need to know so that */
  58.                 /* directory cache can be */
  59.                 /* flushed - if it has one) */
  60.  
  61. /*
  62.  * Return Codes for argnamei.rcode
  63.  */
  64. #define    FSN_FOUND    0x1    /* The file was found by namei (it exists) */
  65. #define    FSN_NOTFOUND    0x2    /* The file was not found by namei  */
  66.                 /* (i.e., it does not exist */
  67.  
  68. /*
  69.  * Return Codes for file sytem dependent namei's
  70.  */
  71. #define    NI_PASS        0    /* Error free FS specific namei */
  72. #define    NI_FAIL        1    /* Error encountered in FS specific namei */
  73. #define    NI_RESTART    2    /* The fs dependent code overwrote */
  74.                 /* the buffer and the namei must */
  75.                 /* begin again. Used mostly for */
  76.                 /* symbolic links. */
  77. #define    NI_DONE        3    /* The fs dependent operation is */
  78.                 /* complete. There is no need to do */
  79.                 /* any further pathnme processing. */
  80.                 /* This is equivalent to NI_PASS for */
  81.                 /* those commands that require some */
  82.                 /* action from the fs dependent code */
  83. #define NI_NULL     4    /* Tell fs independent to return NULL to */
  84.                 /* the calling procedure without doing /*
  85.                 /* an iput */
  86. #define NI_SYMRESTART    5    /* The fs dependent code overwrote the */
  87.                 /* buffer and namei must reparse */
  88.                 /* starting at the current directory */
  89.                 /* in the parse.  Used mostly for */
  90.                 /* symbolic links */
  91.  
  92. /*
  93.  * Data that is passed from the file system independent namei to the
  94.  * file system dependent namei.
  95.  */
  96. struct nx {
  97.     struct    inode *dp;    /* inode of matched file */
  98.                 /* characters */
  99.     caddr_t    comp;        /* pointer to beginning of current */
  100.                 /* pathname component */
  101.     caddr_t    bufp;        /* pointer to the beginning of the */
  102.                 /* pathname buffer */
  103.     long    ino;        /* inode number returned by fs dep code */
  104.     long    flags;        /* Flag field */
  105. };
  106.  
  107. #define    NX_ISROOT    0x1    /* Inode is root of fs */
  108.  
  109. /* Values for fsinfo[].fs_notify. If an fstyp wishes to be */
  110. /* notified of an action the appropriate flag should be set */
  111. /* in fsinfo[].fs_notify and fstypsw[].fs_notify should point */
  112. /* to the desired fs dependent function */
  113. #define    NO_CHDIR    0x1    /* chdir */
  114. #define    NO_CHROOT    0x2    /* chroot */
  115. #define    NO_SEEK        0x4    /* seek */
  116. #define NO_CHSIZE    0x8000    /* XENIX chsize */
  117.  
  118. struct argnotify {
  119.     long     cmd;    /* command - see above */
  120.     long    data1;    /* Allow caller to pass two pieces of data. */
  121.     long     data2;    /* These should be caste appropriately in */
  122.             /* the fs_notify routine. They are declared */
  123.             /* as longs here. However, they should be */
  124.             /* large enough to hold the largest machine */
  125.             /* specific data types (e.g., if a pointer is */
  126.             /* larger than a long then these should be */
  127.             /* int *). */
  128. };
  129.