Replace sys_ftruncate() with kern_ftruncate() in various compats.
Reviewed by: kib@ MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D9368
This commit is contained in:
parent
8787928589
commit
ae6b6ef6cb
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=312986
@ -645,7 +645,6 @@ linux_sigaltstack(struct thread *td, struct linux_sigaltstack_args *uap)
|
|||||||
int
|
int
|
||||||
linux_ftruncate64(struct thread *td, struct linux_ftruncate64_args *args)
|
linux_ftruncate64(struct thread *td, struct linux_ftruncate64_args *args)
|
||||||
{
|
{
|
||||||
struct ftruncate_args sa;
|
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
if (ldebug(ftruncate64))
|
if (ldebug(ftruncate64))
|
||||||
@ -653,9 +652,7 @@ linux_ftruncate64(struct thread *td, struct linux_ftruncate64_args *args)
|
|||||||
(intmax_t)args->length);
|
(intmax_t)args->length);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
sa.fd = args->fd;
|
return (kern_ftruncate(td, args->fd, args->length));
|
||||||
sa.length = args->length;
|
|
||||||
return sys_ftruncate(td, &sa);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -1517,11 +1517,8 @@ freebsd32_truncate(struct thread *td, struct freebsd32_truncate_args *uap)
|
|||||||
int
|
int
|
||||||
freebsd32_ftruncate(struct thread *td, struct freebsd32_ftruncate_args *uap)
|
freebsd32_ftruncate(struct thread *td, struct freebsd32_ftruncate_args *uap)
|
||||||
{
|
{
|
||||||
struct ftruncate_args ap;
|
|
||||||
|
|
||||||
ap.fd = uap->fd;
|
return (kern_ftruncate(td, uap->fd, PAIR32TO64(off_t, uap->length)));
|
||||||
ap.length = PAIR32TO64(off_t,uap->length);
|
|
||||||
return (sys_ftruncate(td, &ap));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef COMPAT_43
|
#ifdef COMPAT_43
|
||||||
@ -1623,11 +1620,8 @@ freebsd6_freebsd32_truncate(struct thread *td, struct freebsd6_freebsd32_truncat
|
|||||||
int
|
int
|
||||||
freebsd6_freebsd32_ftruncate(struct thread *td, struct freebsd6_freebsd32_ftruncate_args *uap)
|
freebsd6_freebsd32_ftruncate(struct thread *td, struct freebsd6_freebsd32_ftruncate_args *uap)
|
||||||
{
|
{
|
||||||
struct ftruncate_args ap;
|
|
||||||
|
|
||||||
ap.fd = uap->fd;
|
return (kern_ftruncate(td, uap->fd, PAIR32TO64(off_t, uap->length)));
|
||||||
ap.length = PAIR32TO64(off_t,uap->length);
|
|
||||||
return (sys_ftruncate(td, &ap));
|
|
||||||
}
|
}
|
||||||
#endif /* COMPAT_FREEBSD6 */
|
#endif /* COMPAT_FREEBSD6 */
|
||||||
|
|
||||||
|
@ -939,15 +939,8 @@ linux_truncate64(struct thread *td, struct linux_truncate64_args *args)
|
|||||||
int
|
int
|
||||||
linux_ftruncate(struct thread *td, struct linux_ftruncate_args *args)
|
linux_ftruncate(struct thread *td, struct linux_ftruncate_args *args)
|
||||||
{
|
{
|
||||||
struct ftruncate_args /* {
|
|
||||||
int fd;
|
|
||||||
int pad;
|
|
||||||
off_t length;
|
|
||||||
} */ nuap;
|
|
||||||
|
|
||||||
nuap.fd = args->fd;
|
return (kern_ftruncate(td, args->fd, args->length));
|
||||||
nuap.length = args->length;
|
|
||||||
return (sys_ftruncate(td, &nuap));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -611,7 +611,6 @@ linux_sigaltstack(struct thread *td, struct linux_sigaltstack_args *uap)
|
|||||||
int
|
int
|
||||||
linux_ftruncate64(struct thread *td, struct linux_ftruncate64_args *args)
|
linux_ftruncate64(struct thread *td, struct linux_ftruncate64_args *args)
|
||||||
{
|
{
|
||||||
struct ftruncate_args sa;
|
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
if (ldebug(ftruncate64))
|
if (ldebug(ftruncate64))
|
||||||
@ -619,9 +618,7 @@ linux_ftruncate64(struct thread *td, struct linux_ftruncate64_args *args)
|
|||||||
(intmax_t)args->length);
|
(intmax_t)args->length);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
sa.fd = args->fd;
|
return (kern_ftruncate(td, args->fd, args->length));
|
||||||
sa.length = args->length;
|
|
||||||
return sys_ftruncate(td, &sa);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -3365,11 +3365,8 @@ freebsd6_truncate(struct thread *td, struct freebsd6_truncate_args *uap)
|
|||||||
int
|
int
|
||||||
freebsd6_ftruncate(struct thread *td, struct freebsd6_ftruncate_args *uap)
|
freebsd6_ftruncate(struct thread *td, struct freebsd6_ftruncate_args *uap)
|
||||||
{
|
{
|
||||||
struct ftruncate_args ouap;
|
|
||||||
|
|
||||||
ouap.fd = uap->fd;
|
return (kern_ftruncate(td, uap->fd, uap->length));
|
||||||
ouap.length = uap->length;
|
|
||||||
return (sys_ftruncate(td, &ouap));
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user