Linux kernel mirror (for testing)
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel
os
linux
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef __LINUX_MEMFD_H
3#define __LINUX_MEMFD_H
4
5#include <linux/file.h>
6
7#ifdef CONFIG_MEMFD_CREATE
8extern long memfd_fcntl(struct file *file, unsigned int cmd, unsigned int arg);
9struct folio *memfd_alloc_folio(struct file *memfd, pgoff_t idx);
10#else
11static inline long memfd_fcntl(struct file *f, unsigned int c, unsigned int a)
12{
13 return -EINVAL;
14}
15static inline struct folio *memfd_alloc_folio(struct file *memfd, pgoff_t idx)
16{
17 return ERR_PTR(-EINVAL);
18}
19#endif
20
21#endif /* __LINUX_MEMFD_H */