home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0010 - 0019 / ibm0010-0019 / ibm0010.tar / ibm0010 / UNIX3862.ZIP / U386-06.ZIP / U386-6.TD0 / usr / include / sys / nami.h < prev    next >
Encoding:
C/C++ Source or Header  |  1988-06-26  |  4.2 KB  |  127 lines

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