*/
struct GNUNET_MessageHeader header;
+ /**
+ * For alignment.
+ */
+ uint32_t reserved GNUNET_PACKED;
+
/**
* ID of device containing the file, as seen by the client. This
* device ID is obtained using a call like "statvfs" (and converting
* OS does not support this, in which case the service must do a
* full hash recomputation.
*/
- uint32_t device GNUNET_PACKED;
+ uint64_t device GNUNET_PACKED;
/**
* Inode of the file on the given device, as seen by the client
struct IndexStartMessage *ism;
size_t slen;
struct GNUNET_CLIENT_Connection *client;
- uint32_t dev;
+ uint64_t dev;
uint64_t ino;
char *fn;
&dev,
&ino))
{
- ism->device = htonl (dev);
+ ism->device = GNUNET_htonll (dev);
ism->inode = GNUNET_htonll(ino);
}
else
uint16_t msize;
struct IndexInfo *ii;
size_t slen;
- uint32_t dev;
+ uint64_t dev;
uint64_t ino;
- uint32_t mydev;
+ uint64_t mydev;
uint64_t myino;
msize = ntohs(message->size);
GNUNET_SYSERR);
return;
}
- dev = ntohl (ism->device);
+ dev = GNUNET_ntohll (ism->device);
ino = GNUNET_ntohll (ism->inode);
ism = (const struct IndexStartMessage*) message;
slen = strlen (fn) + 1;
* @return GNUNET_OK on success
*/
int GNUNET_DISK_file_get_identifiers (const char *filename,
- uint32_t *dev,
+ uint64_t *dev,
uint64_t *ino);
*/
int
GNUNET_DISK_file_get_identifiers (const char *filename,
- uint32_t * dev, uint64_t * ino)
+ uint64_t * dev, uint64_t * ino)
{
#if LINUX
struct stat sbuf;
if ((0 == stat (filename, &sbuf)) && (0 == statvfs (filename, &fbuf)))
{
- *dev = (uint32_t) fbuf.f_fsid;
+ *dev = (uint64_t) fbuf.f_fsid;
*ino = (uint64_t) sbuf.st_ino;
return GNUNET_OK;
}
+#elif SOMEBSD
+ struct stat sbuf;
+ struct statfs fbuf;
+
+ if ( (0 == stat (filename, &sbuf)) &&
+ (0 == statfs (filename, &fbuf) ) )
+ {
+ *dev = ((uint64_t) fbuf.f_fsid[0]) << 32 || ((uint64_t) fbuf.f_fsid[1]);
+ *ino = (uint64_t) sbuf.st_ino;
+ return GNUNET_OK;
+ }
#elif WINDOWS
// FIXME NILS: test this
struct GNUNET_DISK_FileHandle *fh;