git: mincore(2): Fix several bugs

Aaron LI aly at crater.dragonflybsd.org
Sun Aug 2 19:31:12 PDT 2026


commit 634062a4fbc4ffe9373a864311bfc8d9c2bf6ddd
Author: Aaron LI <aly at aaronly.me>
Date:   Mon Aug 3 09:55:07 2026 +0800

    mincore(2): Fix several bugs
    
    * Return ENOMEN when the requested range is not fully mapped.
      (obtained from FreeBSD: 455dd7d4c79bc7bef5401721f617e64eca7ef422)
    
      This change should fix a crash in Mesa where it calls mincore() to
      determine whether a protocol field is a valid pointer in order to
      keep compatible with an old protocol version.
    
    * Fix an off-by-one error in filling the skipped entries.  lastvecindex
      refers to the last valid byte, so the new bytes should come after it.
      (obtained from FreeBSD: 6a87d217e2da2a63d4431aeb871783e1dd7349ae)
    
    * Fix the calculation of the 'end' boundary.
      (obtained from FreeBSD: d0c9294b810f8b42b7ac27a46db44b94ddca3160)
    
    * Update the man page.
    
    Reported-by: peeterm

Summary of changes:
 lib/libc/sys/mincore.2 | 60 ++++++++++++++++++++++++++++++++++++++------------
 sys/vm/vm_mmap.c       | 42 +++++++++++++++++++++++------------
 2 files changed, 74 insertions(+), 28 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/634062a4fbc4ffe9373a864311bfc8d9c2bf6ddd


-- 
DragonFly BSD source repository


More information about the Commits mailing list