home *** CD-ROM | disk | FTP | other *** search
/ ANews 3 / AnewsCD3.iso / DP / Programmation / GCC / gcc_include / sys / stat.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-03-08  |  1.4 KB  |  59 lines

  1. /*    file statistics for ansic.library    */
  2. /*    (c)Copyright 1992 Davide Pasetto     */
  3.  
  4. #ifndef    _SYS_STAT_H
  5. #define _SYS_STAT_H
  6.  
  7. #include    <sys/types.h>
  8.  
  9. /* structure returned by stat and fstat calls */
  10.  
  11. struct    stat
  12. {
  13.     dev_t            st_dev;
  14.     ino_t            st_ino;
  15.     unsigned short    st_mode;
  16.     short            st_nlink;
  17.     short            st_uid;
  18.     short            st_gid;
  19.     dev_t            st_rdev;
  20.     off_t            st_size;
  21.     time_t            st_atime;
  22.     time_t            st_mtime;
  23.     time_t            st_ctime;
  24. };
  25.  
  26. /* flags for st_mode */
  27.  
  28. #define    S_IFMT        0170000        /* type of file */
  29. #define    S_IFDIR        0040000     /* directory */
  30. #define S_IFCHR        0020000     /* character special */
  31. #define S_IFBLK        0060000     /* block special */
  32. #define S_IFREG        0100000     /* regular */
  33. #define S_IFMPC        0030000     /* multiplexed character special */
  34. #define S_IFMPB        0070000     /* multiplexed block special */
  35.  
  36. #define S_ISUID     0004000        /* set used id on execution */
  37. #define S_ISGID     0002000        /* set group id on execution */
  38. #define S_ISVTX     0001000        /* save swapped text even after use */
  39. #define S_IREAD     0000400        /* read permission, owner */
  40. #define S_IWRITE    0000200        /* write permission, owner */
  41. #define S_IEXEC     0000100        /* execute/search permission, owner */
  42.  
  43. #define S_IFSOCK    0140000        /* socket */
  44.  
  45. /* function prototypes */
  46.  
  47. #ifdef    __cplusplus
  48. extern "C" {
  49. #endif
  50.  
  51. extern int stat(char *name,struct stat *buf);
  52. extern int fstat(int fd,struct stat *buf);
  53.  
  54. #ifdef    __cplusplus
  55. }
  56. #endif
  57.  
  58. #endif    /* _SYS_STAT_H */
  59.