Trace the high part of the Seek offset.
[wine/multimedia.git] / libs / port / statfs.c
blob0b2bb3350eb98cec22265b8483a4eaea076d06a7
1 /*
2 * statfs function
4 * Copyright 1996 Alexandre Julliard
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.
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.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #include "config.h"
22 #include "wine/port.h"
24 #ifdef __BEOS__
25 #include <be/kernel/fs_info.h>
26 #include <be/kernel/OS.h>
27 #endif
29 #include <errno.h>
30 #ifdef HAVE_SYS_PARAM_H
31 # include <sys/param.h>
32 #endif
33 #ifdef STATFS_DEFINED_BY_SYS_VFS
34 # include <sys/vfs.h>
35 #else
36 # ifdef STATFS_DEFINED_BY_SYS_MOUNT
37 # include <sys/mount.h>
38 # else
39 # ifdef STATFS_DEFINED_BY_SYS_STATFS
40 # include <sys/statfs.h>
41 # endif
42 # endif
43 #endif
45 #ifndef HAVE_STATFS
46 int statfs(const char *name, struct statfs *info)
48 #ifdef __BEOS__
49 dev_t mydev;
50 fs_info fsinfo;
52 if(!info) {
53 errno = ENOSYS;
54 return -1;
57 if ((mydev = dev_for_path(name)) < 0) {
58 errno = ENOSYS;
59 return -1;
62 if (fs_stat_dev(mydev,&fsinfo) < 0) {
63 errno = ENOSYS;
64 return -1;
67 info->f_bsize = fsinfo.block_size;
68 info->f_blocks = fsinfo.total_blocks;
69 info->f_bfree = fsinfo.free_blocks;
70 return 0;
71 #else /* defined(__BEOS__) */
72 errno = ENOSYS;
73 return -1;
74 #endif /* defined(__BEOS__) */
76 #endif /* !defined(HAVE_STATFS) */