Date: Wed, 1 Aug 2007 14:22:46 GMT From: Roman Divacky <rdivacky@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 124464 for review Message-ID: <200708011422.l71EMkXf029798@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=124464 Change 124464 by rdivacky@rdivacky_witten on 2007/08/01 14:22:43 Allow non-zero file offsets in linprocfs. PR: 101453 Submitted by: des Affected files ... .. //depot/projects/soc2007/rdivacky/linux_fixes/sys/compat/linprocfs/linprocfs.c#2 edit Differences ... ==== //depot/projects/soc2007/rdivacky/linux_fixes/sys/compat/linprocfs/linprocfs.c#2 (text+ko) ==== @@ -858,14 +858,12 @@ static int linprocfs_doprocmaps(PFS_FILL_ARGS) { - char mebuffer[512]; vm_map_t map = &p->p_vmspace->vm_map; vm_map_entry_t entry, tmp_entry; vm_object_t obj, tobj, lobj; vm_offset_t saved_end; vm_ooffset_t off = 0; char *name = "", *freename = NULL; - size_t len; ino_t ino; unsigned int last_timestamp; int ref_count, shadow_count, flags; @@ -888,9 +886,7 @@ error = 0; vm_map_lock_read(map); - for (entry = map->header.next; - ((uio->uio_resid > 0) && (entry != &map->header)); - entry = entry->next) { + for (entry = map->header.next; entry != &map->header; entry = entry->next) { name = ""; freename = NULL; if (entry->eflags & MAP_ENTRY_IS_SUB_MAP) @@ -938,7 +934,7 @@ * format: * start, end, access, offset, major, minor, inode, name. */ - snprintf(mebuffer, sizeof mebuffer, + sbuf_printf(sb, "%08lx-%08lx %s%s%s%s %08lx %02x:%02x %lu%s%s\n", (u_long)entry->start, (u_long)entry->end, (entry->protection & VM_PROT_READ)?"r":"-", @@ -954,18 +950,6 @@ ); if (freename) free(freename, M_TEMP); - len = strlen(mebuffer); - if (len > uio->uio_resid) - len = uio->uio_resid; /* - * XXX We should probably return - * EFBIG here, as in procfs. - */ - last_timestamp = map->timestamp; - vm_map_unlock_read(map); - error = uiomove(mebuffer, len, uio); - vm_map_lock_read(map); - if (error) - break; if (last_timestamp + 1 != map->timestamp) { /* * Look again for the entry because the map was
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200708011422.l71EMkXf029798>