Author: kevans
Date: Sun Sep 29 17:30:10 2019
New Revision: 352870
URL: https://svnweb.freebsd.org/changeset/base/352870

Log:
  memfd_create(3): Don't actually force hugetlb size with MFD_HUGETLB
  
  The size flags are only required to select a size on systems that support
  multiple sizes. MFD_HUGETLB by itself is valid.

Modified:
  head/lib/libc/sys/shm_open.c

Modified: head/lib/libc/sys/shm_open.c
==============================================================================
--- head/lib/libc/sys/shm_open.c        Sun Sep 29 15:17:58 2019        
(r352869)
+++ head/lib/libc/sys/shm_open.c        Sun Sep 29 17:30:10 2019        
(r352870)
@@ -88,9 +88,6 @@ memfd_create(const char *name, unsigned int flags)
        if ((flags & ~(MFD_CLOEXEC | MFD_ALLOW_SEALING | MFD_HUGETLB |
            MFD_HUGE_MASK)) != 0)
                return (EINVAL);
-       /* HUGETLB set with no size specified. */
-       if ((flags & MFD_HUGETLB) != 0 && (flags & MFD_HUGE_MASK) == 0)
-               return (EINVAL);
        /* Size specified but no HUGETLB. */
        if ((flags & MFD_HUGE_MASK) != 0 && (flags & MFD_HUGETLB) == 0)
                return (EINVAL);
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to