函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\userfaultfd.c Create Date:2022-07-29 10:52:42
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称: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.

函数原型:static int userfaultfd_api(struct userfaultfd_ctx *ctx, unsigned long arg)

返回类型:int

参数:

类型参数名称
struct userfaultfd_ctx *ctx
unsigned longarg
1827  __userbuf等于arg
1831  ret等于负EINVAL
1832  如果state machine 不等于UFFD_STATE_WAIT_API则转到:out
1834  ret等于负EFAULT
1835  如果copy_from_user( & uffdio_api, buf, uffdio_api的长度)则转到:out
1837  features等于features
1838  ret等于负EINVAL
1839  如果 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的反则转到:err_out
1841  ret等于负EPERM
1842  如果features按位与UFFD_FEATURE_EVENT_FORK且非操作权限检查则转到:err_out
1845  features等于UFFD_API_FEATURES
1846  ioctls等于UFFD_API_IOCTLS
1847  ret等于负EFAULT
1848  如果copy_to_user(buf, & uffdio_api, uffdio_api的长度)则转到:out
1850  state machine 等于UFFD_STATE_RUNNING
1852  atures requested from the userspace 等于uffd_ctx_features(features)
1853  ret等于0
1854  out :
1855  返回:ret
1856  err_out :
1857  memset( & uffdio_api, 0, uffdio_api的长度)
1858  如果copy_to_user(buf, & uffdio_api, uffdio_api的长度)则ret等于负EFAULT
1860  转到:out
调用者
名称描述
userfaultfd_ioctl