Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\userfaultfd.c Create Date:2022-07-28 20:20:37
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:serland asks for a certain API version and we return which bits* and ioctl commands are implemented in this kernel for such API* version or -EINVAL if unknown.

Proto:static int userfaultfd_api(struct userfaultfd_ctx *ctx, unsigned long arg)

Type:int

Parameter:

TypeParameterName
struct userfaultfd_ctx *ctx
unsigned longarg
1827  __user * buf = arg
1831  ret = -EINVAL
1832  If state machine != UFFD_STATE_WAIT_API Then Go to out
1834  ret = -EFAULT
1835  If copy_from_user( & uffdio_api, buf, size of uffdio_api ) Then Go to out
1837  features = features
1838  ret = -EINVAL
1839  If userland asks for an API number and the features to enable != If the UFFDIO_API is upgraded someday, the UFFDIO_UNREGISTER and* UFFDIO_WAKE ioctls should be defined as _IOW and not as _IOR. In* userfaultfd.h we assumed the kernel was reading (instead _IOC_READ* means the userland is reading). || features & ~UFFD_API_FEATURES Then Go to err_out
1841  ret = -EPERM
1842  If features & UFFD_FEATURE_EVENT_FORK && Not Check operation authority Then Go to err_out
1845  features = UFFD_API_FEATURES
1846  ioctls = UFFD_API_IOCTLS
1847  ret = -EFAULT
1848  If copy_to_user(buf, & uffdio_api, size of uffdio_api ) Then Go to out
1850  state machine = UFFD_STATE_RUNNING
1852  atures requested from the userspace = uffd_ctx_features(features)
1853  ret = 0
1854  out :
1855  Return ret
1856  err_out :
1857  memset( & uffdio_api, 0, size of uffdio_api )
1858  If copy_to_user(buf, & uffdio_api, size of uffdio_api ) Then ret = -EFAULT
1860  Go to out
Caller
NameDescribe
userfaultfd_ioctl