len = phdrs[i].p_memsz;
seg_off = phdrs[i].p_vaddr;
- for (off = 0; off < len; off += CLICK_SIZE) {
+ if (len > LONG_MAX) {
+ printf("VFS: segment too large to dump, truncating\n");
+ len = LONG_MAX;
+ }
+
+ for (off = 0; off < (off_t) len; off += CLICK_SIZE) {
r = sys_vircopy(fp->fp_endpoint, D,
(vir_bytes) (seg_off + off),
SELF, D, (vir_bytes) buf,
(phys_bytes) CLICK_SIZE);
- write_buf(f, (char *) buf, (off + CLICK_SIZE <= len) ?
+ write_buf(f, (char *) buf, (off + CLICK_SIZE <= (off_t) len) ?
CLICK_SIZE : (len - off));
}
}
* pointers are really offsets from the start of stack.
* Return true iff the operation succeeded.
*/
- int offset, a0, a1;
+ int offset;
+ vir_bytes a0, a1;
size_t old_bytes = *stk_bytes;
/* Prepending arg adds at least one string and a zero byte. */
assert((seg == T)||(seg == D));
/* Make sure that the file is big enough */
- if (vp->v_size < off+seg_bytes) return(EIO);
+ if (off + seg_bytes > LONG_MAX) return(EIO);
+ if ((unsigned long) vp->v_size < off+seg_bytes) return(EIO);
if (seg == T) {
/* We have to use a copy loop until safecopies support segments */
void check_vnode_locks(void);
void check_vnode_locks_by_me(struct fproc *rfp);
struct vnode *get_free_vnode(void);
-struct vnode *find_vnode(int fs_e, int numb);
+struct vnode *find_vnode(int fs_e, ino_t inode);
void init_vnodes(void);
int is_vnode_locked(struct vnode *vp);
int lock_vnode(struct vnode *vp, tll_access_t locktype);
/* Verify that file descriptors are okay to select on */
for (fd = 0; fd < nfds; fd++) {
struct filp *f;
- int type, ops;
+ unsigned int type, ops;
/* Because the select() interface implicitly includes file descriptors
* you might not want to select on, we have to figure out whether we're
static int is_supported_major(struct filp *f)
{
/* See if this filp is a handle on a device on which we support select() */
- int m;
+ unsigned int m;
if (!(f && f->filp_vno)) return(FALSE);
if ((f->filp_vno->v_mode & I_TYPE) != I_CHAR_SPECIAL) return(FALSE);
if (len <= M3_STRING) {
/* Just copy the path from the message */
- int count = 0;
+ unsigned int count = 0;
rpu = &dest[0];
rpm = job_m_in.pathname; /* contained in input message */
for (count = 0; count <= len; count++)
/*===========================================================================*
* find_vnode *
*===========================================================================*/
-struct vnode *find_vnode(int fs_e, int ino)
+struct vnode *find_vnode(int fs_e, ino_t ino)
{
/* Find a specified (FS endpoint and inode number) vnode in the
* vnode table */