From 3a19b8d37d9bbe52bd79ed8e1bfc85d48376292b Mon Sep 17 00:00:00 2001 From: deraadt Date: Fri, 15 Dec 1995 08:09:38 +0000 Subject: [PATCH] from netbsd; 64-bit cleanup --- sys/lib/libsa/exec.c | 4 ++-- sys/lib/libsa/net.h | 4 ++-- sys/lib/libsa/ufs.c | 35 ++++++++++++++++++++--------------- sys/lib/libsa/ufs.h | 6 +++--- 4 files changed, 27 insertions(+), 22 deletions(-) diff --git a/sys/lib/libsa/exec.c b/sys/lib/libsa/exec.c index f4588485f66..32c87bb509a 100644 --- a/sys/lib/libsa/exec.c +++ b/sys/lib/libsa/exec.c @@ -1,4 +1,4 @@ -/* $NetBSD: exec.c,v 1.10 1995/08/04 07:37:03 thorpej Exp $ */ +/* $NetBSD: exec.c,v 1.11 1995/10/20 00:47:47 cgd Exp $ */ /*- * Copyright (c) 1982, 1986, 1990, 1993 @@ -95,7 +95,7 @@ exec(path, loadaddr, howto) goto shread; addr += x.a_text; if (N_GETMAGIC(x) == ZMAGIC || N_GETMAGIC(x) == NMAGIC) - while ((int)addr & (N_PAGSIZ(x) - 1)) + while ((long)addr & (N_PAGSIZ(x) - 1)) *addr++ = 0; /* Data */ diff --git a/sys/lib/libsa/net.h b/sys/lib/libsa/net.h index 01beb6461d9..4f979087a0a 100644 --- a/sys/lib/libsa/net.h +++ b/sys/lib/libsa/net.h @@ -1,4 +1,4 @@ -/* $NetBSD: net.h,v 1.9 1995/09/23 17:14:41 thorpej Exp $ */ +/* $NetBSD: net.h,v 1.10 1995/10/20 00:46:30 cgd Exp $ */ /* * Copyright (c) 1993 Adam Glass @@ -61,7 +61,7 @@ /* * How much room to leave for headers: - * 14: struct ether_header + * 14: struct ether_header * 20: struct ip * 8: struct udphdr * That's 42 but let's pad it out to 48 bytes. diff --git a/sys/lib/libsa/ufs.c b/sys/lib/libsa/ufs.c index ccba9547f1e..dab31d94610 100644 --- a/sys/lib/libsa/ufs.c +++ b/sys/lib/libsa/ufs.c @@ -1,4 +1,4 @@ -/* $NetBSD: ufs.c,v 1.12 1995/09/17 00:49:48 pk Exp $ */ +/* $NetBSD: ufs.c,v 1.13 1995/10/20 00:42:21 cgd Exp $ */ /*- * Copyright (c) 1993 @@ -88,16 +88,20 @@ struct file { indirect block at level i */ char *f_blk[NIADDR]; /* buffer for indirect block at level i */ - u_long f_blksize[NIADDR]; + size_t f_blksize[NIADDR]; /* size of buffer */ daddr_t f_blkno[NIADDR];/* disk address of block in buffer */ char *f_buf; /* buffer for data block */ - u_int f_buf_size; /* size of data block */ + size_t f_buf_size; /* size of data block */ daddr_t f_buf_blkno; /* block number of data block */ }; +static int read_inode __P((ino_t, struct open_file *)); +static int block_map __P((struct open_file *, daddr_t, daddr_t *)); +static int buf_read_file __P((struct open_file *, char **, size_t *)); +static int search_directory __P((char *, struct open_file *, ino_t *)); #ifdef COMPAT_UFS -void ffs_oldfscompat __P((struct fs *)); +static void ffs_oldfscompat __P((struct fs *)); #endif /* @@ -111,7 +115,7 @@ read_inode(inumber, f) register struct file *fp = (struct file *)f->f_fsdata; register struct fs *fs = fp->f_fs; char *buf; - u_int rsize; + size_t rsize; int rc; /* @@ -120,7 +124,8 @@ read_inode(inumber, f) buf = alloc(fs->fs_bsize); twiddle(); rc = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, - fsbtodb(fs, ino_to_fsba(fs, inumber)), fs->fs_bsize, buf, &rsize); + fsbtodb(fs, ino_to_fsba(fs, inumber)), fs->fs_bsize, + buf, &rsize); if (rc) goto out; if (rsize != fs->fs_bsize) { @@ -147,7 +152,7 @@ read_inode(inumber, f) } out: free(buf, fs->fs_bsize); - return (rc); + return (0); } /* @@ -232,7 +237,7 @@ block_map(f, file_block, disk_block_p) fsbtodb(fp->f_fs, ind_block_num), fs->fs_bsize, fp->f_blk[level], - (u_int *)&fp->f_blksize[level]); + &fp->f_blksize[level]); if (rc) return (rc); if (fp->f_blksize[level] != fs->fs_bsize) @@ -264,14 +269,14 @@ static int buf_read_file(f, buf_p, size_p) struct open_file *f; char **buf_p; /* out */ - u_int *size_p; /* out */ + size_t *size_p; /* out */ { register struct file *fp = (struct file *)f->f_fsdata; register struct fs *fs = fp->f_fs; long off; register daddr_t file_block; daddr_t disk_block; - long block_size; + size_t block_size; int rc; off = blkoff(fs, fp->f_seekp); @@ -332,7 +337,7 @@ search_directory(name, f, inumber_p) register struct direct *dp; struct direct *edp; char *buf; - u_int buf_size; + size_t buf_size; int namlen, length; int rc; @@ -383,7 +388,7 @@ ufs_open(path, f) struct file *fp; struct fs *fs; int rc; - u_int buf_size; + size_t buf_size; int nlinks = 0; char namebuf[MAXPATHLEN+1]; char *buf = NULL; @@ -506,7 +511,7 @@ ufs_open(path, f) /* * Read file for symbolic link */ - u_int buf_size; + size_t buf_size; daddr_t disk_block; register struct fs *fs = fp->f_fs; @@ -589,7 +594,7 @@ ufs_read(f, start, size, resid) register struct file *fp = (struct file *)f->f_fsdata; register size_t csize; char *buf; - u_int buf_size; + size_t buf_size; int rc = 0; register char *addr = start; @@ -675,7 +680,7 @@ ufs_stat(f, sb) * * XXX - goes away some day. */ -void +static void ffs_oldfscompat(fs) struct fs *fs; { diff --git a/sys/lib/libsa/ufs.h b/sys/lib/libsa/ufs.h index c17823d9741..a919b00ccc2 100644 --- a/sys/lib/libsa/ufs.h +++ b/sys/lib/libsa/ufs.h @@ -1,4 +1,4 @@ -/* $NetBSD: ufs.h,v 1.3 1995/09/17 00:49:50 pk Exp $ */ +/* $NetBSD: ufs.h,v 1.5 1995/10/20 01:35:25 cgd Exp $ */ /*- * Copyright (c) 1993 @@ -38,8 +38,8 @@ int ufs_open __P((char *path, struct open_file *f)); int ufs_close __P((struct open_file *f)); int ufs_read __P((struct open_file *f, void *buf, - u_int size, u_int *resid)); + size_t size, size_t *resid)); int ufs_write __P((struct open_file *f, void *buf, - u_int size, u_int *resid)); + size_t size, size_t *resid)); off_t ufs_seek __P((struct open_file *f, off_t offset, int where)); int ufs_stat __P((struct open_file *f, struct stat *sb)); -- 2.20.1