Bug 71219

Summary: /proc/*/map dont tell file offset
Product: Base System Reporter: KOIE Hidetaka <koie>
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed Overcome By Events    
Severity: Affects Only Me CC: jpaetzel
Priority: Normal    
Version: 6.0-CURRENT   
Hardware: Any   
OS: Any   

Description KOIE Hidetaka 2004-09-01 04:00:42 UTC
      A checkpointing library wants to know a file offset in a mmaped segment.

Fix: like this:


if (freepath != NULL)--bTG0AAh9jhuuFzY3KkdrR680mo0t8UvlLWwpbUcGIUg4tkx6
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

--- procfs_map.c.org    Wed Sep  1 10:56:57 2004
+++ procfs_map.c        Wed Sep  1 11:50:32 2004
@@ -163,5 +163,5 @@ procfs_doprocmap(PFS_FILL_ARGS)
                 */
                snprintf(mebuffer, sizeof mebuffer,
-                   "0x%lx 0x%lx %d %d %p %s%s%s %d %d 0x%x %s %s %s %s\n",
+                   "0x%lx 0x%lx %d %d %p %s%s%s %d %d 0x%x %s %s %s %s %lld\n",
                        (u_long)entry->start, (u_long)entry->end,
                        resident, privateresident, obj,
@@ -172,5 +172,5 @@ procfs_doprocmap(PFS_FILL_ARGS)
                        (entry->eflags & MAP_ENTRY_COW)?"COW":"NCOW",
                        (entry->eflags & MAP_ENTRY_NEEDS_COPY)?"NC":"NNC",
-                       type, fullpath);
+                       type, fullpath, (long long)entry->offset);
Comment 1 Josh Paetzel freebsd_committer freebsd_triage 2017-06-27 00:58:19 UTC
Bug scrub.