pike.git / src / modules / _Stdio / stat.c

version» Context lines:

pike.git/src/modules/_Stdio/stat.c:41:    *! @item uid    *! User ID of the file's owner.    *! @item gid    *! Group ID of the file's owner.    *! @item atime    *! Time of last access in seconds since 00:00:00 UTC, 1970-01-01.    *! @item mtime    *! Time of last data modification.    *! @item ctime    *! Time of last file status change. +  *! @item atime_nsec +  *! Time of last access in nanoseconds, added to atime to get +  *! sub-second time +  *! @item mtime_nsec +  *! Time of last modification in nanoseconds, added to mtime to get +  *! sub-second time +  *! @item ctime_nsec +  *! Time of last file status change in nanoseconds, added to ctime to +  *! get sub-second time    *! @item ino    *! Inode number.    *! @item nlink    *! Number of links.    *! @item dev    *! ID of the device containing a directory entry for this file.    *! @item rdev    *! ID of the device.    *! @enddl    *!
pike.git/src/modules/_Stdio/stat.c:201:      static struct mapping *stat_map=NULL;      enum stat_query   {STAT_DEV=1, STAT_INO, STAT_MODE, STAT_NLINK, STAT_UID, STAT_GID, STAT_RDEV,    STAT_SIZE,   #ifdef HAVE_STRUCT_STAT_BLOCKS    STAT_BLKSIZE, STAT_BLOCKS,   #endif    STAT_ATIME, STAT_MTIME, STAT_CTIME, +  STAT_ATIME_NSEC,STAT_MTIME_NSEC, STAT_CTIME_NSEC,   /* is... */    STAT_ISLNK, STAT_ISREG, STAT_ISDIR, STAT_ISCHR,    STAT_ISBLK, STAT_ISFIFO, STAT_ISSOCK,   /* special */    STAT_TYPE, STAT_MODE_STRING,   /* end marker */    STAT_ENUM_END};      static struct pike_string *stat_index_strs[STAT_ENUM_END];   
pike.git/src/modules/_Stdio/stat.c:339:    case STAT_GID: push_int(THIS_STAT->s.st_gid); break;    case STAT_RDEV: push_int(THIS_STAT->s.st_rdev); break;    case STAT_SIZE: push_int64(THIS_STAT->s.st_size); break;   #ifdef HAVE_STRUCT_STAT_BLOCKS    case STAT_BLKSIZE: push_int(THIS_STAT->s.st_blksize); break;    case STAT_BLOCKS: push_int(THIS_STAT->s.st_blocks); break;   #endif    case STAT_ATIME: push_int64(THIS_STAT->s.st_atime); break;    case STAT_MTIME: push_int64(THIS_STAT->s.st_mtime); break;    case STAT_CTIME: push_int64(THIS_STAT->s.st_ctime); break; -  + #ifdef HAVE_STRUCT_STAT_NSEC +  case STAT_ATIME_NSEC: push_int64(THIS_STAT->s.st_atim.tv_nsec); break; +  case STAT_MTIME_NSEC: push_int64(THIS_STAT->s.st_mtim.tv_nsec); break; +  case STAT_CTIME_NSEC: push_int64(THIS_STAT->s.st_ctim.tv_nsec); break; + #else +  case STAT_ATIME_NSEC: case STAT_MTIME_NSEC: case STAT_CTIME_NSEC: +  push_int(0); +  break; + #endif    case STAT_ISREG:    push_int((THIS_STAT->s.st_mode & S_IFMT) == S_IFREG); break;    case STAT_ISLNK:    push_int((THIS_STAT->s.st_mode & S_IFMT) == S_IFLNK); break;    case STAT_ISDIR:    push_int((THIS_STAT->s.st_mode & S_IFMT) == S_IFDIR); break;    case STAT_ISCHR:    push_int((THIS_STAT->s.st_mode & S_IFMT) == S_IFCHR); break;    case STAT_ISBLK:    push_int((THIS_STAT->s.st_mode & S_IFMT) == S_IFBLK); break;
pike.git/src/modules/_Stdio/stat.c:695:    case STAT_RDEV: DO_NOT_WARN(THIS_STAT->s.st_rdev = (int) int_val); break;    case STAT_SIZE: THIS_STAT->s.st_size = DO_NOT_WARN ((off_t) int_val); break;   #ifdef HAVE_STRUCT_STAT_BLOCKS    case STAT_BLKSIZE: DO_NOT_WARN(THIS_STAT->s.st_blksize = int_val); break;    case STAT_BLOCKS: DO_NOT_WARN(THIS_STAT->s.st_blocks = int_val); break;   #endif    case STAT_ATIME: THIS_STAT->s.st_atime = DO_NOT_WARN ((time_t) int_val); break;    case STAT_MTIME: THIS_STAT->s.st_mtime = DO_NOT_WARN ((time_t) int_val); break;    case STAT_CTIME: THIS_STAT->s.st_ctime = DO_NOT_WARN ((time_t) int_val); break;    - #ifdef PIKE_DEBUG -  default: -  Pike_fatal ("stat_index_set is not kept up-to-date with stat_map.\n"); + #ifdef HAVE_STRUCT_STAT_NSEC +  case STAT_ATIME_NSEC: THIS_STAT->s.st_atim.tv_nsec = DO_NOT_WARN ((time_t) int_val); break; +  case STAT_MTIME_NSEC: THIS_STAT->s.st_mtim.tv_nsec = DO_NOT_WARN ((time_t) int_val); break; +  case STAT_CTIME_NSEC: THIS_STAT->s.st_ctim.tv_nsec = DO_NOT_WARN ((time_t) int_val); break;   #endif    }    }   }      static void stat_index_set (INT32 args)   {    int got_int_val = 0;    INT64 int_val;   
pike.git/src/modules/_Stdio/stat.c:952:    {"rdev",STAT_RDEV},    {"size",STAT_SIZE},   #ifdef HAVE_STRUCT_STAT_BLOCKS    {"blksize",STAT_BLKSIZE},    {"blocks",STAT_BLOCKS},   #endif    {"atime",STAT_ATIME},    {"mtime",STAT_MTIME},    {"ctime",STAT_CTIME},    +  {"atime_nsec",STAT_ATIME_NSEC}, +  {"mtime_nsec",STAT_MTIME_NSEC}, +  {"ctime_nsec",STAT_CTIME_NSEC}, +     {"islnk",STAT_ISLNK},    {"isreg",STAT_ISREG},    {"isdir",STAT_ISDIR},    {"ischr",STAT_ISCHR},    {"isblk",STAT_ISBLK},    {"isfifo",STAT_ISFIFO},    {"issock",STAT_ISSOCK},       {"type",STAT_TYPE},    {"mode_string",STAT_MODE_STRING}