src/findlib/find_one.c
static bool volume_has_attrlist(const char *fname)
{
#ifdef HAVE_DARWIN_OS
   struct statfs st;
   struct volinfo_struct {
      unsigned long length;               /* Mandatory field */
      vol_capabilities_attr_t info;       /* Volume capabilities */
   } vol;
   struct attrlist attrList;

   memset(&attrList, 0, sizeof(attrList));
   attrList.bitmapcount = ATTR_BIT_MAP_COUNT;
   attrList.volattr = ATTR_VOL_INFO | ATTR_VOL_CAPABILITIES;
   if (statfs(fname, &st) == 0) {
      /* We need to check on the mount point */
      if (getattrlist(st.f_mntonname, &attrList, &vol, sizeof(vol), FSOPT_NOFOLLOW) == 0
            && (vol.info.capabilities[VOL_CAPABILITIES_INTERFACES] & VOL_CAP_INT_ATTRLIST)
            && (vol.info.valid[VOL_CAPABILITIES_INTERFACES] & VOL_CAP_INT_ATTRLIST)) {
         return true;
      }
   }
#endif
   return false;
}
/*
 * This function determines whether we can use getattrlist()
 * It's odd, but we have to use the function to determine that...
 * Also, the man pages talk about things as if they were implemented.
 *
 * On Mac OS X, this succesfully differentiates between HFS+ and UFS
 * volumes, which makes me trust it is OK for others, too.
 */
This function determines whether we can use getattrlist()
It's odd, but we have to use the function to determine that
Also, the man pages talk about things as if they were implemented.

On Mac OS X, this succesfully differentiates between HFS+ and UFS
volumes, which makes me trust it is OK for others, too.
This function determines whether we can use getattrlist () It ' s odd but we have to use the function to determine that Also the man pages talk about things as if they were implemented . On Mac OS X this succesfully differentiates between HFS + and UFS volumes which makes me trust it is OK for others too .
static bool volume_has_attrlist(const char *fname)
{
#ifdef HAVE_DARWIN_OS
   struct statfs st;
   struct volinfo_struct {
      unsigned long length;               
      vol_capabilities_attr_t info;       
   } vol;
   struct attrlist attrList;
   memset(&attrList, 0, sizeof(attrList));
   attrList.bitmapcount = ATTR_BIT_MAP_COUNT;
   attrList.volattr = ATTR_VOL_INFO | ATTR_VOL_CAPABILITIES;
   if (statfs(fname, &st) == 0) {
      if (getattrlist(st.f_mntonname, &attrList, &vol, sizeof(vol), FSOPT_NOFOLLOW) == 0
            && (vol.info.capabilities[VOL_CAPABILITIES_INTERFACES] & VOL_CAP_INT_ATTRLIST)
            && (vol.info.valid[VOL_CAPABILITIES_INTERFACES] & VOL_CAP_INT_ATTRLIST)) {
         return true;
      }
   }
#endif
   return false;
}
static bool volume_has_attrlist ( const char * fname ) { #ifdef HAVE_DARWIN_OS struct statfs st ; struct volinfo_struct { unsigned long length ; vol_capabilities_attr_t info ; } vol ; struct attrlist attrList ; memset ( & attrList , 0 , sizeof ( attrList ) ) ; attrList . bitmapcount = ATTR_BIT_MAP_COUNT ; attrList . volattr = ATTR_VOL_INFO | ATTR_VOL_CAPABILITIES ; if ( statfs ( fname , & st ) == 0 ) { if ( getattrlist ( st . f_mntonname , & attrList , & vol , sizeof ( vol ) , FSOPT_NOFOLLOW ) == 0 && ( vol . info . capabilities [ VOL_CAPABILITIES_INTERFACES ] & VOL_CAP_INT_ATTRLIST ) && ( vol . info . valid [ VOL_CAPABILITIES_INTERFACES ] & VOL_CAP_INT_ATTRLIST ) ) { return true ; } } #endif return false ; }
This function determines whether we can use getattrlist()
 It's odd, but we have to use the function to determine that...
 Also, the man pages talk about things as if they were implemented.
This function determines whether we can use getattrlist () It ' s odd but we have to use the function to determine that ... Also the man pages talk about things as if they were implemented .
/* Mandatory field */ /* Volume capabilities */ /* We need to check on the mount point */