Index: lib/libc/Makefile.inc =================================================================== RCS file: /home/ncvs/src/lib/libc/Makefile.inc,v retrieving revision 1.8 diff -u -2 -r1.8 Makefile.inc --- lib/libc/Makefile.inc 2002/05/15 20:07:31 1.8 +++ lib/libc/Makefile.inc 2002/10/05 19:40:36 @@ -20,4 +20,5 @@ .include "${.CURDIR}/../libc/db/Makefile.inc" .include "${.CURDIR}/../libc/compat-43/Makefile.inc" +.include "${.CURDIR}/../libc/freebsd4/Makefile.inc" .include "${.CURDIR}/../libc/gen/Makefile.inc" .if ${MACHINE_ARCH} != "powerpc" Index: lib/libc/freebsd4/Makefile.inc =================================================================== RCS file: Makefile.inc diff -N Makefile.inc --- /dev/null Sat Oct 5 12:35:25 2002 +++ Makefile.inc Sat Oct 5 12:40:36 2002 @@ -0,0 +1,9 @@ +# $FreeBSD: src/lib/libc/ia64/Makefile.inc,v 1.2 2001/03/05 10:00:57 obrien Exp $ +# +# FreeBSD 4.x/5.x compatability helpers to help avoid libc bumps +# This is a bit of a kludge, and can go away after a while. +# + +.PATH: ${.CURDIR}/freebsd4 + +SRCS+= stat.c lstat.c fstat.c cvtstat44.c Index: lib/libc/freebsd4/cvtstat44.c =================================================================== RCS file: cvtstat44.c diff -N cvtstat44.c --- /dev/null Sat Oct 5 12:35:25 2002 +++ cvtstat44.c Sat Oct 5 12:40:36 2002 @@ -0,0 +1,37 @@ +#define __LIBC_COMPAT__ +#include +#include +#include +#include +#include "cvtstat44.h" + +/* + * Convert from an old to a new stat structure. + */ +void +cvtstat44(st, ost) + struct stat *st; + struct stat44 *ost; +{ + + memset(ost, 0, sizeof *ost); + ost->st_dev = st->st_dev; + ost->st_ino = st->st_ino; + ost->st_mode = st->st_mode; + if (st->st_nlink > USHRT_MAX) + ost->st_nlink = USHRT_MAX; + else + ost->st_nlink = st->st_nlink; + ost->st_uid = st->st_uid; + ost->st_gid = st->st_gid; + ost->st_rdev = st->st_rdev; + ost->st_atimespec = st->st_atimespec; + ost->st_mtimespec = st->st_mtimespec; + ost->st_ctimespec = st->st_ctimespec; + ost->st_size = st->st_size; + ost->st_blocks = st->st_blocks; + ost->st_blksize = st->st_blksize; + ost->st_flags = st->st_flags; + ost->st_gen = st->st_gen; + ost->st_birthtimespec = st->st_birthtimespec; +} Index: lib/libc/freebsd4/cvtstat44.h =================================================================== RCS file: cvtstat44.h diff -N cvtstat44.h --- /dev/null Sat Oct 5 12:35:25 2002 +++ cvtstat44.h Sat Oct 5 12:40:36 2002 @@ -0,0 +1 @@ +void cvtstat44(struct stat *st, struct stat44 *ost); Index: lib/libc/freebsd4/fstat.c =================================================================== RCS file: fstat.c diff -N fstat.c --- /dev/null Sat Oct 5 12:35:25 2002 +++ fstat.c Sat Oct 5 12:40:36 2002 @@ -0,0 +1,17 @@ +#define __LIBC_COMPAT__ +#include +#include +#include "cvtstat44.h" + +int +fstat(int fd, struct stat44 *osb) +{ + int error; + struct stat sb; + + error = __xfstat(__STATVER, fd, &sb); + if (error) + return (error); + cvtstat44(&sb, osb); + return (0); +} Index: lib/libc/freebsd4/lstat.c =================================================================== RCS file: lstat.c diff -N lstat.c --- /dev/null Sat Oct 5 12:35:25 2002 +++ lstat.c Sat Oct 5 12:40:36 2002 @@ -0,0 +1,17 @@ +#define __LIBC_COMPAT__ +#include +#include +#include "cvtstat44.h" + +int +lstat(const char *path, struct stat44 *osb) +{ + int error; + struct stat sb; + + error = __xlstat(__STATVER, path, &sb); + if (error) + return (error); + cvtstat44(&sb, osb); + return (0); +} Index: lib/libc/freebsd4/stat.c =================================================================== RCS file: stat.c diff -N stat.c --- /dev/null Sat Oct 5 12:35:25 2002 +++ stat.c Sat Oct 5 12:40:36 2002 @@ -0,0 +1,17 @@ +#define __LIBC_COMPAT__ +#include +#include +#include "cvtstat44.h" + +int +stat(const char *path, struct stat44 *osb) +{ + int error; + struct stat sb; + + error = __xstat(__STATVER, path, &sb); + if (error) + return (error); + cvtstat44(&sb, osb); + return (0); +} Index: lib/libc/string/strmode.c =================================================================== RCS file: /home/ncvs/src/lib/libc/string/strmode.c,v retrieving revision 1.4 diff -u -2 -r1.4 strmode.c --- lib/libc/string/strmode.c 2002/03/21 18:44:54 1.4 +++ lib/libc/string/strmode.c 2002/10/05 19:40:36 @@ -44,5 +44,5 @@ void strmode(mode, p) - mode_t mode; + int mode; /* XXX mode_t */ char *p; { Index: lib/libstand/bzipfs.c =================================================================== RCS file: /home/ncvs/src/lib/libstand/bzipfs.c,v retrieving revision 1.5 diff -u -2 -r1.5 bzipfs.c --- lib/libstand/bzipfs.c 2002/03/17 12:25:48 1.5 +++ lib/libstand/bzipfs.c 2002/10/05 19:40:37 @@ -31,5 +31,4 @@ #include "stand.h" -#include #include #include <_bzlib.h> Index: lib/libstand/nfs.c =================================================================== RCS file: /home/ncvs/src/lib/libstand/nfs.c,v retrieving revision 1.10 diff -u -2 -r1.10 nfs.c --- lib/libstand/nfs.c 2002/07/31 20:17:06 1.10 +++ lib/libstand/nfs.c 2002/10/05 19:40:37 @@ -35,5 +35,4 @@ #include #include -#include #include Index: lib/libstand/stand.h =================================================================== RCS file: /home/ncvs/src/lib/libstand/stand.h,v retrieving revision 1.36 diff -u -2 -r1.36 stand.h --- lib/libstand/stand.h 2002/08/21 16:19:58 1.36 +++ lib/libstand/stand.h 2002/10/05 19:40:37 @@ -65,5 +65,4 @@ #include #include -#include #include #include @@ -93,4 +92,5 @@ struct open_file; +struct stat; /* @@ -408,2 +408,43 @@ #define realloc(x, y) Realloc(x, y, NULL, 0) #endif + +struct stat { + mode_t st_mode; /* inode protection mode */ + nlink_t st_nlink; /* number of hard links */ + uid_t st_uid; /* user ID of the file's owner */ + gid_t st_gid; /* group ID of the file's group */ + off_t st_size; /* file size, in bytes */ +}; + +#define S_IRWXU 0000700 /* RWX mask for owner */ +#define S_IRUSR 0000400 /* R for owner */ +#define S_IWUSR 0000200 /* W for owner */ +#define S_IXUSR 0000100 /* X for owner */ + +#define S_IRWXG 0000070 /* RWX mask for group */ +#define S_IRGRP 0000040 /* R for group */ +#define S_IWGRP 0000020 /* W for group */ +#define S_IXGRP 0000010 /* X for group */ + +#define S_IRWXO 0000007 /* RWX mask for other */ +#define S_IROTH 0000004 /* R for other */ +#define S_IWOTH 0000002 /* W for other */ +#define S_IXOTH 0000001 /* X for other */ + +#define S_IFMT 0170000 /* type of file mask */ +#define S_IFIFO 0010000 /* named pipe (fifo) */ +#define S_IFCHR 0020000 /* character special */ +#define S_IFDIR 0040000 /* directory */ +#define S_IFBLK 0060000 /* block special */ +#define S_IFREG 0100000 /* regular */ +#define S_IFLNK 0120000 /* symbolic link */ + +#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) /* directory */ +#define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR) /* char special */ +#define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) /* block special */ +#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) /* regular file */ +#define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO) /* fifo or socket */ +#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) /* symbolic link */ + +int fstat(int, struct stat *); +int stat(const char *, struct stat *); Index: lib/libstand/tftp.c =================================================================== RCS file: /home/ncvs/src/lib/libstand/tftp.c,v retrieving revision 1.10 diff -u -2 -r1.10 tftp.c --- lib/libstand/tftp.c 2002/07/07 23:01:36 1.10 +++ lib/libstand/tftp.c 2002/10/05 19:40:37 @@ -47,5 +47,4 @@ #include -#include #include #include Index: lib/libstand/zipfs.c =================================================================== RCS file: /home/ncvs/src/lib/libstand/zipfs.c,v retrieving revision 1.10 diff -u -2 -r1.10 zipfs.c --- lib/libstand/zipfs.c 2002/03/17 12:25:49 1.10 +++ lib/libstand/zipfs.c 2002/10/05 19:40:37 @@ -30,5 +30,4 @@ #include "stand.h" -#include #include #include Index: sbin/devfs/rule.c =================================================================== RCS file: /home/ncvs/src/sbin/devfs/rule.c,v retrieving revision 1.4 diff -u -2 -r1.4 rule.c --- sbin/devfs/rule.c 2002/07/28 06:59:40 1.4 +++ sbin/devfs/rule.c 2002/10/05 19:40:39 @@ -404,5 +404,5 @@ dr->dr_iacts |= DRA_MODE; l = strtol(av[1], &cp, 8); - if (l > (1 << (sizeof(dr->dr_mode) * 8)) - 1 || + if (l > (1LL << (sizeof(dr->dr_mode) * 8)) - 1 || *cp != '\0') errx(1, "invalid mode: %s", av[1]); Index: sbin/fsck_ffs/main.c =================================================================== RCS file: /home/ncvs/src/sbin/fsck_ffs/main.c,v retrieving revision 1.36 diff -u -2 -r1.36 main.c --- sbin/fsck_ffs/main.c 2002/08/21 18:10:28 1.36 +++ sbin/fsck_ffs/main.c 2002/10/05 19:40:39 @@ -383,7 +383,7 @@ if (debug) { if (files < 0) - printf("%d inodes missing\n", -files); + printf("%jd inodes missing\n", -(intmax_t)files); if (blks < 0) - printf("%lld blocks missing\n", -(long long)blks); + printf("%jd blocks missing\n", -(intmax_t)blks); if (duplist != NULL) { printf("The following duplicate blocks remain:"); @@ -395,5 +395,5 @@ printf("The following zero link count inodes remain:"); for (zlnp = zlnhead; zlnp; zlnp = zlnp->next) - printf(" %u,", zlnp->zlncnt); + printf(" %ju,", (uintmax_t)zlnp->zlncnt); printf("\n"); } Index: sbin/newfs/mkfs.c =================================================================== RCS file: /home/ncvs/src/sbin/newfs/mkfs.c,v retrieving revision 1.62 diff -u -2 -r1.62 mkfs.c --- sbin/newfs/mkfs.c 2002/09/25 04:06:37 1.62 +++ sbin/newfs/mkfs.c 2002/10/05 19:40:39 @@ -822,5 +822,6 @@ fscs[0].cs_nifree--; if (ino >= (unsigned long)sblock.fs_ipg * sblock.fs_ncg) { - printf("fsinit: inode value out of range (%d).\n", ino); + printf("fsinit: inode value out of range (%jd).\n", + (intmax_t)ino); exit(32); } Index: sys/boot/common/ls.c =================================================================== RCS file: /home/ncvs/src/sys/boot/common/ls.c,v retrieving revision 1.10 diff -u -2 -r1.10 ls.c --- sys/boot/common/ls.c 2000/05/01 18:03:15 1.10 +++ sys/boot/common/ls.c 2002/10/05 19:40:41 @@ -40,9 +40,10 @@ +#include + #include #include #include -#include #include Index: sys/boot/ficl/fileaccess.c =================================================================== RCS file: /home/ncvs/src/sys/boot/ficl/fileaccess.c,v retrieving revision 1.1 diff -u -2 -r1.1 fileaccess.c --- sys/boot/ficl/fileaccess.c 2002/04/09 17:45:11 1.1 +++ sys/boot/ficl/fileaccess.c 2002/10/05 19:40:41 @@ -1,10 +1,13 @@ /* $FreeBSD: src/sys/boot/ficl/fileaccess.c,v 1.1 2002/04/09 17:45:11 dcs Exp $ */ -#include +#include +#ifdef TESTMAIN #include +#include #include -#include #include -#include +#else +#include +#endif #include "ficl.h" Index: sys/boot/ficl/testmain.c =================================================================== RCS file: /home/ncvs/src/sys/boot/ficl/testmain.c,v retrieving revision 1.8 diff -u -2 -r1.8 testmain.c --- sys/boot/ficl/testmain.c 2002/04/09 17:45:11 1.8 +++ sys/boot/ficl/testmain.c 2002/10/05 19:40:42 @@ -41,9 +41,12 @@ #include +#ifdef TESTMAIN #include +#else +#include +#endif #include #include #include -#include #include Index: sys/ia64/ia32/ia32_misc.c =================================================================== RCS file: /home/ncvs/src/sys/ia64/ia32/ia32_misc.c,v retrieving revision 1.1 diff -u -2 -r1.1 ia32_misc.c --- sys/ia64/ia32/ia32_misc.c 2002/07/20 02:56:10 1.1 +++ sys/ia64/ia32/ia32_misc.c 2002/10/05 19:40:45 @@ -1097,6 +1097,139 @@ } +struct stat44_32 { + udev_t st_dev; + u_int32_t st_ino; + u_int16_t st_mode; + u_int16_t st_nlink; + uid_t st_uid; + gid_t st_gid; + udev_t st_rdev; + struct timespec32 st_atimespec; + struct timespec32 st_mtimespec; + struct timespec32 st_ctimespec; + off_t st_size; + int64_t st_blocks; + u_int32_t st_blksize; + u_int32_t st_flags; + u_int32_t st_gen; + struct timespec32 st_birthtimespec; +}; + +static void +copy_stat44(struct stat *in, struct stat44_32 *out) +{ + + bzero(out, sizeof(*out)); + CP(*in, *out, st_dev); + CP(*in, *out, st_ino); + CP(*in, *out, st_mode); + CP(*in, *out, st_nlink); + CP(*in, *out, st_uid); + CP(*in, *out, st_gid); + CP(*in, *out, st_rdev); + TS_CP(*in, *out, st_atimespec); + TS_CP(*in, *out, st_mtimespec); + TS_CP(*in, *out, st_ctimespec); + CP(*in, *out, st_size); + CP(*in, *out, st_blocks); + CP(*in, *out, st_blksize); + CP(*in, *out, st_flags); + CP(*in, *out, st_gen); + TS_CP(*in, *out, st_birthtimespec); +} + +int +ia32_stat44(struct thread *td, struct ia32_stat44_args *uap) +{ + int error; + caddr_t sg; + struct stat44_32 *p32, s32; + struct stat *p = NULL, s; + struct __xstat_args ap; + + p32 = SCARG(uap, ub); + if (p32) { + sg = stackgap_init(); + p = stackgap_alloc(&sg, sizeof(struct stat)); + } + ap.ver = __STATVER; + ap.path = uap->path; + ap.ub = p; + error = __xstat(td, &ap); + if (error) + return (error); + if (p32) { + error = copyin(p, &s, sizeof(s)); + if (error) + return (error); + copy_stat44(&s, &s32); + error = copyout(&s32, p32, sizeof(s32)); + } + return (error); +} + +int +ia32_fstat44(struct thread *td, struct ia32_fstat44_args *uap) +{ + int error; + caddr_t sg; + struct stat44_32 *p32, s32; + struct stat *p = NULL, s; + struct __xfstat_args ap; + + p32 = SCARG(uap, ub); + if (p32) { + sg = stackgap_init(); + p = stackgap_alloc(&sg, sizeof(struct stat)); + } + ap.ver = __STATVER; + ap.fd = uap->fd; + ap.sb = p; + error = __xfstat(td, &ap); + if (error) + return (error); + if (p32) { + error = copyin(p, &s, sizeof(s)); + if (error) + return (error); + copy_stat44(&s, &s32); + error = copyout(&s32, p32, sizeof(s32)); + } + return (error); +} + +int +ia32_lstat44(struct thread *td, struct ia32_lstat44_args *uap) +{ + int error; + caddr_t sg; + struct stat44_32 *p32, s32; + struct stat *p = NULL, s; + struct __xlstat_args ap; + + p32 = SCARG(uap, ub); + if (p32) { + sg = stackgap_init(); + p = stackgap_alloc(&sg, sizeof(struct stat)); + } + ap.ver = __STATVER; + ap.path = uap->path; + ap.ub = p; + error = __xlstat(td, &ap); + if (error) + return (error); + if (p32) { + error = copyin(p, &s, sizeof(s)); + if (error) + return (error); + copy_stat44(&s, &s32); + error = copyout(&s32, p32, sizeof(s32)); + } + return (error); +} + struct stat32 { udev_t st_dev; + u_int32_t __pad0; ino_t st_ino; mode_t st_mode; @@ -1105,7 +1238,9 @@ gid_t st_gid; udev_t st_rdev; + u_int32_t __pad1; struct timespec32 st_atimespec; struct timespec32 st_mtimespec; struct timespec32 st_ctimespec; + struct timespec32 st_birthtimespec; off_t st_size; int64_t st_blocks; @@ -1113,9 +1248,14 @@ u_int32_t st_flags; u_int32_t st_gen; + u_int32_t __pad2; + u_int64_t __pad3; + u_int64_t __pad4; }; static void -copy_stat( struct stat *in, struct stat32 *out) +copy_stat(struct stat *in, struct stat32 *out) { + + bzero(out, sizeof(*out)); CP(*in, *out, st_dev); CP(*in, *out, st_ino); @@ -1128,4 +1268,5 @@ TS_CP(*in, *out, st_mtimespec); TS_CP(*in, *out, st_ctimespec); + TS_CP(*in, *out, st_birthtimespec); CP(*in, *out, st_size); CP(*in, *out, st_blocks); @@ -1142,12 +1283,17 @@ struct stat32 *p32, s32; struct stat *p = NULL, s; + struct __xstat_args ap; + if (uap->ver != __STATVER) + return (EOPNOTSUPP); p32 = SCARG(uap, ub); if (p32) { sg = stackgap_init(); p = stackgap_alloc(&sg, sizeof(struct stat)); - SCARG(uap, ub) = (struct stat32 *)p; } - error = stat(td, (struct stat_args *) uap); + ap.ver = __STATVER; + ap.path = uap->path; + ap.ub = p; + error = __xstat(td, &ap); if (error) return (error); @@ -1169,12 +1315,17 @@ struct stat32 *p32, s32; struct stat *p = NULL, s; + struct __xfstat_args ap; + if (uap->ver != __STATVER) + return (EOPNOTSUPP); p32 = SCARG(uap, ub); if (p32) { sg = stackgap_init(); p = stackgap_alloc(&sg, sizeof(struct stat)); - SCARG(uap, ub) = (struct stat32 *)p; } - error = fstat(td, (struct fstat_args *) uap); + ap.ver = __STATVER; + ap.fd = uap->fd; + ap.sb = p; + error = __xfstat(td, &ap); if (error) return (error); @@ -1196,12 +1347,17 @@ struct stat32 *p32, s32; struct stat *p = NULL, s; + struct __xlstat_args ap; + if (uap->ver != __STATVER) + return (EOPNOTSUPP); p32 = SCARG(uap, ub); if (p32) { sg = stackgap_init(); p = stackgap_alloc(&sg, sizeof(struct stat)); - SCARG(uap, ub) = (struct stat32 *)p; } - error = lstat(td, (struct lstat_args *) uap); + ap.ver = __STATVER; + ap.path = uap->path; + ap.ub = p; + error = __xlstat(td, &ap); if (error) return (error); Index: sys/ia64/ia32/ia32_proto.h =================================================================== RCS file: /home/ncvs/src/sys/ia64/ia32/ia32_proto.h,v retrieving revision 1.3 diff -u -2 -r1.3 ia32_proto.h --- sys/ia64/ia32/ia32_proto.h 2002/09/25 18:10:38 1.3 +++ sys/ia64/ia32/ia32_proto.h 2002/10/05 19:40:45 @@ -3,6 +3,6 @@ * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD: src/sys/ia64/ia32/ia32_proto.h,v 1.3 2002/09/25 18:10:38 archie Exp $ - * created from FreeBSD: src/sys/ia64/ia32/syscalls.master,v 1.2 2002/07/20 02:56:10 peter Exp + * $FreeBSD$ + * created from FreeBSD: src/sys/ia64/ia32/syscalls.master,v 1.4 2002/10/02 16:48:15 archie Exp */ @@ -149,15 +149,15 @@ char offsethi_l_[PADL_(u_int32_t)]; u_int32_t offsethi; char offsethi_r_[PADR_(u_int32_t)]; }; -struct ia32_stat_args { +struct ia32_stat44_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char ub_l_[PADL_(struct stat32 *)]; struct stat32 * ub; char ub_r_[PADR_(struct stat32 *)]; + char ub_l_[PADL_(struct stat44_32 *)]; struct stat44_32 * ub; char ub_r_[PADR_(struct stat44_32 *)]; }; -struct ia32_fstat_args { +struct ia32_fstat44_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; - char ub_l_[PADL_(struct stat32 *)]; struct stat32 * ub; char ub_r_[PADR_(struct stat32 *)]; + char ub_l_[PADL_(struct stat44_32 *)]; struct stat44_32 * ub; char ub_r_[PADR_(struct stat44_32 *)]; }; -struct ia32_lstat_args { +struct ia32_lstat44_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char ub_l_[PADL_(struct stat32 *)]; struct stat32 * ub; char ub_r_[PADR_(struct stat32 *)]; + char ub_l_[PADL_(struct stat44_32 *)]; struct stat44_32 * ub; char ub_r_[PADR_(struct stat44_32 *)]; }; struct ia32_mmap_args { @@ -213,4 +213,19 @@ char oact_l_[PADL_(struct sigaction32 *)]; struct sigaction32 * oact; char oact_r_[PADR_(struct sigaction32 *)]; }; +struct ia32_stat_args { + char ver_l_[PADL_(int)]; int ver; char ver_r_[PADR_(int)]; + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char ub_l_[PADL_(struct stat32 *)]; struct stat32 * ub; char ub_r_[PADR_(struct stat32 *)]; +}; +struct ia32_fstat_args { + char ver_l_[PADL_(int)]; int ver; char ver_r_[PADR_(int)]; + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char ub_l_[PADL_(struct stat32 *)]; struct stat32 * ub; char ub_r_[PADR_(struct stat32 *)]; +}; +struct ia32_lstat_args { + char ver_l_[PADL_(int)]; int ver; char ver_r_[PADR_(int)]; + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char ub_l_[PADL_(struct stat32 *)]; struct stat32 * ub; char ub_r_[PADR_(struct stat32 *)]; +}; int ia32_open(struct thread *, struct ia32_open_args *); int ia32_wait4(struct thread *, struct ia32_wait4_args *); @@ -236,7 +251,7 @@ int ia32_pread(struct thread *, struct ia32_pread_args *); int ia32_pwrite(struct thread *, struct ia32_pwrite_args *); -int ia32_stat(struct thread *, struct ia32_stat_args *); -int ia32_fstat(struct thread *, struct ia32_fstat_args *); -int ia32_lstat(struct thread *, struct ia32_lstat_args *); +int ia32_stat44(struct thread *, struct ia32_stat44_args *); +int ia32_fstat44(struct thread *, struct ia32_fstat44_args *); +int ia32_lstat44(struct thread *, struct ia32_lstat44_args *); int ia32_mmap(struct thread *, struct ia32_mmap_args *); int ia32_lseek(struct thread *, struct ia32_lseek_args *); @@ -246,4 +261,7 @@ int ia32_sendfile(struct thread *, struct ia32_sendfile_args *); int ia32_sigaction(struct thread *, struct ia32_sigaction_args *); +int ia32_stat(struct thread *, struct ia32_stat_args *); +int ia32_fstat(struct thread *, struct ia32_fstat_args *); +int ia32_lstat(struct thread *, struct ia32_lstat_args *); #ifdef COMPAT_43 Index: sys/ia64/ia32/ia32_syscall.h =================================================================== RCS file: /home/ncvs/src/sys/ia64/ia32/ia32_syscall.h,v retrieving revision 1.3 diff -u -2 -r1.3 ia32_syscall.h --- sys/ia64/ia32/ia32_syscall.h 2002/09/25 18:10:38 1.3 +++ sys/ia64/ia32/ia32_syscall.h 2002/10/05 19:40:45 @@ -3,6 +3,6 @@ * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD: src/sys/ia64/ia32/ia32_syscall.h,v 1.3 2002/09/25 18:10:38 archie Exp $ - * created from FreeBSD: src/sys/ia64/ia32/syscalls.master,v 1.2 2002/07/20 02:56:10 peter Exp + * $FreeBSD$ + * created from FreeBSD: src/sys/ia64/ia32/syscalls.master,v 1.4 2002/10/02 16:48:15 archie Exp */ @@ -168,7 +168,7 @@ #define IA32_SYS_setegid 182 #define IA32_SYS_seteuid 183 -#define IA32_SYS_ia32_stat 188 -#define IA32_SYS_ia32_fstat 189 -#define IA32_SYS_ia32_lstat 190 +#define IA32_SYS_ia32_stat44 188 +#define IA32_SYS_ia32_fstat44 189 +#define IA32_SYS_ia32_lstat44 190 #define IA32_SYS_pathconf 191 #define IA32_SYS_fpathconf 192 @@ -286,3 +286,6 @@ #define IA32_SYS_lchflags 391 #define IA32_SYS_uuidgen 392 -#define IA32_SYS_MAXSYSCALL 393 +#define IA32_SYS_ia32_stat 415 +#define IA32_SYS_ia32_fstat 416 +#define IA32_SYS_ia32_lstat 417 +#define IA32_SYS_MAXSYSCALL 418 Index: sys/ia64/ia32/ia32_sysent.c =================================================================== RCS file: /home/ncvs/src/sys/ia64/ia32/ia32_sysent.c,v retrieving revision 1.4 diff -u -2 -r1.4 ia32_sysent.c --- sys/ia64/ia32/ia32_sysent.c 2002/10/02 16:48:14 1.4 +++ sys/ia64/ia32/ia32_sysent.c 2002/10/05 19:40:45 @@ -3,6 +3,6 @@ * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD: src/sys/ia64/ia32/ia32_sysent.c,v 1.4 2002/10/02 16:48:14 archie Exp $ - * created from FreeBSD: src/sys/ia64/ia32/syscalls.master,v 1.2 2002/07/20 02:56:10 peter Exp + * $FreeBSD$ + * created from FreeBSD: src/sys/ia64/ia32/syscalls.master,v 1.4 2002/10/02 16:48:15 archie Exp */ @@ -206,7 +206,7 @@ { 0, (sy_call_t *)nosys }, /* 186 = lfs_segclean */ { 0, (sy_call_t *)nosys }, /* 187 = lfs_segwait */ - { AS(ia32_stat_args), (sy_call_t *)ia32_stat }, /* 188 = ia32_stat */ - { AS(ia32_fstat_args), (sy_call_t *)ia32_fstat }, /* 189 = ia32_fstat */ - { AS(ia32_lstat_args), (sy_call_t *)ia32_lstat }, /* 190 = ia32_lstat */ + { AS(ia32_stat44_args), (sy_call_t *)ia32_stat44 }, /* 188 = ia32_stat44 */ + { AS(ia32_fstat44_args), (sy_call_t *)ia32_fstat44 }, /* 189 = ia32_fstat44 */ + { AS(ia32_lstat44_args), (sy_call_t *)ia32_lstat44 }, /* 190 = ia32_lstat44 */ { AS(pathconf_args), (sy_call_t *)pathconf }, /* 191 = pathconf */ { SYF_MPSAFE | AS(fpathconf_args), (sy_call_t *)fpathconf }, /* 192 = fpathconf */ @@ -411,3 +411,28 @@ { AS(lchflags_args), (sy_call_t *)lchflags }, /* 391 = lchflags */ { AS(uuidgen_args), (sy_call_t *)uuidgen }, /* 392 = uuidgen */ + { 0, (sy_call_t *)nosys }, /* 393 = nsendfile */ + { 0, (sy_call_t *)nosys }, /* 394 = mac_syscall */ + { 0, (sy_call_t *)nosys }, /* 395 = nosys */ + { 0, (sy_call_t *)nosys }, /* 396 = nosys */ + { 0, (sy_call_t *)nosys }, /* 397 = nosys */ + { 0, (sy_call_t *)nosys }, /* 398 = nosys */ + { 0, (sy_call_t *)nosys }, /* 399 = nosys */ + { 0, (sy_call_t *)nosys }, /* 400 = ksem_close */ + { 0, (sy_call_t *)nosys }, /* 401 = ksem_post */ + { 0, (sy_call_t *)nosys }, /* 402 = ksem_wait */ + { 0, (sy_call_t *)nosys }, /* 403 = ksem_trywait */ + { 0, (sy_call_t *)nosys }, /* 404 = ksem_init */ + { 0, (sy_call_t *)nosys }, /* 405 = ksem_open */ + { 0, (sy_call_t *)nosys }, /* 406 = ksem_unlink */ + { 0, (sy_call_t *)nosys }, /* 407 = ksem_getvalue */ + { 0, (sy_call_t *)nosys }, /* 408 = ksem_destroy */ + { 0, (sy_call_t *)nosys }, /* 409 = __mac_get_pid */ + { 0, (sy_call_t *)nosys }, /* 410 = __mac_get_link */ + { 0, (sy_call_t *)nosys }, /* 411 = __mac_set_link */ + { 0, (sy_call_t *)nosys }, /* 412 = extattr_set_link */ + { 0, (sy_call_t *)nosys }, /* 413 = extattr_get_link */ + { 0, (sy_call_t *)nosys }, /* 414 = extattr_delete_link */ + { AS(ia32_stat_args), (sy_call_t *)ia32_stat }, /* 415 = ia32_stat */ + { AS(ia32_fstat_args), (sy_call_t *)ia32_fstat }, /* 416 = ia32_fstat */ + { AS(ia32_lstat_args), (sy_call_t *)ia32_lstat }, /* 417 = ia32_lstat */ }; Index: sys/ia64/ia32/syscalls.master =================================================================== RCS file: /home/ncvs/src/sys/ia64/ia32/syscalls.master,v retrieving revision 1.4 diff -u -2 -r1.4 syscalls.master --- sys/ia64/ia32/syscalls.master 2002/10/02 16:48:15 1.4 +++ sys/ia64/ia32/syscalls.master 2002/10/05 19:40:45 @@ -284,7 +284,7 @@ 186 UNIMPL BSD lfs_segclean 187 UNIMPL BSD lfs_segwait -188 STD POSIX { int ia32_stat(char *path, struct stat32 *ub); } -189 STD POSIX { int ia32_fstat(int fd, struct stat32 *ub); } -190 STD POSIX { int ia32_lstat(char *path, struct stat32 *ub); } +188 STD POSIX { int ia32_stat44(char *path, struct stat44_32 *ub); } +189 STD POSIX { int ia32_fstat44(int fd, struct stat44_32 *ub); } +190 STD POSIX { int ia32_lstat44(char *path, struct stat44_32 *ub); } 191 NOPROTO POSIX { int pathconf(char *path, int name); } 192 MNOPROTO POSIX { int fpathconf(int fd, int name); } @@ -450,28 +450,28 @@ 312 MNOPROTO BSD { int setresgid(gid_t rgid, gid_t egid, gid_t sgid); } 313 OBSOL NOHIDE signanosleep -314 UNIMPL NOHIDE aio_return -315 UNIMPL NOHIDE aio_suspend -316 UNIMPL NOHIDE aio_cancel -317 UNIMPL NOHIDE aio_error -318 UNIMPL NOHIDE aio_read -319 UNIMPL NOHIDE aio_write -320 UNIMPL NOHIDE lio_listio -321 MNOPROTO BSD { int yield(void); } +314 UNIMPL NOHIDE aio_return +315 UNIMPL NOHIDE aio_suspend +316 UNIMPL NOHIDE aio_cancel +317 UNIMPL NOHIDE aio_error +318 UNIMPL NOHIDE aio_read +319 UNIMPL NOHIDE aio_write +320 UNIMPL NOHIDE lio_listio +321 MNOPROTO BSD { int yield(void); } 322 OBSOL NOHIDE thr_sleep 323 OBSOL NOHIDE thr_wakeup -324 MNOPROTO BSD { int mlockall(int how); } -325 MNOPROTO BSD { int munlockall(void); } -326 NOPROTO BSD { int __getcwd(u_char *buf, u_int buflen); } +324 MNOPROTO BSD { int mlockall(int how); } +325 MNOPROTO BSD { int munlockall(void); } +326 NOPROTO BSD { int __getcwd(u_char *buf, u_int buflen); } -327 MNOPROTO POSIX { int sched_setparam (pid_t pid, const struct sched_param *param); } -328 MNOPROTO POSIX { int sched_getparam (pid_t pid, struct sched_param *param); } +327 MNOPROTO POSIX { int sched_setparam (pid_t pid, const struct sched_param *param); } +328 MNOPROTO POSIX { int sched_getparam (pid_t pid, struct sched_param *param); } -329 MNOPROTO POSIX { int sched_setscheduler (pid_t pid, int policy, const struct sched_param *param); } -330 MNOPROTO POSIX { int sched_getscheduler (pid_t pid); } +329 MNOPROTO POSIX { int sched_setscheduler (pid_t pid, int policy, const struct sched_param *param); } +330 MNOPROTO POSIX { int sched_getscheduler (pid_t pid); } -331 MNOPROTO POSIX { int sched_yield (void); } -332 MNOPROTO POSIX { int sched_get_priority_max (int policy); } -333 MNOPROTO POSIX { int sched_get_priority_min (int policy); } -334 MNOPROTO POSIX { int sched_rr_get_interval (pid_t pid, struct timespec *interval); } +331 MNOPROTO POSIX { int sched_yield (void); } +332 MNOPROTO POSIX { int sched_get_priority_max (int policy); } +333 MNOPROTO POSIX { int sched_get_priority_min (int policy); } +334 MNOPROTO POSIX { int sched_rr_get_interval (pid_t pid, struct timespec *interval); } 335 NOPROTO BSD { int utrace(const void *addr, size_t len); } ; XXX note - bigendian is different @@ -562,2 +562,28 @@ 391 NOPROTO BSD { int lchflags(const char *path, int flags); } 392 NOPROTO BSD { int uuidgen(struct uuid *store, int count); } +393 UNIMPL NOHIDE nsendfile +394 UNIMPL NOHIDE mac_syscall +395 UNIMPL NOHIDE nosys +396 UNIMPL NOHIDE nosys +397 UNIMPL NOHIDE nosys +398 UNIMPL NOHIDE nosys +399 UNIMPL NOHIDE nosys +400 UNIMPL NOHIDE ksem_close +401 UNIMPL NOHIDE ksem_post +402 UNIMPL NOHIDE ksem_wait +403 UNIMPL NOHIDE ksem_trywait +404 UNIMPL NOHIDE ksem_init +405 UNIMPL NOHIDE ksem_open +406 UNIMPL NOHIDE ksem_unlink +407 UNIMPL NOHIDE ksem_getvalue +408 UNIMPL NOHIDE ksem_destroy +409 UNIMPL BSD __mac_get_pid +410 UNIMPL BSD __mac_get_link +411 UNIMPL BSD __mac_set_link +412 UNIMPL BSD extattr_set_link +413 UNIMPL BSD extattr_get_link +414 UNIMPL BSD extattr_delete_link + +415 STD POSIX { int ia32_stat(int ver, char *path, struct stat32 *ub); } +416 STD POSIX { int ia32_fstat(int ver, int fd, struct stat32 *ub); } +417 STD POSIX { int ia32_lstat(int ver, char *path, struct stat32 *ub); } Index: sys/isofs/cd9660/cd9660_vnops.c =================================================================== RCS file: /home/ncvs/src/sys/isofs/cd9660/cd9660_vnops.c,v retrieving revision 1.80 diff -u -2 -r1.80 cd9660_vnops.c --- sys/isofs/cd9660/cd9660_vnops.c 2002/09/28 17:14:52 1.80 +++ sys/isofs/cd9660/cd9660_vnops.c 2002/10/05 19:40:45 @@ -441,4 +441,5 @@ int entryoffsetinblock; doff_t endsearch; + ino_t ino; u_long bmask; int error = 0; @@ -543,5 +544,6 @@ case ISO_FTYPE_RRIP: cd9660_rrip_getname(ep,idp->current.d_name, &namelen, - &idp->current.d_fileno,imp); + &ino, imp); + idp->current.d_fileno = ino; idp->current.d_namlen = (u_char)namelen; if (idp->current.d_namlen) Index: sys/kern/init_sysent.c =================================================================== RCS file: /home/ncvs/src/sys/kern/init_sysent.c,v retrieving revision 1.135 diff -u -2 -r1.135 init_sysent.c --- sys/kern/init_sysent.c 2002/10/02 16:48:15 1.135 +++ sys/kern/init_sysent.c 2002/10/05 19:40:45 @@ -3,6 +3,6 @@ * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD: src/sys/kern/init_sysent.c,v 1.135 2002/10/02 16:48:15 archie Exp $ - * created from FreeBSD: src/sys/kern/syscalls.master,v 1.124 2002/10/01 02:35:59 rwatson Exp + * $FreeBSD$ + * created from FreeBSD: src/sys/kern/syscalls.master,v 1.125 2002/10/02 16:48:15 archie Exp */ @@ -217,7 +217,7 @@ { 0, (sy_call_t *)nosys }, /* 186 = lfs_segclean */ { 0, (sy_call_t *)nosys }, /* 187 = lfs_segwait */ - { AS(stat_args), (sy_call_t *)stat }, /* 188 = stat */ - { SYF_MPSAFE | AS(fstat_args), (sy_call_t *)fstat }, /* 189 = fstat */ - { AS(lstat_args), (sy_call_t *)lstat }, /* 190 = lstat */ + { compat4(AS(freebsd4_stat44_args),stat44) }, /* 188 = old stat44 */ + { compat4(SYF_MPSAFE | AS(freebsd4_fstat44_args),fstat44) }, /* 189 = old fstat44 */ + { compat4(AS(freebsd4_lstat44_args),lstat44) }, /* 190 = old lstat44 */ { AS(pathconf_args), (sy_call_t *)pathconf }, /* 191 = pathconf */ { SYF_MPSAFE | AS(fpathconf_args), (sy_call_t *)fpathconf }, /* 192 = fpathconf */ @@ -444,3 +444,6 @@ { 0, (sy_call_t *)nosys }, /* 413 = extattr_get_link */ { 0, (sy_call_t *)nosys }, /* 414 = extattr_delete_link */ + { AS(__xstat_args), (sy_call_t *)__xstat }, /* 415 = __xstat */ + { SYF_MPSAFE | AS(__xfstat_args), (sy_call_t *)__xfstat }, /* 416 = __xfstat */ + { AS(__xlstat_args), (sy_call_t *)__xlstat }, /* 417 = __xlstat */ }; Index: sys/kern/kern_descrip.c =================================================================== RCS file: /home/ncvs/src/sys/kern/kern_descrip.c,v retrieving revision 1.162 diff -u -2 -r1.162 kern_descrip.c --- sys/kern/kern_descrip.c 2002/10/03 02:12:58 1.162 +++ sys/kern/kern_descrip.c 2002/10/05 19:40:45 @@ -852,5 +852,5 @@ struct ofstat_args { int fd; - struct ostat *sb; + struct stat43 *sb; }; #endif @@ -866,5 +866,5 @@ struct file *fp; struct stat ub; - struct ostat oub; + struct stat43 oub; int error; @@ -874,5 +874,5 @@ error = fo_stat(fp, &ub, td->td_ucred, td); if (error == 0) { - cvtstat(&ub, &oub); + cvtstat43(&ub, &oub); error = copyout(&oub, uap->sb, sizeof (oub)); } @@ -884,9 +884,44 @@ #endif /* COMPAT_43 || COMPAT_SUNOS */ +#ifdef COMPAT_FREEBSD4 /* * Return status information about a file descriptor. */ +/* + * MPSAFE + */ +/* ARGSUSED */ +int +freebsd4_fstat44(td, uap) + struct thread *td; + register struct freebsd4_fstat44_args *uap; +{ + struct file *fp; + struct stat ub; + struct stat44 oub; + int error; + + mtx_lock(&Giant); + if ((error = fget(td, uap->fd, &fp)) != 0) + goto done2; + error = fo_stat(fp, &ub, td->td_ucred, td); + if (error == 0) { + cvtstat44(&ub, &oub); + error = copyout(&oub, uap->sb, sizeof (oub)); + } + fdrop(fp, td); +done2: + mtx_unlock(&Giant); + return (error); +} +#endif /* COMPAT_FREEBSD4 */ + + +/* + * Return status information about a file descriptor. + */ #ifndef _SYS_SYSPROTO_H_ -struct fstat_args { +struct __xfstat_args { + int ver; int fd; struct stat *sb; @@ -898,7 +933,7 @@ /* ARGSUSED */ int -fstat(td, uap) +__xfstat(td, uap) struct thread *td; - struct fstat_args *uap; + struct __xfstat_args *uap; { struct file *fp; @@ -906,4 +941,6 @@ int error; + if (uap->ver != __STATVER) + return (EOPNOTSUPP); mtx_lock(&Giant); if ((error = fget(td, uap->fd, &fp)) != 0) Index: sys/kern/syscalls.c =================================================================== RCS file: /home/ncvs/src/sys/kern/syscalls.c,v retrieving revision 1.120 diff -u -2 -r1.120 syscalls.c --- sys/kern/syscalls.c 2002/10/01 02:37:35 1.120 +++ sys/kern/syscalls.c 2002/10/05 19:40:45 @@ -3,6 +3,6 @@ * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD: src/sys/kern/syscalls.c,v 1.120 2002/10/01 02:37:35 rwatson Exp $ - * created from FreeBSD: src/sys/kern/syscalls.master,v 1.124 2002/10/01 02:35:59 rwatson Exp + * $FreeBSD$ + * created from FreeBSD: src/sys/kern/syscalls.master,v 1.125 2002/10/02 16:48:15 archie Exp */ @@ -196,7 +196,7 @@ "#186", /* 186 = lfs_segclean */ "#187", /* 187 = lfs_segwait */ - "stat", /* 188 = stat */ - "fstat", /* 189 = fstat */ - "lstat", /* 190 = lstat */ + "old.stat44", /* 188 = old stat44 */ + "old.fstat44", /* 189 = old fstat44 */ + "old.lstat44", /* 190 = old lstat44 */ "pathconf", /* 191 = pathconf */ "fpathconf", /* 192 = fpathconf */ @@ -423,3 +423,6 @@ "#413", /* 413 = extattr_get_link */ "#414", /* 414 = extattr_delete_link */ + "__xstat", /* 415 = __xstat */ + "__xfstat", /* 416 = __xfstat */ + "__xlstat", /* 417 = __xlstat */ }; Index: sys/kern/syscalls.master =================================================================== RCS file: /home/ncvs/src/sys/kern/syscalls.master,v retrieving revision 1.125 diff -u -2 -r1.125 syscalls.master --- sys/kern/syscalls.master 2002/10/02 16:48:15 1.125 +++ sys/kern/syscalls.master 2002/10/05 19:40:45 @@ -294,7 +294,7 @@ 186 UNIMPL BSD lfs_segclean 187 UNIMPL BSD lfs_segwait -188 STD POSIX { int stat(char *path, struct stat *ub); } -189 MSTD POSIX { int fstat(int fd, struct stat *sb); } -190 STD POSIX { int lstat(char *path, struct stat *ub); } +188 COMPAT4 POSIX { int stat44(char *path, struct stat44 *ub); } +189 MCOMPAT4 POSIX { int fstat44(int fd, struct stat44 *sb); } +190 COMPAT4 POSIX { int lstat44(char *path, struct stat44 *ub); } 191 STD POSIX { int pathconf(char *path, int name); } 192 MSTD POSIX { int fpathconf(int fd, int name); } @@ -591,2 +591,5 @@ 413 UNIMPL BSD extattr_get_link 414 UNIMPL BSD extattr_delete_link +415 STD BSD { int __xstat(int ver, char *path, struct stat *ub); } +416 MSTD BSD { int __xfstat(int ver, int fd, struct stat *sb); } +417 STD BSD { int __xlstat(int ver, char *path, struct stat *ub); } Index: sys/kern/vfs_syscalls.c =================================================================== RCS file: /home/ncvs/src/sys/kern/vfs_syscalls.c,v retrieving revision 1.289 diff -u -2 -r1.289 vfs_syscalls.c --- sys/kern/vfs_syscalls.c 2002/10/02 09:05:30 1.289 +++ sys/kern/vfs_syscalls.c 2002/10/05 19:40:45 @@ -1478,5 +1478,5 @@ struct ostat_args { char *path; - struct ostat *ub; + struct stat43 *ub; }; #endif @@ -1487,9 +1487,9 @@ register struct ostat_args /* { syscallarg(char *) path; - syscallarg(struct ostat *) ub; + syscallarg(struct stat43 *) ub; } */ *uap; { struct stat sb; - struct ostat osb; + struct stat43 osb; int error; struct nameidata nd; @@ -1504,5 +1504,5 @@ if (error) return (error); - cvtstat(&sb, &osb); + cvtstat43(&sb, &osb); error = copyout(&osb, SCARG(uap, ub), sizeof (osb)); return (error); @@ -1515,5 +1515,5 @@ struct olstat_args { char *path; - struct ostat *ub; + struct stat43 *ub; }; #endif @@ -1524,10 +1524,10 @@ register struct olstat_args /* { syscallarg(char *) path; - syscallarg(struct ostat *) ub; + syscallarg(struct stat43 *) ub; } */ *uap; { struct vnode *vp; struct stat sb; - struct ostat osb; + struct stat43 osb; int error; struct nameidata nd; @@ -1543,5 +1543,5 @@ if (error) return (error); - cvtstat(&sb, &osb); + cvtstat43(&sb, &osb); error = copyout(&osb, SCARG(uap, ub), sizeof (osb)); return (error); @@ -1552,7 +1552,7 @@ */ void -cvtstat(st, ost) +cvtstat43(st, ost) struct stat *st; - struct ostat *ost; + struct stat43 *ost; { @@ -1578,9 +1578,101 @@ #endif /* COMPAT_43 || COMPAT_SUNOS */ +#ifdef COMPAT_FREEBSD4 /* * Get file status; this version follows links. */ +/* ARGSUSED */ +int +freebsd4_stat44(td, uap) + struct thread *td; + register struct freebsd4_stat44_args *uap; +{ + struct stat sb; + struct stat44 osb; + int error; + struct nameidata nd; + + NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | NOOBJ, UIO_USERSPACE, + uap->path, td); + if ((error = namei(&nd)) != 0) + return (error); + NDFREE(&nd, NDF_ONLY_PNBUF); + error = vn_stat(nd.ni_vp, &sb, td->td_ucred, NOCRED, td); + vput(nd.ni_vp); + if (error) + return (error); + cvtstat44(&sb, &osb); + error = copyout(&osb, uap->ub, sizeof (osb)); + return (error); +} + +/* + * Get file status; this version does not follow links. + */ +/* ARGSUSED */ +int +freebsd4_lstat44(td, uap) + struct thread *td; + register struct freebsd4_lstat44_args *uap; +{ + struct vnode *vp; + struct stat sb; + struct stat44 osb; + int error; + struct nameidata nd; + + NDINIT(&nd, LOOKUP, NOFOLLOW | LOCKLEAF | NOOBJ, UIO_USERSPACE, + uap->path, td); + if ((error = namei(&nd)) != 0) + return (error); + vp = nd.ni_vp; + error = vn_stat(vp, &sb, td->td_ucred, NOCRED, td); + NDFREE(&nd, NDF_ONLY_PNBUF); + vput(vp); + if (error) + return (error); + cvtstat44(&sb, &osb); + error = copyout(&osb, uap->ub, sizeof (osb)); + return (error); +} + +/* + * Convert from an old to a new stat structure. + */ +void +cvtstat44(st, ost) + struct stat *st; + struct stat44 *ost; +{ + + bzero(ost, sizeof *ost); + ost->st_dev = st->st_dev; + ost->st_ino = st->st_ino; + ost->st_mode = st->st_mode; + if (st->st_nlink > USHRT_MAX) + ost->st_nlink = USHRT_MAX; + else + ost->st_nlink = st->st_nlink; + ost->st_uid = st->st_uid; + ost->st_gid = st->st_gid; + ost->st_rdev = st->st_rdev; + ost->st_atimespec = st->st_atimespec; + ost->st_mtimespec = st->st_mtimespec; + ost->st_ctimespec = st->st_ctimespec; + ost->st_size = st->st_size; + ost->st_blocks = st->st_blocks; + ost->st_blksize = st->st_blksize; + ost->st_flags = st->st_flags; + ost->st_gen = st->st_gen; + ost->st_birthtimespec = st->st_birthtimespec; +} +#endif + +/* + * Get file status; this version follows links. + */ #ifndef _SYS_SYSPROTO_H_ -struct stat_args { +struct __xstat_args { + int ver; char *path; struct stat *ub; @@ -1589,7 +1681,7 @@ /* ARGSUSED */ int -stat(td, uap) +__xstat(td, uap) struct thread *td; - register struct stat_args /* { + register struct __xstat_args /* { syscallarg(char *) path; syscallarg(struct stat *) ub; @@ -1600,4 +1692,6 @@ struct nameidata nd; + if (uap->ver != __STATVER) + return (EOPNOTSUPP); #ifdef LOOKUP_SHARED NDINIT(&nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF | NOOBJ, @@ -1622,5 +1716,6 @@ */ #ifndef _SYS_SYSPROTO_H_ -struct lstat_args { +struct __xlstat_args { + int ver; char *path; struct stat *ub; @@ -1629,7 +1724,7 @@ /* ARGSUSED */ int -lstat(td, uap) +__xlstat(td, uap) struct thread *td; - register struct lstat_args /* { + register struct __xlstat_args /* { syscallarg(char *) path; syscallarg(struct stat *) ub; @@ -1641,4 +1736,6 @@ struct nameidata nd; + if (uap->ver != __STATVER) + return (EOPNOTSUPP); NDINIT(&nd, LOOKUP, NOFOLLOW | LOCKLEAF | NOOBJ, UIO_USERSPACE, SCARG(uap, path), td); @@ -1657,8 +1754,4 @@ /* * Implementation of the NetBSD stat() function. - * XXX This should probably be collapsed with the FreeBSD version, - * as the differences are only due to vn_stat() clearing spares at - * the end of the structures. vn_stat could be split to avoid this, - * and thus collapse the following to close to zero code. */ void @@ -1683,5 +1776,4 @@ nsb->st_flags = sb->st_flags; nsb->st_gen = sb->st_gen; - nsb->st_birthtimespec = sb->st_birthtimespec; } Index: sys/nfsclient/nfs_subs.c =================================================================== RCS file: /home/ncvs/src/sys/nfsclient/nfs_subs.c,v retrieving revision 1.114 diff -u -2 -r1.114 nfs_subs.c --- sys/nfsclient/nfs_subs.c 2002/09/25 02:38:43 1.114 +++ sys/nfsclient/nfs_subs.c 2002/10/05 19:40:47 @@ -549,6 +549,5 @@ vap->va_blocksize = NFS_FABLKSIZE; vap->va_bytes = fxdr_hyper(&fp->fa3_used); - vap->va_fileid = fxdr_unsigned(int32_t, - fp->fa3_fileid.nfsuquad[1]); + vap->va_fileid = fxdr_hyper(&fp->fa3_fileid); fxdr_nfsv3time(&fp->fa3_atime, &vap->va_atime); fxdr_nfsv3time(&fp->fa3_ctime, &vap->va_ctime); Index: sys/nfsserver/nfs_srvsubs.c =================================================================== RCS file: /home/ncvs/src/sys/nfsserver/nfs_srvsubs.c,v retrieving revision 1.116 diff -u -2 -r1.116 nfs_srvsubs.c --- sys/nfsserver/nfs_srvsubs.c 2002/08/21 19:28:44 1.116 +++ sys/nfsserver/nfs_srvsubs.c 2002/10/05 19:40:47 @@ -987,6 +987,5 @@ fp->fa3_fsid.nfsuquad[0] = 0; fp->fa3_fsid.nfsuquad[1] = txdr_unsigned(vap->va_fsid); - fp->fa3_fileid.nfsuquad[0] = 0; - fp->fa3_fileid.nfsuquad[1] = txdr_unsigned(vap->va_fileid); + fp->fa3_fileid = txdr_hyper(vap->va_fileid); txdr_nfsv3time(&vap->va_atime, &fp->fa3_atime); txdr_nfsv3time(&vap->va_mtime, &fp->fa3_mtime); Index: sys/sys/_types.h =================================================================== RCS file: /home/ncvs/src/sys/sys/_types.h,v retrieving revision 1.8 diff -u -2 -r1.8 _types.h --- sys/sys/_types.h 2002/09/18 05:51:23 1.8 +++ sys/sys/_types.h 2002/10/05 19:40:47 @@ -41,5 +41,5 @@ typedef __uint64_t __fsfilcnt_t; typedef __uint32_t __gid_t; -typedef __uint16_t __mode_t; /* permissions */ +typedef __uint32_t __mode_t; /* permissions */ typedef int __nl_item; typedef __int64_t __off_t; /* file offset */ Index: sys/sys/cdefs.h =================================================================== RCS file: /home/ncvs/src/sys/sys/cdefs.h,v retrieving revision 1.66 diff -u -2 -r1.66 cdefs.h --- sys/sys/cdefs.h 2002/09/23 06:37:48 1.66 +++ sys/sys/cdefs.h 2002/10/05 19:40:47 @@ -153,4 +153,18 @@ #endif +#ifdef _KERNEL +#define __RENAME(x) no renaming in kernel, get it right +#else +#if __GNUC__ +#define __RENAME(x) __asm__(__STRING(x)) +#else +#ifdef lint +#define __RENAME(x) __symbolrename(x) +#else +#error "No function renaming possible" +#endif /* lint */ +#endif /* __GNUC__ */ +#endif /* _KERNEL */ + /* * GCC 2.95 provides `__restrict' as an extention to C90 to support the Index: sys/sys/stat.h =================================================================== RCS file: /home/ncvs/src/sys/sys/stat.h,v retrieving revision 1.29 diff -u -2 -r1.29 stat.h --- sys/sys/stat.h 2002/08/21 16:20:01 1.29 +++ sys/sys/stat.h 2002/10/05 19:40:47 @@ -69,10 +69,11 @@ #endif -#ifndef _POSIX_SOURCE -struct ostat { +#ifdef _KERNEL +/* 4.3BSD, FreeBSD-1.x */ +struct stat43 { u_int16_t st_dev; /* inode's device */ - ino_t st_ino; /* inode's number */ - mode_t st_mode; /* inode protection mode */ - nlink_t st_nlink; /* number of hard links */ + u_int32_t st_ino; /* inode's number */ + u_int16_t st_mode; /* inode protection mode */ + u_int16_t st_nlink; /* number of hard links */ u_int16_t st_uid; /* user ID of the file's owner */ u_int16_t st_gid; /* group ID of the file's group */ @@ -89,24 +90,17 @@ #endif /* !_POSIX_SOURCE */ -struct stat { +#if defined(_KERNEL) || defined(__LIBC_COMPAT__) +/* 4.4BSD, FreeBSD-2.x through 4.x */ +struct stat44 { __dev_t st_dev; /* inode's device */ - ino_t st_ino; /* inode's number */ - mode_t st_mode; /* inode protection mode */ - nlink_t st_nlink; /* number of hard links */ + u_int32_t st_ino; /* inode's number */ + u_int16_t st_mode; /* inode protection mode */ + u_int16_t st_nlink; /* number of hard links */ uid_t st_uid; /* user ID of the file's owner */ gid_t st_gid; /* group ID of the file's group */ __dev_t st_rdev; /* device type */ -#ifndef _POSIX_SOURCE struct timespec st_atimespec; /* time of last access */ struct timespec st_mtimespec; /* time of last data modification */ struct timespec st_ctimespec; /* time of last file status change */ -#else - time_t st_atime; /* time of last access */ - long st_atimensec; /* nsec of last access */ - time_t st_mtime; /* time of last data modification */ - long st_mtimensec; /* nsec of last data modification */ - time_t st_ctime; /* time of last file status change */ - long st_ctimensec; /* nsec of last file status change */ -#endif off_t st_size; /* file size, in bytes */ int64_t st_blocks; /* blocks allocated for file */ @@ -115,5 +109,4 @@ u_int32_t st_gen; /* file generation number */ int32_t st_lspare; -#ifndef _POSIX_SOURCE struct timespec st_birthtimespec; /* time of file creation */ /* @@ -127,16 +120,46 @@ int :(8 / 2) * (16 - (int)sizeof(struct timespec)); int :(8 / 2) * (16 - (int)sizeof(struct timespec)); +}; +#endif + +struct stat { + __dev_t st_dev; /* inode's device */ + __dev_t st_rdev; /* device type */ + mode_t st_mode; /* inode protection mode */ + nlink_t st_nlink; /* number of hard links */ + uid_t st_uid; /* user ID of the file's owner */ + gid_t st_gid; /* group ID of the file's group */ + ino_t st_ino; /* inode's number */ +#ifndef _POSIX_SOURCE + struct timespec st_atimespec; /* time of last access */ + struct timespec st_mtimespec; /* time of last data modification */ + struct timespec st_ctimespec; /* time of last file status change */ + struct timespec st_birthtimespec; /* time of file creation */ #else + time_t st_atime; /* time of last access */ + long st_atimensec; /* nsec of last access */ + time_t st_mtime; /* time of last data modification */ + long st_mtimensec; /* nsec of last data modification */ + time_t st_ctime; /* time of last file status change */ + long st_ctimensec; /* nsec of last file status change */ time_t st_birthtime; /* time of file creation */ long st_birthtimensec; /* nsec of file creation */ - int :(8 / 2) * (16 - (int)sizeof(struct __timespec)); - int :(8 / 2) * (16 - (int)sizeof(struct __timespec)); #endif + off_t st_size; /* file size, in bytes */ + int64_t st_blocks; /* blocks allocated for file */ + u_int32_t st_blksize; /* optimal blocksize for I/O */ + fflags_t st_flags; /* user defined flags for file */ + u_int32_t st_gen; /* file generation number */ + int32_t __pad2; /* pad to 64 bit alignment */ + int64_t __pad3; /* spare */ + int64_t __pad4; /* spare */ }; +#define __STATVER 50 /* FreeBSD 5.0 */ #ifndef _POSIX_SOURCE +/* NetBSD-compatable stat structure */ struct nstat { __dev_t st_dev; /* inode's device */ - ino_t st_ino; /* inode's number */ + u_int32_t st_ino; /* inode's number */ u_int32_t st_mode; /* inode protection mode */ u_int32_t st_nlink; /* number of hard links */ @@ -152,10 +175,5 @@ fflags_t st_flags; /* user defined flags for file */ u_int32_t st_gen; /* file generation number */ - struct timespec st_birthtimespec; /* time of file creation */ - /* - * See above about the following padding. - */ - int :(8 / 2) * (16 - (int)sizeof(struct timespec)); - int :(8 / 2) * (16 - (int)sizeof(struct timespec)); + u_int64_t st_qspare[2]; }; #endif @@ -266,9 +284,23 @@ __BEGIN_DECLS int chmod(const char *, mode_t); -int fstat(int, struct stat *); int mkdir(const char *, mode_t); int mkfifo(const char *, mode_t); -int stat(const char *, struct stat *); mode_t umask(mode_t); +int __xfstat(int, int, struct stat *); +int __xstat(int, const char *, struct stat *); + +#ifndef __LIBC_COMPAT__ +static __inline int +fstat(int _fd, struct stat *_stat) +{ + return __xfstat(__STATVER, _fd, _stat); +} + +static __inline int +stat(const char * _path, struct stat *_stat) +{ + return __xstat(__STATVER, _path, _stat); +} +#endif #ifndef _POSIX_SOURCE @@ -278,5 +310,13 @@ int fchmod(int, mode_t); int lchmod(const char *, mode_t); -int lstat(const char *, struct stat *); +int __xlstat(int, const char *, struct stat *); + +#ifndef __LIBC_COMPAT__ +static __inline int +lstat(const char * _path, struct stat *_stat) +{ + return __xlstat(__STATVER, _path, _stat); +} +#endif #endif __END_DECLS Index: sys/sys/syscall.h =================================================================== RCS file: /home/ncvs/src/sys/sys/syscall.h,v retrieving revision 1.119 diff -u -2 -r1.119 syscall.h --- sys/sys/syscall.h 2002/10/01 02:37:35 1.119 +++ sys/sys/syscall.h 2002/10/05 19:40:47 @@ -3,6 +3,6 @@ * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD: src/sys/sys/syscall.h,v 1.119 2002/10/01 02:37:35 rwatson Exp $ - * created from FreeBSD: src/sys/kern/syscalls.master,v 1.124 2002/10/01 02:35:59 rwatson Exp + * $FreeBSD$ + * created from FreeBSD: src/sys/kern/syscalls.master,v 1.125 2002/10/02 16:48:15 archie Exp */ @@ -174,7 +174,7 @@ #define SYS_setegid 182 #define SYS_seteuid 183 -#define SYS_stat 188 -#define SYS_fstat 189 -#define SYS_lstat 190 + /* 188 is old stat44 */ + /* 189 is old fstat44 */ + /* 190 is old lstat44 */ #define SYS_pathconf 191 #define SYS_fpathconf 192 @@ -318,3 +318,6 @@ #define SYS_ksem_getvalue 407 #define SYS_ksem_destroy 408 -#define SYS_MAXSYSCALL 415 +#define SYS___xstat 415 +#define SYS___xfstat 416 +#define SYS___xlstat 417 +#define SYS_MAXSYSCALL 418 Index: sys/sys/syscall.mk =================================================================== RCS file: /home/ncvs/src/sys/sys/syscall.mk,v retrieving revision 1.74 diff -u -2 -r1.74 syscall.mk --- sys/sys/syscall.mk 2002/10/01 02:37:35 1.74 +++ sys/sys/syscall.mk 2002/10/05 19:40:47 @@ -1,6 +1,6 @@ # FreeBSD system call names. # DO NOT EDIT-- this file is automatically generated. -# $FreeBSD: src/sys/sys/syscall.mk,v 1.74 2002/10/01 02:37:35 rwatson Exp $ -# created from FreeBSD: src/sys/kern/syscalls.master,v 1.124 2002/10/01 02:35:59 rwatson Exp +# $FreeBSD$ +# created from FreeBSD: src/sys/kern/syscalls.master,v 1.125 2002/10/02 16:48:15 archie Exp MIASM = \ syscall.o \ @@ -127,7 +127,4 @@ setegid.o \ seteuid.o \ - stat.o \ - fstat.o \ - lstat.o \ pathconf.o \ fpathconf.o \ @@ -266,3 +263,6 @@ ksem_unlink.o \ ksem_getvalue.o \ - ksem_destroy.o + ksem_destroy.o \ + __xstat.o \ + __xfstat.o \ + __xlstat.o Index: sys/sys/sysproto.h =================================================================== RCS file: /home/ncvs/src/sys/sys/sysproto.h,v retrieving revision 1.112 diff -u -2 -r1.112 sysproto.h --- sys/sys/sysproto.h 2002/10/02 16:48:16 1.112 +++ sys/sys/sysproto.h 2002/10/05 19:40:47 @@ -3,6 +3,6 @@ * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD: src/sys/sys/sysproto.h,v 1.112 2002/10/02 16:48:16 archie Exp $ - * created from FreeBSD: src/sys/kern/syscalls.master,v 1.124 2002/10/01 02:35:59 rwatson Exp + * $FreeBSD$ + * created from FreeBSD: src/sys/kern/syscalls.master,v 1.125 2002/10/02 16:48:15 archie Exp */ @@ -570,16 +570,4 @@ char euid_l_[PADL_(uid_t)]; uid_t euid; char euid_r_[PADR_(uid_t)]; }; -struct stat_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char ub_l_[PADL_(struct stat *)]; struct stat * ub; char ub_r_[PADR_(struct stat *)]; -}; -struct fstat_args { - char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; - char sb_l_[PADL_(struct stat *)]; struct stat * sb; char sb_r_[PADR_(struct stat *)]; -}; -struct lstat_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char ub_l_[PADL_(struct stat *)]; struct stat * ub; char ub_r_[PADR_(struct stat *)]; -}; struct pathconf_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; @@ -1158,4 +1146,19 @@ char id_l_[PADL_(semid_t)]; semid_t id; char id_r_[PADR_(semid_t)]; }; +struct __xstat_args { + char ver_l_[PADL_(int)]; int ver; char ver_r_[PADR_(int)]; + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char ub_l_[PADL_(struct stat *)]; struct stat * ub; char ub_r_[PADR_(struct stat *)]; +}; +struct __xfstat_args { + char ver_l_[PADL_(int)]; int ver; char ver_r_[PADR_(int)]; + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char sb_l_[PADL_(struct stat *)]; struct stat * sb; char sb_r_[PADR_(struct stat *)]; +}; +struct __xlstat_args { + char ver_l_[PADL_(int)]; int ver; char ver_r_[PADR_(int)]; + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char ub_l_[PADL_(struct stat *)]; struct stat * ub; char ub_r_[PADR_(struct stat *)]; +}; int nosys(struct thread *, struct nosys_args *); void sys_exit(struct thread *, struct sys_exit_args *); @@ -1281,7 +1284,4 @@ int setegid(struct thread *, struct setegid_args *); int seteuid(struct thread *, struct seteuid_args *); -int stat(struct thread *, struct stat_args *); -int fstat(struct thread *, struct fstat_args *); -int lstat(struct thread *, struct lstat_args *); int pathconf(struct thread *, struct pathconf_args *); int fpathconf(struct thread *, struct fpathconf_args *); @@ -1420,4 +1420,7 @@ int ksem_getvalue(struct thread *, struct ksem_getvalue_args *); int ksem_destroy(struct thread *, struct ksem_destroy_args *); +int __xstat(struct thread *, struct __xstat_args *); +int __xfstat(struct thread *, struct __xfstat_args *); +int __xlstat(struct thread *, struct __xlstat_args *); #ifdef COMPAT_43 @@ -1591,4 +1594,16 @@ #ifdef COMPAT_FREEBSD4 +struct freebsd4_stat44_args { + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char ub_l_[PADL_(struct stat44 *)]; struct stat44 * ub; char ub_r_[PADR_(struct stat44 *)]; +}; +struct freebsd4_fstat44_args { + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char sb_l_[PADL_(struct stat44 *)]; struct stat44 * sb; char sb_r_[PADR_(struct stat44 *)]; +}; +struct freebsd4_lstat44_args { + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char ub_l_[PADL_(struct stat44 *)]; struct stat44 * ub; char ub_r_[PADR_(struct stat44 *)]; +}; struct freebsd4_sendfile_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; @@ -1600,4 +1615,7 @@ char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; }; +int freebsd4_stat44(struct thread *, struct freebsd4_stat44_args *); +int freebsd4_fstat44(struct thread *, struct freebsd4_fstat44_args *); +int freebsd4_lstat44(struct thread *, struct freebsd4_lstat44_args *); int freebsd4_sendfile(struct thread *, struct freebsd4_sendfile_args *); Index: sys/sys/types.h =================================================================== RCS file: /home/ncvs/src/sys/sys/types.h,v retrieving revision 1.74 diff -u -2 -r1.74 types.h --- sys/sys/types.h 2002/10/02 04:13:32 1.74 +++ sys/sys/types.h 2002/10/05 19:40:47 @@ -128,5 +128,5 @@ #endif -typedef __uint32_t ino_t; /* inode number */ +typedef __uint64_t ino_t; /* inode number */ typedef long key_t; /* IPC key (for Sys V IPC) */ @@ -136,5 +136,5 @@ #endif -typedef __uint16_t nlink_t; /* link count */ +typedef __uint32_t nlink_t; /* link count */ #ifndef _OFF_T_DECLARED Index: sys/sys/vnode.h =================================================================== RCS file: /home/ncvs/src/sys/sys/vnode.h,v retrieving revision 1.214 diff -u -2 -r1.214 vnode.h --- sys/sys/vnode.h 2002/09/28 17:33:31 1.214 +++ sys/sys/vnode.h 2002/10/05 19:40:47 @@ -237,12 +237,11 @@ struct vattr { enum vtype va_type; /* vnode type (for create) */ - u_short va_mode; /* files access mode and type */ - short va_nlink; /* number of references to file */ + u_int va_mode; /* files access mode and type */ + int va_nlink; /* number of references to file */ uid_t va_uid; /* owner user id */ gid_t va_gid; /* owner group id */ udev_t va_fsid; /* filesystem id */ - long va_fileid; /* file id */ + quad_t va_fileid; /* file id */ u_quad_t va_size; /* file size in bytes */ - long va_blocksize; /* blocksize preferred for i/o */ struct timespec va_atime; /* time of last access */ struct timespec va_mtime; /* time of last modification */ @@ -252,4 +251,5 @@ u_long va_flags; /* flags defined for file */ udev_t va_rdev; /* device the special file represents */ + long va_blocksize; /* blocksize preferred for i/o */ u_quad_t va_bytes; /* bytes of disk space held by file */ u_quad_t va_filerev; /* file modification number */ @@ -580,5 +580,6 @@ struct mount; struct nameidata; -struct ostat; +struct stat43; +struct stat44; struct thread; struct proc; @@ -604,5 +605,6 @@ void cache_purgevfs(struct mount *mp); int cache_leaf_test(struct vnode *vp); -void cvtstat(struct stat *st, struct ostat *ost); +void cvtstat43(struct stat *st, struct stat43 *ost); +void cvtstat44(struct stat *st, struct stat44 *ost); void cvtnstat(struct stat *sb, struct nstat *nsb); int getnewvnode(const char *tag, struct mount *mp, vop_t **vops, Index: sys/ufs/ffs/ffs_alloc.c =================================================================== RCS file: /home/ncvs/src/sys/ufs/ffs/ffs_alloc.c,v retrieving revision 1.102 diff -u -2 -r1.102 ffs_alloc.c --- sys/ufs/ffs/ffs_alloc.c 2002/09/19 03:55:30 1.102 +++ sys/ufs/ffs/ffs_alloc.c 2002/10/05 19:40:47 @@ -1897,6 +1897,6 @@ } if ((u_int)ino >= fs->fs_ipg * fs->fs_ncg) - panic("ffs_vfree: range: dev = %s, ino = %d, fs = %s", - devtoname(dev), ino, fs->fs_fsmnt); + panic("ffs_vfree: range: dev = %s, ino = %jd, fs = %s", + devtoname(dev), (intmax_t)ino, fs->fs_fsmnt); if ((error = bread(devvp, cgbno, (int)fs->fs_cgsize, NOCRED, &bp))) { brelse(bp); @@ -2109,7 +2109,7 @@ struct proc *p = curproc; /* XXX */ - log(LOG_ERR, "pid %d (%s), uid %d inumber %d on %s: %s\n", + log(LOG_ERR, "pid %d (%s), uid %d inumber %jd on %s: %s\n", p ? p->p_pid : -1, p ? p->p_comm : "-", - p ? p->p_ucred->cr_uid : 0, inum, fs->fs_fsmnt, cp); + p ? p->p_ucred->cr_uid : 0, (intmax_t)inum, fs->fs_fsmnt, cp); } Index: sys/ufs/ffs/ffs_snapshot.c =================================================================== RCS file: /home/ncvs/src/sys/ufs/ffs/ffs_snapshot.c,v retrieving revision 1.41 diff -u -2 -r1.41 ffs_snapshot.c --- sys/ufs/ffs/ffs_snapshot.c 2002/09/25 02:47:49 1.41 +++ sys/ufs/ffs/ffs_snapshot.c 2002/10/05 19:40:47 @@ -451,5 +451,6 @@ fs->fs_snapinum[snaploc] = ip->i_number; if (ip->i_nextsnap.tqe_prev != 0) - panic("ffs_snapshot: %d already on list", ip->i_number); + panic("ffs_snapshot: %jd already on list", + (intmax_t)ip->i_number); snaphead = &ip->i_devvp->v_rdev->si_snapshots; TAILQ_INSERT_TAIL(snaphead, ip, i_nextsnap); @@ -1178,6 +1179,6 @@ break; if (xp == 0) - printf("ffs_snapgone: lost snapshot vnode %d\n", - ip->i_number); + printf("ffs_snapgone: lost snapshot vnode %jd\n", + (intmax_t)ip->i_number); else vrele(ITOV(ip)); @@ -1402,7 +1403,7 @@ #ifdef DEBUG if (snapdebug) - printf("%s %d lbn %jd from inum %d\n", - "Grabonremove: snapino", ip->i_number, - (intmax_t)lbn, inum); + printf("%s %jd lbn %jd from inum %jd\n", + "Grabonremove: snapino", (intmax_t)ip->i_number, + (intmax_t)lbn, (intmax_t)inum); #endif vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); @@ -1439,7 +1440,7 @@ #ifdef DEBUG if (snapdebug) - printf("%s%d lbn %jd %s %d size %ld to blkno %jd\n", - "Copyonremove: snapino ", ip->i_number, - (intmax_t)lbn, "for inum", inum, size, + printf("%s%jd lbn %jd %s %jd size %ld to blkno %jd\n", + "Copyonremove: snapino ", (intmax_t)ip->i_number, + (intmax_t)lbn, "for inum", (intmax_t)inum, size, (intmax_t)cbp->b_blkno); #endif @@ -1535,6 +1536,6 @@ } if (ip->i_nextsnap.tqe_prev != 0) - panic("ffs_snapshot_mount: %d already on list", - ip->i_number); + panic("ffs_snapshot_mount: %jd already on list", + (intmax_t)ip->i_number); else TAILQ_INSERT_TAIL(snaphead, ip, i_nextsnap); @@ -1657,10 +1658,10 @@ #ifdef DEBUG if (snapdebug) { - printf("Copyonwrite: snapino %d lbn %jd for ", - ip->i_number, (intmax_t)lbn); + printf("Copyonwrite: snapino %jd lbn %jd for ", + (intmax_t)ip->i_number, (intmax_t)lbn); if (bp->b_vp == devvp) printf("fs metadata"); else - printf("inum %d", VTOI(bp->b_vp)->i_number); + printf("inum %jd", (intmax_t)VTOI(bp->b_vp)->i_number); printf(" lblkno %jd to blkno %jd\n", (intmax_t)bp->b_lblkno, (intmax_t)cbp->b_blkno); Index: sys/ufs/ffs/ffs_softdep.c =================================================================== RCS file: /home/ncvs/src/sys/ufs/ffs/ffs_softdep.c,v retrieving revision 1.125 diff -u -2 -r1.125 ffs_softdep.c --- sys/ufs/ffs/ffs_softdep.c 2002/09/28 19:04:49 1.125 +++ sys/ufs/ffs/ffs_softdep.c 2002/10/05 19:40:48 @@ -3037,6 +3037,6 @@ if (dap->da_newinum != ip->i_number) { FREE_LOCK(&lk); - panic("newdirrem: inum %d should be %d", - ip->i_number, dap->da_newinum); + panic("newdirrem: inum %jd should be %jd", + (intmax_t)ip->i_number, (intmax_t)dap->da_newinum); } /* @@ -3519,7 +3519,7 @@ if (ep->d_ino != dap->da_newinum) { FREE_LOCK(&lk); - panic("%s: dir inum %d != new %d", + panic("%s: dir inum %d != new %jd", "initiate_write_filepage", - ep->d_ino, dap->da_newinum); + ep->d_ino, (intmax_t)dap->da_newinum); } if (dap->da_state & DIRCHG) Index: usr.sbin/quot/quot.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/quot/quot.c,v retrieving revision 1.18 diff -u -2 -r1.18 quot.c --- usr.sbin/quot/quot.c 2002/06/21 06:18:05 1.18 +++ usr.sbin/quot/quot.c 2002/10/05 19:40:52 @@ -482,4 +482,5 @@ ino_t inode, inode1; ino_t maxino; + uintmax_t ino; union dinode *dp; @@ -490,7 +491,8 @@ ungetc(c,stdin); inode1 = -1; - while (scanf("%u",&inode) == 1) { + while (scanf("%ju",&ino) == 1) { + inode = ino; if (inode > maxino) { - warnx("illegal inode %d",inode); + warnx("illegal inode %jd", (intmax_t)inode); return; }