函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:do_fcntl

函数原型:static long do_fcntl(int fd, unsigned int cmd, unsigned long arg, struct file *filp)

返回类型:long

参数:

类型参数名称
intfd
unsigned intcmd
unsigned longarg
struct file *filp
325  __userargp等于arg
327  err等于负EINVAL
330  :cmd恒等于F_DUPFD
331  err等于f_dupfd(arg, filp, 0)
332  退出
333  :cmd恒等于Create a file descriptor with FD_CLOEXEC set.
334  err等于f_dupfd(arg, filp, O_CLOEXEC)
335  退出
336  :cmd恒等于F_GETFD
337  err等于如果get_close_on_exec(fd)则FD_CLOEXEC否则0
338  退出
339  :cmd恒等于F_SETFD
340  err等于0
341  set_close_on_exec(fd, arg & FD_CLOEXEC)
342  退出
343  :cmd恒等于F_GETFL
344  err等于f_flags
345  退出
346  :cmd恒等于F_SETFL
347  err等于setfl(fd, filp, arg)
348  退出
353  :cmd恒等于F_GETLK
354  如果copy_from_user( & flock, argp, flock的长度)则返回:负EFAULT
356  err等于fcntl_getlk(filp, cmd, & flock)
357  如果非errcopy_to_user(argp, & flock, flock的长度)则返回:负EFAULT
359  退出
366  :cmd恒等于F_SETLK
367  :cmd恒等于F_SETLKW
368  如果copy_from_user( & flock, argp, flock的长度)则返回:负EFAULT
370  err等于fcntl_setlk(fd, filp, cmd, & flock)
371  退出
372  :cmd恒等于F_GETOWN
380  err等于f_getown(filp)
381  System call handlers that, upon successful completion, need to return a* negative value should call force_successful_syscall_return() right before* returning. On architectures where the syscall convention provides for a* separate error flag (e()
382  退出
383  :cmd恒等于F_SETOWN
384  err等于f_setown(filp, arg, 1)
385  退出
386  :cmd恒等于F_GETOWN_EX
387  err等于f_getown_ex(filp, arg)
388  退出
389  :cmd恒等于F_SETOWN_EX
390  err等于f_setown_ex(filp, arg)
391  退出
392  :cmd恒等于F_GETOWNER_UIDS
393  err等于f_getowner_uids(filp, arg)
394  退出
395  :cmd恒等于F_GETSIG
396  err等于 posix.1b rt signal to be delivered on IO
397  退出
398  :cmd恒等于F_SETSIG
401  退出
403  err等于0
404  posix.1b rt signal to be delivered on IO 等于arg
405  退出
406  :cmd恒等于F_GETLEASE
407  err等于获取当前文件租约
408  退出
409  :cmd恒等于F_SETLEASE
410  err等于设置打开文件租约
411  退出
412  :cmd恒等于Request nofications on a directory.* See below for events that may be notified.
413  err等于When a process calls fcntl to attach a dnotify watch to a directory it ends* up here. Allocate both a mark for fsnotify to add and a dnotify_struct to be* attached to the fsnotify_mark.
414  退出
415  :cmd恒等于Set and get of pipe page size array
416  :cmd恒等于F_GETPIPE_SZ
417  err等于pipe_fcntl(filp, cmd, arg)
418  退出
419  :cmd恒等于Set/Get seals
420  :cmd恒等于F_GET_SEALS
421  err等于memfd_fcntl(filp, cmd, arg)
422  退出
423  :cmd恒等于Set/Get write life time hints. {GET,SET}_RW_HINT operate on the* underlying inode, while {GET,SET}_FILE_RW_HINT operate only on* the specific file.
424  :cmd恒等于F_SET_RW_HINT
425  :cmd恒等于F_GET_FILE_RW_HINT
426  :cmd恒等于F_SET_FILE_RW_HINT
427  err等于fcntl_rw_hint(filp, cmd, arg)
428  退出
429  默认
430  退出
432  返回:err
调用者
名称描述
SYSCALL_DEFINE3
SYSCALL_DEFINE3
do_compat_fcntl64