1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-19 10:53:58 +00:00

Implement fstatfs64 system call.

PR:		181012
Submitted by:	John Wehle
MFC after:	1 week
This commit is contained in:
Dmitry Chagin 2016-03-20 13:21:20 +00:00
parent 4525bb829f
commit 99546279d6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=297061
5 changed files with 23 additions and 4 deletions

View File

@ -69,7 +69,6 @@ DUMMY(mincore);
DUMMY(ptrace);
DUMMY(lookup_dcookie);
DUMMY(remap_file_pages);
DUMMY(fstatfs64);
DUMMY(mbind);
DUMMY(get_mempolicy);
DUMMY(set_mempolicy);

View File

@ -450,7 +450,7 @@
267 AUE_NULL STD { int linux_clock_nanosleep(clockid_t which, int flags, \
struct l_timespec *rqtp, struct l_timespec *rmtp); }
268 AUE_STATFS STD { int linux_statfs64(char *path, size_t bufsize, struct l_statfs64_buf *buf); }
269 AUE_FSTATFS STD { int linux_fstatfs64(void); }
269 AUE_FSTATFS STD { int linux_fstatfs64(l_uint fd, size_t bufsize, struct l_statfs64_buf *buf); }
270 AUE_NULL STD { int linux_tgkill(int tgid, int pid, int sig); }
271 AUE_UTIMES STD { int linux_utimes(char *fname, \
struct l_timeval *tptr); }

View File

@ -460,6 +460,27 @@ linux_statfs64(struct thread *td, struct linux_statfs64_args *args)
bsd_to_linux_statfs64(&bsd_statfs, &linux_statfs);
return copyout(&linux_statfs, args->buf, sizeof(linux_statfs));
}
int
linux_fstatfs64(struct thread *td, struct linux_fstatfs64_args *args)
{
struct l_statfs64 linux_statfs;
struct statfs bsd_statfs;
int error;
#ifdef DEBUG
if (ldebug(fstatfs64))
printf(ARGS(fstatfs64, "%d, *"), args->fd);
#endif
if (args->bufsize != sizeof(struct l_statfs64))
return (EINVAL);
error = kern_fstatfs(td, args->fd, &bsd_statfs);
if (error)
return error;
bsd_to_linux_statfs64(&bsd_statfs, &linux_statfs);
return (copyout(&linux_statfs, args->buf, sizeof(linux_statfs)));
}
#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */
int

View File

@ -71,7 +71,6 @@ DUMMY(pivot_root);
DUMMY(mincore);
DUMMY(lookup_dcookie);
DUMMY(remap_file_pages);
DUMMY(fstatfs64);
DUMMY(mbind);
DUMMY(get_mempolicy);
DUMMY(set_mempolicy);

View File

@ -452,7 +452,7 @@
267 AUE_NULL STD { int linux_clock_nanosleep(clockid_t which, int flags, \
struct l_timespec *rqtp, struct l_timespec *rmtp); }
268 AUE_STATFS STD { int linux_statfs64(char *path, size_t bufsize, struct l_statfs64_buf *buf); }
269 AUE_FSTATFS STD { int linux_fstatfs64(void); }
269 AUE_FSTATFS STD { int linux_fstatfs64(l_uint fd, size_t bufsize, struct l_statfs64_buf *buf); }
270 AUE_NULL STD { int linux_tgkill(int tgid, int pid, int sig); }
271 AUE_UTIMES STD { int linux_utimes(char *fname, \
struct l_timeval *tptr); }