XMMS2
src
xmms
compat
statfs_netbsd.c
Go to the documentation of this file.
1
/* XMMS2 - X Music Multiplexer System
2
* Copyright (C) 2003-2011 XMMS2 Team
3
*
4
* PLUGINS ARE NOT CONSIDERED TO BE DERIVED WORK !!!
5
*
6
* This library is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU Lesser General Public
8
* License as published by the Free Software Foundation; either
9
* version 2.1 of the License, or (at your option) any later version.
10
*
11
* This library is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* Lesser General Public License for more details.
15
*/
16
17
18
/** @file
19
* NetBSD statfs
20
*/
21
22
/* struct statfs was changed to struct statvfs in NetBSD3*/
23
24
#include <stdio.h>
25
#include <unistd.h>
26
#include <stdlib.h>
27
#include <glib.h>
28
29
30
#include <sys/param.h>
31
#include <sys/mount.h>
32
33
#include "
xmms/xmms_log.h
"
34
#include "
xmmspriv/xmms_statfs.h
"
35
36
/**
37
* This function uses the statvfs() call to
38
* check if the path is on a remote filesystem
39
* or not.
40
*
41
* @returns TRUE if path is on a remote filesystem
42
*/
43
gboolean
44
xmms_statfs_is_remote
(
const
gchar *path)
45
{
46
struct
statvfs st;
47
48
if
(statvfs (path, &st) == -1) {
49
xmms_log_error
(
"Failed to run statfs, will not guess."
);
50
return
FALSE;
51
}
52
53
if
((g_ascii_strcasecmp (st.f_fstypename,
"nfs"
) == 0) ||
54
(g_ascii_strcasecmp (st.f_fstypename,
"smb"
) == 0)) {
55
return
TRUE;
56
}
57
58
return
FALSE;
59
}
xmms_log.h
xmms_statfs_is_remote
gboolean xmms_statfs_is_remote(const gchar *path)
This function uses the statvfs() call to check if the path is on a remote filesystem or not.
Definition:
statfs_netbsd.c:44
xmms_statfs.h
xmms_log_error
#define xmms_log_error(fmt,...)
Definition:
xmms_log.h:35
Generated by
1.8.20