]> git.ipfire.org Git - thirdparty/man-pages.git/blobdiff - man2/memfd_create.2
fuse.4: ffix
[thirdparty/man-pages.git] / man2 / memfd_create.2
index e60f1aeca9f9a4ba84c6c27151f9ce35281dd53b..3cd392d1b4d915a0cf470880964af7d94fb04b3e 100644 (file)
 .\" <http://www.gnu.org/licenses/>.
 .\" %%%LICENSE_END
 .\"
-.TH MEMFD_CREATE 2 2017-09-15 Linux "Linux Programmer's Manual"
+.TH MEMFD_CREATE 2 2018-02-02 Linux "Linux Programmer's Manual"
 .SH NAME
 memfd_create \- create an anonymous file
 .SH SYNOPSIS
-.B #include <sys/memfd.h>
+.nf
+.BR "#define _GNU_SOURCE" "         /* See feature_test_macros(7) */"
+.B #include <sys/mman.h>
 .PP
 .BI "int memfd_create(const char *" name ", unsigned int " flags ");"
-.PP
-.IR Note :
-There is no glibc wrapper for this system call; see NOTES.
 .SH DESCRIPTION
 .BR memfd_create ()
 creates an anonymous file and returns a file descriptor that refers to it.
@@ -106,16 +105,16 @@ meaning that no other seals can be set on the file.
 The anonymous file will be created in the hugetlbfs filesystem using
 huge pages.
 See the Linux kernel source file
-.I Documentation/vm/hugetlbpage.txt
+.I Documentation/admin-guide/mm/hugetlbpage.rst
 for more information about hugetlbfs.
-The hugetlbfs filesystem does not support file-sealing operations.
-Therefore, specifying both
+.\" commit 47b9012ecdc747f6936395265e677d41e11a31ff
+Specifying both
 .B MFD_HUGETLB
 and
 .B MFD_ALLOW_SEALING
 in
 .I flags
-is disallowed.
+is supported since Linux 4.16.
 .TP
 .BR MFD_HUGE_2MB ", " MFD_HUGE_1GB ", " "..."
 Used in conjunction with
@@ -124,7 +123,7 @@ to select alternative hugetlb page sizes (respectively, 2\ MB, 1\ GB, ...)
 on systems that support multiple hugetlb page sizes.
 Definitions for known
 huge page sizes are included in the header file
-.I <sys/memfd.h>.
+.I <linux/memfd.h>.
 .IP
 For details on encoding huge page sizes not included in the header file,
 see the discussion of the similarly named constants in
@@ -206,8 +205,6 @@ The
 .BR memfd_create ()
 system call is Linux-specific.
 .SH NOTES
-Glibc does not provide a wrapper for this system call; call it using
-.BR syscall (2).
 .PP
 .\" See also http://lwn.net/Articles/593918/
 .\" and http://lwn.net/Articles/594919/ and http://lwn.net/Articles/591108/
@@ -401,7 +398,8 @@ Existing seals: WRITE SHRINK
 .SS Program source: t_memfd_create.c
 \&
 .EX
-#include <sys/memfd.h>
+#define _GNU_SOURCE
+#include <sys/mman.h>
 #include <fcntl.h>
 #include <stdlib.h>
 #include <unistd.h>
@@ -483,7 +481,8 @@ main(int argc, char *argv[])
 .SS Program source: t_get_seals.c
 \&
 .EX
-#include <sys/memfd.h>
+#define _GNU_SOURCE
+#include <sys/mman.h>
 #include <fcntl.h>
 #include <unistd.h>
 #include <stdlib.h>