Add freebsd6_ wrappers for mmap/lseek/pread/pwrite/truncate/ftruncate

Approved by: re (kensmith)
This commit is contained in:
Peter Wemm 2007-07-04 22:57:21 +00:00
parent e9ac9968aa
commit c2815ad564
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=171212
3 changed files with 78 additions and 3 deletions

View File

@ -142,6 +142,20 @@ pread(td, uap)
return(error);
}
int
freebsd6_pread(td, uap)
struct thread *td;
struct freebsd6_pread_args *uap;
{
struct pread_args oargs;
oargs.fd = uap->fd;
oargs.buf = uap->buf;
oargs.nbyte = uap->nbyte;
oargs.offset = uap->offset;
return (pread(td, &oargs));
}
/*
* Scatter read system call.
*/
@ -337,6 +351,20 @@ pwrite(td, uap)
return(error);
}
int
freebsd6_pwrite(td, uap)
struct thread *td;
struct freebsd6_pwrite_args *uap;
{
struct pwrite_args oargs;
oargs.fd = uap->fd;
oargs.buf = uap->buf;
oargs.nbyte = uap->nbyte;
oargs.offset = uap->offset;
return (pwrite(td, &oargs));
}
/*
* Gather write system call.
*/

View File

@ -1785,16 +1785,28 @@ olseek(td, uap)
off_t offset;
int whence;
} */ nuap;
int error;
nuap.fd = uap->fd;
nuap.offset = uap->offset;
nuap.whence = uap->whence;
error = lseek(td, &nuap);
return (error);
return (lseek(td, &nuap));
}
#endif /* COMPAT_43 */
/* Version with the 'pad' argument */
int
freebsd6_lseek(td, uap)
struct thread *td;
register struct freebsd6_lseek_args *uap;
{
struct lseek_args ouap;
ouap.fd = uap->fd;
ouap.offset = uap->offset;
ouap.whence = uap->whence;
return (lseek(td, &ouap));
}
/*
* Check access permissions using passed credentials.
*/
@ -3150,6 +3162,27 @@ oftruncate(td, uap)
}
#endif /* COMPAT_43 */
/* Versions with the pad argument */
int
freebsd6_truncate(struct thread *td, struct freebsd6_truncate_args *uap)
{
struct truncate_args ouap;
ouap.path = uap->path;
ouap.length = uap->length;
return (truncate(td, &ouap));
}
int
freebsd6_ftruncate(struct thread *td, struct freebsd6_ftruncate_args *uap)
{
struct ftruncate_args ouap;
ouap.fd = uap->fd;
ouap.length = uap->length;
return (ftruncate(td, &ouap));
}
/*
* Sync an open file.
*/

View File

@ -392,6 +392,20 @@ mmap(td, uap)
return (error);
}
int
freebsd6_mmap(struct thread *td, struct freebsd6_mmap_args *uap)
{
struct mmap_args oargs;
oargs.addr = uap->addr;
oargs.len = uap->len;
oargs.prot = uap->prot;
oargs.flags = uap->flags;
oargs.fd = uap->fd;
oargs.pos = uap->pos;
return (mmap(td, &oargs));
}
#ifdef COMPAT_43
#ifndef _SYS_SYSPROTO_H_
struct ommap_args {