FreeBSD Bugzilla – Attachment 10961 Details for
Bug 21790
fstat64 does not exist in Linux emulation mode
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
fstat64.patch
fstat64.patch (text/plain; charset=us-ascii), 5.83 KB, created by
Jim.Pirzyk
on 2000-10-11 18:00:28 UTC
(
hide
)
Description:
fstat64.patch
Filename:
MIME Type:
Creator:
Jim.Pirzyk
Created:
2000-10-11 18:00:28 UTC
Size:
5.83 KB
patch
obsolete
>*** ./sys/i386/linux/linux_dummy.c.orig Wed Jul 19 22:31:56 2000 >--- ./sys/i386/linux/linux_dummy.c Wed Oct 11 09:37:32 2000 >*************** >*** 25,31 **** > * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF > * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > * >! * $FreeBSD: src/sys/i386/linux/linux_dummy.c,v 1.21.2.3 2000/07/20 05:31:56 marcel Exp $ > */ > > #include <sys/param.h> >--- 25,31 ---- > * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF > * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > * >! * $FreeBSD: src/sys/i386/linux/linux_dummy.c,v 1.21 2000/01/29 12:45:35 peter Exp $ > */ > > #include <sys/param.h> >*************** >*** 109,112 **** > DUMMY(ftruncate64); > DUMMY(stat64); > DUMMY(lstat64); >- DUMMY(fstat64); >--- 109,111 ---- >*** ./sys/i386/linux/linux_proto.h.orig Wed Oct 11 09:35:01 2000 >--- ./sys/i386/linux/linux_proto.h Wed Oct 11 09:36:01 2000 >*************** >*** 541,547 **** > register_t dummy; > }; > struct linux_fstat64_args { >! register_t dummy; > }; > int linux_setup __P((struct proc *, struct linux_setup_args *)); > int linux_fork __P((struct proc *, struct linux_fork_args *)); >--- 541,548 ---- > register_t dummy; > }; > struct linux_fstat64_args { >! int fd; char fd_[PAD_(int)]; >! struct linux_fstat64 * buf; char buf_[PAD_(struct linux_fstat64 *)]; > }; > int linux_setup __P((struct proc *, struct linux_setup_args *)); > int linux_fork __P((struct proc *, struct linux_fork_args *)); >*** ./sys/i386/linux/linux_stats.c.orig Thu Jul 6 18:16:52 2000 >--- ./sys/i386/linux/linux_stats.c Wed Oct 11 09:27:33 2000 >*************** >*** 25,31 **** > * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF > * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > * >! * $FreeBSD: src/sys/i386/linux/linux_stats.c,v 1.20.2.1 2000/07/07 01:16:52 obrien Exp $ > */ > > #include <sys/param.h> >--- 25,31 ---- > * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF > * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > * >! * $FreeBSD: src/sys/i386/linux/linux_stats.c,v 1.20 2000/01/08 21:09:41 marcel Exp $ > */ > > #include <sys/param.h> >*************** >*** 44,49 **** >--- 44,51 ---- > #include <i386/linux/linux_proto.h> > #include <i386/linux/linux_util.h> > >+ #include <vm/vm_zone.h> >+ > struct linux_newstat { > u_short stat_dev; > u_short __pad1; >*************** >*** 67,72 **** >--- 69,98 ---- > u_long __unused5; > }; > >+ struct linux_stat64 { >+ u_short stat_dev; >+ u_char __pad0[10]; >+ u_long stat_ino; >+ u_int stat_mode; >+ u_int stat_nlink; >+ u_long stat_uid; >+ u_long stat_gid; >+ u_short stat_rdev; >+ u_char __pad3[10]; >+ int64_t stat_size; >+ u_long stat_blksize; >+ u_long stat_blocks; >+ u_long __pad4; >+ u_long stat_atime; >+ u_long __pad5; >+ u_long stat_mtime; >+ u_long __pad6; >+ u_long stat_ctime; >+ u_long __pad7; >+ u_long __unused1; >+ u_long __unused2; >+ }; >+ > struct linux_ustat > { > int f_tfree; >*************** >*** 97,102 **** >--- 123,151 ---- > return (copyout(&tbuf, ubuf, sizeof(tbuf))); > } > >+ static int >+ stat64_copyout(struct stat *buf, void *ubuf) >+ { >+ struct linux_stat64 tbuf; >+ >+ bzero(&tbuf, sizeof(tbuf)); >+ tbuf.stat_dev = uminor(buf->st_dev) | (umajor(buf->st_dev) << 8); >+ tbuf.stat_ino = buf->st_ino; >+ tbuf.stat_mode = buf->st_mode; >+ tbuf.stat_nlink = buf->st_nlink; >+ tbuf.stat_uid = buf->st_uid; >+ tbuf.stat_gid = buf->st_gid; >+ tbuf.stat_rdev = buf->st_rdev; >+ tbuf.stat_size = buf->st_size; >+ tbuf.stat_atime = buf->st_atime; >+ tbuf.stat_mtime = buf->st_mtime; >+ tbuf.stat_ctime = buf->st_ctime; >+ tbuf.stat_blksize = buf->st_blksize; >+ tbuf.stat_blocks = buf->st_blocks; >+ >+ return (copyout(&tbuf, ubuf, sizeof(tbuf))); >+ } >+ > int > linux_newstat(struct proc *p, struct linux_newstat_args *args) > { >*************** >*** 189,194 **** >--- 238,268 ---- > error = newstat_copyout(&buf, args->buf); > > return (error); >+ } >+ >+ int >+ linux_fstat64(struct proc *p, struct linux_fstat64_args *args) >+ { >+ struct filedesc *fdp; >+ struct file *fp; >+ struct stat buf; >+ int error; >+ >+ fdp = p->p_fd; >+ >+ #ifdef DEBUG >+ printf("Linux-emul(%ld): fstat64(%d, *)\n", (long)p->p_pid, args->fd); >+ #endif >+ >+ if ((unsigned)args->fd >= fdp->fd_nfiles || >+ (fp = fdp->fd_ofiles[args->fd]) == NULL) >+ return (EBADF); >+ >+ error = fo_stat(fp, &buf, p); >+ if (!error) >+ error = stat64_copyout(&buf, args->buf); >+ >+ return (error); > } > > struct linux_statfs_buf { >*** ./sys/i386/linux/syscalls.master.orig Wed Jul 19 14:11:10 2000 >--- ./sys/i386/linux/syscalls.master Wed Oct 11 09:38:49 2000 >*************** >*** 1,4 **** >! $FreeBSD: src/sys/i386/linux/syscalls.master,v 1.30.2.2 2000/07/19 21:11:10 marcel Exp $ > > ; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 > ; System call name/number master file (or rather, slave, from LINUX). >--- 1,4 ---- >! $FreeBSD: src/sys/i386/linux/syscalls.master,v 1.30 2000/01/29 12:43:29 peter Exp $ > > ; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 > ; System call name/number master file (or rather, slave, from LINUX). >*************** >*** 286,289 **** > 194 STD LINUX { int linux_ftruncate64(void); } > 195 STD LINUX { int linux_stat64(void); } > 196 STD LINUX { int linux_lstat64(void); } >! 197 STD LINUX { int linux_fstat64(void); } >--- 286,289 ---- > 194 STD LINUX { int linux_ftruncate64(void); } > 195 STD LINUX { int linux_stat64(void); } > 196 STD LINUX { int linux_lstat64(void); } >! 197 STD LINUX { int linux_fstat64(int fd, struct stat64 *buf); }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 21790
: 10961