Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:NOTE! The user-level library version returns a* character pointer

Proto:SYSCALL_DEFINE2(getcwd, char __user *, buf, unsigned long, size)

Type:

Parameter:Nothing

429  page = __getname()
431  If Not page Then Return -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  If Not d_unlinked(dentry) Then
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  If error < 0 Then Go to out
451  If error > 0 Then
453  If error Then Go to out
457  error = -ERANGE
458  len = # chars in a path name including nul + page - cwd
459  If len <= size Then
460  error = len
461  If copy_to_user(buf, cwd, len) Then error = -EFAULT
464  Else
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  Return error