From owner-p4-projects@FreeBSD.ORG Wed Aug 1 14:22:47 2007 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 1028D16A574; Wed, 1 Aug 2007 14:22:47 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BFB9E16A474 for ; Wed, 1 Aug 2007 14:22:46 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id B048E13C45E for ; Wed, 1 Aug 2007 14:22:46 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id l71EMkdf029801 for ; Wed, 1 Aug 2007 14:22:46 GMT (envelope-from rdivacky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id l71EMkXf029798 for perforce@freebsd.org; Wed, 1 Aug 2007 14:22:46 GMT (envelope-from rdivacky@FreeBSD.org) Date: Wed, 1 Aug 2007 14:22:46 GMT Message-Id: <200708011422.l71EMkXf029798@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to rdivacky@FreeBSD.org using -f From: Roman Divacky To: Perforce Change Reviews Cc: Subject: PERFORCE change 124464 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Aug 2007 14:22:47 -0000 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