diff options
author | swallace <swallace@FreeBSD.org> | 1995-10-10 07:59:30 +0000 |
---|---|---|
committer | swallace <swallace@FreeBSD.org> | 1995-10-10 07:59:30 +0000 |
commit | 20f13c7a7ed3183879431f56c3761a1c7914af8a (patch) | |
tree | 81a969abda60acfc5b1785850773a90772c8c462 /sys/i386/ibcs2/ibcs2_stat.c | |
parent | 6c1c648223be1d6caaddff391d1d2946ebc316a2 (diff) | |
download | FreeBSD-src-20f13c7a7ed3183879431f56c3761a1c7914af8a.zip FreeBSD-src-20f13c7a7ed3183879431f56c3761a1c7914af8a.tar.gz |
Remove old files no longer needed.
Add new files created for emulator.
Modify NetBSD import to work with FreeBSD and add new features and
code. The complete emulator is essentially a combination of work/code
implemented by Sean Eric Fagan, Soren Schmidt, Scott Bartram, and myself,
Steven Wallace.
Features of this new emulator system include:
o "clean" code, including strict prototyping.
o Auto-generation of ibcs2 system calls, xenix system calls, isc system
calls. Generation includes system tables, structure definitions,
and prototyping of function calls.
o ibcs2 emulator does not rely on any COMPAT_43 system calls.
o embedded socksys support
o ibcs2 msgsys, semsys, shmsys calls supported if supported in kernel
o alternate /emul/ibcs2 namespace searched first for files in ibcs2
system. Usefull to keep sysv libraries, binaries in /emul/ibcs2.
o many other finer details and functions fixed or implemented.
Diffstat (limited to 'sys/i386/ibcs2/ibcs2_stat.c')
-rw-r--r-- | sys/i386/ibcs2/ibcs2_stat.c | 66 |
1 files changed, 39 insertions, 27 deletions
diff --git a/sys/i386/ibcs2/ibcs2_stat.c b/sys/i386/ibcs2/ibcs2_stat.c index a9d5c4b..529d185 100644 --- a/sys/i386/ibcs2/ibcs2_stat.c +++ b/sys/i386/ibcs2/ibcs2_stat.c @@ -1,5 +1,6 @@ /* * Copyright (c) 1995 Scott Bartram + * Copyright (c) 1995 Steven Wallace * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,35 +38,41 @@ #include <sys/mount.h> #include <sys/malloc.h> #include <sys/vnode.h> -#include <sys/syscallargs.h> +#include <sys/sysctl.h> +#include <sys/sysproto.h> #include <vm/vm.h> -#include <compat/ibcs2/ibcs2_types.h> -#include <compat/ibcs2/ibcs2_fcntl.h> -#include <compat/ibcs2/ibcs2_signal.h> -#include <compat/ibcs2/ibcs2_stat.h> -#include <compat/ibcs2/ibcs2_statfs.h> -#include <compat/ibcs2/ibcs2_syscallargs.h> -#include <compat/ibcs2/ibcs2_ustat.h> -#include <compat/ibcs2/ibcs2_util.h> -#include <compat/ibcs2/ibcs2_utsname.h> +#include <i386/ibcs2/ibcs2_types.h> +#include <i386/ibcs2/ibcs2_fcntl.h> +#include <i386/ibcs2/ibcs2_signal.h> +#include <i386/ibcs2/ibcs2_stat.h> +#include <i386/ibcs2/ibcs2_statfs.h> +#include <i386/ibcs2/ibcs2_proto.h> +#include <i386/ibcs2/ibcs2_ustat.h> +#include <i386/ibcs2/ibcs2_util.h> +#include <i386/ibcs2/ibcs2_utsname.h> +static void bsd_stat2ibcs_stat __P((struct stat *, struct ibcs2_stat *)); +static int cvt_statfs __P((struct statfs *, caddr_t, int)); static void bsd_stat2ibcs_stat(st, st4) - struct ostat *st; + struct stat *st; struct ibcs2_stat *st4; { bzero(st4, sizeof(*st4)); - st4->st_dev = (ibcs2_dev_t)st->st_dev; - st4->st_ino = (ibcs2_ino_t)st->st_ino; + st4->st_dev = (ibcs2_dev_t)st->st_dev; + st4->st_ino = (ibcs2_ino_t)st->st_ino; st4->st_mode = (ibcs2_mode_t)st->st_mode; - st4->st_nlink = (ibcs2_nlink_t)st->st_nlink; - st4->st_uid = (ibcs2_uid_t)st->st_uid; - st4->st_gid = (ibcs2_gid_t)st->st_gid; + st4->st_nlink= (ibcs2_nlink_t)st->st_nlink; + st4->st_uid = (ibcs2_uid_t)st->st_uid; + st4->st_gid = (ibcs2_gid_t)st->st_gid; st4->st_rdev = (ibcs2_dev_t)st->st_rdev; - st4->st_size = (ibcs2_off_t)st->st_size; + if (st->st_size < (quad_t)1 << 32) + st4->st_size = (ibcs2_off_t)st->st_size; + else + st4->st_size = -2; st4->st_atim = (ibcs2_time_t)st->st_atime; st4->st_mtim = (ibcs2_time_t)st->st_mtime; st4->st_ctim = (ibcs2_time_t)st->st_ctime; @@ -144,17 +151,19 @@ ibcs2_stat(p, uap, retval) struct ibcs2_stat_args *uap; int *retval; { - struct ostat st; + struct stat st; struct ibcs2_stat ibcs2_st; - struct compat_43_stat_args cup; + struct stat_args cup; int error; caddr_t sg = stackgap_init(); CHECKALTEXIST(p, &sg, SCARG(uap, path)); SCARG(&cup, path) = SCARG(uap, path); SCARG(&cup, ub) = stackgap_alloc(&sg, sizeof(st)); - if (error = compat_43_stat(p, &cup, retval)) + + if (error = stat(p, &cup, retval)) return error; + if (error = copyin(SCARG(&cup, ub), &st, sizeof(st))) return error; bsd_stat2ibcs_stat(&st, &ibcs2_st); @@ -168,17 +177,19 @@ ibcs2_lstat(p, uap, retval) struct ibcs2_lstat_args *uap; int *retval; { - struct ostat st; + struct stat st; struct ibcs2_stat ibcs2_st; - struct compat_43_lstat_args cup; + struct lstat_args cup; int error; caddr_t sg = stackgap_init(); CHECKALTEXIST(p, &sg, SCARG(uap, path)); SCARG(&cup, path) = SCARG(uap, path); SCARG(&cup, ub) = stackgap_alloc(&sg, sizeof(st)); - if (error = compat_43_lstat(p, &cup, retval)) + + if (error = lstat(p, &cup, retval)) return error; + if (error = copyin(SCARG(&cup, ub), &st, sizeof(st))) return error; bsd_stat2ibcs_stat(&st, &ibcs2_st); @@ -192,16 +203,18 @@ ibcs2_fstat(p, uap, retval) struct ibcs2_fstat_args *uap; int *retval; { - struct ostat st; + struct stat st; struct ibcs2_stat ibcs2_st; - struct compat_43_fstat_args cup; + struct fstat_args cup; int error; caddr_t sg = stackgap_init(); SCARG(&cup, fd) = SCARG(uap, fd); SCARG(&cup, sb) = stackgap_alloc(&sg, sizeof(st)); - if (error = compat_43_fstat(p, &cup, retval)) + + if (error = fstat(p, &cup, retval)) return error; + if (error = copyin(SCARG(&cup, sb), &st, sizeof(st))) return error; bsd_stat2ibcs_stat(&st, &ibcs2_st); @@ -219,7 +232,6 @@ ibcs2_utssys(p, uap, retval) case 0: /* uname(2) */ { struct ibcs2_utsname sut; - extern char ostype[], machine[], osrelease[]; bzero(&sut, ibcs2_utsname_len); bcopy(ostype, sut.sysname, sizeof(sut.sysname) - 1); |