82 |
#include <fnmatch.h> |
#include <fnmatch.h> |
83 |
#include <errno.h> /* errno */ |
#include <errno.h> /* errno */ |
84 |
|
|
85 |
#ifdef SOLARIS |
#if defined(SOLARIS) |
86 |
#include <sys/statvfs.h> /* solaris statvfs */ |
#include <sys/statvfs.h> /* solaris statvfs */ |
87 |
#define HAVE_STATVFS |
#define HAVE_STATVFS |
88 |
|
#define F_NAMELEN(buf) ((buf).f_namemax) |
89 |
|
|
90 |
|
#elif defined(__OpenBSD__) |
91 |
|
#include <sys/param.h> |
92 |
|
#include <sys/mount.h> |
93 |
|
#define HAVE_STATFS |
94 |
|
#define F_NAMELEN(buf) (NAME_MAX) |
95 |
|
|
96 |
#else |
#else |
97 |
#include <sys/vfs.h> /* linux statfs */ |
#include <sys/vfs.h> /* linux statfs */ |
98 |
#define HAVE_STATFS |
#define HAVE_STATFS |
99 |
|
#define F_NAMELEN(buf) ((buf).f_namelen) |
100 |
#endif |
#endif |
101 |
|
|
102 |
#include "rdesktop.h" |
#include "rdesktop.h" |
515 |
|
|
516 |
#if defined(HAVE_STATFS) |
#if defined(HAVE_STATFS) |
517 |
ret = statfs(path, &statbuf); |
ret = statfs(path, &statbuf); |
|
buf->f_namelen = statbuf.f_namelen; |
|
518 |
#elif defined(HAVE_STATVFS) |
#elif defined(HAVE_STATVFS) |
519 |
ret = statvfs(path, &statbuf); |
ret = statvfs(path, &statbuf); |
|
buf->f_namelen = statbuf.f_namemax; |
|
520 |
#else |
#else |
521 |
ret=-1; |
ret=-1; |
522 |
#endif |
#endif |
524 |
buf->f_blocks = statbuf.f_blocks; |
buf->f_blocks = statbuf.f_blocks; |
525 |
buf->f_bfree = statbuf.f_bfree; |
buf->f_bfree = statbuf.f_bfree; |
526 |
buf->f_bsize = statbuf.f_bsize; |
buf->f_bsize = statbuf.f_bsize; |
527 |
|
buf->f_namelen = F_NAMELEN(statbuf); |
528 |
|
|
529 |
return ret; |
return ret; |
530 |
} |
} |