函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:NOTE! The user-level library version returns a* character pointer

函数原型:SYSCALL_DEFINE2(getcwd, char __user *, buf, unsigned long, size)

返回类型:

参数:

429  page等于__getname()
431  如果非page则返回:负ENOMEM
434  _read_lock() - mark the beginning of an RCU read-side critical section* When synchronize_rcu() is invoked on one CPU while other CPUs* are within RCU read-side critical sections, then the* synchronize_rcu() is guaranteed to block until after all the other
435  get_fs_root_and_pwd_rcu(fs, & root, & pwd)
437  error等于负ENOENT
438  如果非d_unlinked(dentry)则
440  cwd等于page# chars in a path name including nul
441  buflen等于# chars in a path name including nul
443  prepend( & cwd, & buflen, "\0", 1)
444  error等于prepend_path - Prepend path string to a buffer*@path: the dentry/vfsmount to report*@root: root vfsmnt/dentry*@buffer: pointer to the end of the buffer*@buflen: pointer to buffer length* The function will first try to write out the pathname without taking
445  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
447  如果error小于0则转到:out
451  如果error大于0则
452  error等于prepend_unreachable( & cwd, & buflen)
453  如果error则转到:out
457  error等于负ERANGE
458  len等于# chars in a path name including nul pagecwd
459  如果len小于等于size
460  error等于len
461  如果copy_to_user(buf, cwd, len)则error等于负EFAULT
464  否则
465  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
468  out :
469  __putname(page)
470  返回:error