Пример #1
0
Файл: stat.c Проект: cmotc/fskit
// NOTE: fent cannot be locked
int fskit_do_user_stat( struct fskit_core* core, char const* fs_path, struct fskit_entry* fent, struct stat* sb ) {

   int rc = 0;
   int cbrc = 0;
   char name[FSKIT_FILESYSTEM_NAMEMAX+1];
   
   struct fskit_route_dispatch_args dargs;

   memset( name, 0, FSKIT_FILESYSTEM_NAMEMAX+1 );
   fskit_basename( fs_path, name );
   
   fskit_route_stat_args( &dargs, name, sb );

   rc = fskit_route_call_stat( core, fs_path, fent, &dargs, &cbrc );

   if( rc == -EPERM || rc == -ENOSYS ) {
      // no stat defined
      return 0;
   }
   else if( rc != 0 || cbrc != 0 ) {
       
      fskit_error("fskit_route_call_stat rc = %d, cbrc = %d\n", rc, cbrc );
   }

   return cbrc;
}
Пример #2
0
int fskit_do_user_stat( struct fskit_core* core, char const* fs_path, struct fskit_entry* fent, struct stat* sb ) {

   int rc = 0;
   int cbrc = 0;

   struct fskit_route_dispatch_args dargs;

   fskit_route_stat_args( &dargs, sb );

   rc = fskit_route_call_stat( core, fs_path, fent, &dargs, &cbrc );

   if( rc == -EPERM || rc == -ENOSYS ) {
      // no stat defined
      return 0;
   }
   else if( rc != 0 || cbrc != 0 ) {
       
      fskit_error("fskit_route_call_stat rc = %d, cbrc = %d\n", rc, cbrc );
   }

   return cbrc;
}