Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:ksys_getdents64

Proto:int ksys_getdents64(unsigned int fd, struct linux_dirent64 __user *dirent, unsigned int count)

Type:int

Parameter:

TypeParameterName
unsigned intfd
struct linux_dirent64 __user *dirent
unsigned intcount
357  struct getdents_callback64 buf = {actor = filldir64, count = count, current_dir = dirent}
364  If Not access_ok - Checks if a user space pointer is valid*@addr: User space pointer to start of block to check*@size: Size of block to check* Context: User context only. This function may sleep if pagefaults are* enabled.(dirent, count) Then Return -EFAULT
367  f = fdget_pos(fd)
368  If Not file Then Return -EBADF
371  error = iterate_dir(file, & ctx)
372  If error >= 0 Then error = error
374  If prev_reclen Then
375  __user * lastdirent
376  d_off = pos
378  lastdirent = current_dir - prev_reclen
379  If Write a simple value into user space, with less checking(d_off, & d_off) Then error = -EFAULT
381  Else error = count - count
384  fdput_pos(f)
385  Return error
Caller
NameDescribe
SYSCALL_DEFINE3