254
254
/* close the file handle */
256
#elif defined(HAVE_GETFSSTAT) /* FreeBSD, OpenBSD, DragonFly, older NetBSD */
257
struct statfs *mntbuf = NULL;
262
/* determine the number of active mount points */
263
mntsize = getfsstat (NULL, 0, MNT_NOWAIT);
264
if (G_LIKELY (mntsize > 0))
266
/* allocate a new buffer */
267
bufsize = (mntsize + 4) * sizeof (*mntbuf);
268
mntbuf = (struct statfs *) malloc (bufsize);
270
/* determine the mount point for the device file */
271
mntsize = getfsstat (mntbuf, bufsize, MNT_NOWAIT);
272
for (n = 0; n < mntsize; ++n)
274
/* check if we have a match here */
275
exo_mount_point_add_if_matches (mask, device, folder, fstype, mntbuf[n].f_mntfromname, mntbuf[n].f_mntonname,
276
mntbuf[n].f_fstypename, ((mntbuf[n].f_flags & MNT_RDONLY) != 0), &mount_points);
279
/* release the buffer */
282
256
#elif defined(HAVE_GETVFSSTAT) /* Newer NetBSD */
283
257
struct statvfs *mntbuf = NULL;
284
258
glong bufsize = 0;
309
283
/* release the buffer */
286
#elif defined(HAVE_GETFSSTAT) /* FreeBSD, OpenBSD, DragonFly, older NetBSD */
287
struct statfs *mntbuf = NULL;
292
/* determine the number of active mount points */
293
mntsize = getfsstat (NULL, 0, MNT_NOWAIT);
294
if (G_LIKELY (mntsize > 0))
296
/* allocate a new buffer */
297
bufsize = (mntsize + 4) * sizeof (*mntbuf);
298
mntbuf = (struct statfs *) malloc (bufsize);
300
/* determine the mount point for the device file */
301
mntsize = getfsstat (mntbuf, bufsize, MNT_NOWAIT);
302
for (n = 0; n < mntsize; ++n)
304
/* check if we have a match here */
305
exo_mount_point_add_if_matches (mask, device, folder, fstype, mntbuf[n].f_mntfromname, mntbuf[n].f_mntonname,
306
mntbuf[n].f_fstypename, ((mntbuf[n].f_flags & MNT_RDONLY) != 0), &mount_points);
309
/* release the buffer */
313
313
#error "Add support for your operating system here."