Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:ksys_dup3

Proto:static int ksys_dup3(unsigned int oldfd, unsigned int newfd, int flags)

Type:int

Parameter:

TypeParameterName
unsigned intoldfd
unsigned intnewfd
intflags
911  err = -EBADF
913  files = files
915  If (flags & ~O_CLOEXEC) != 0 Then Return -EINVAL
918  If Value for the false possibility is greater at compile time(oldfd == newfd) Then Return -EINVAL
921  If newfd >= rlimit(RLIMIT_NOFILE) Then Return -EBADF
924  spin_lock( & written part on a separate cache line in SMP)
925  err = Expand files.* This function will expand the file structures, if the requested size exceeds* the current capacity and there is room for expansion.* Return <0 error code on error; 0 when nothing done; 1 when files were
926  file = Check whether the specified fd has an open file.(oldfd)
927  If Value for the false possibility is greater at compile time(!file) Then Go to Ebadf
929  If Value for the false possibility is greater at compile time(err < 0) Then
930  If err == -EMFILE Then Go to Ebadf
932  Go to out_unlock
934  Return do_dup2(files, file, newfd, flags)
936  Ebadf :
937  err = -EBADF
938  out_unlock :
939  spin_unlock( & written part on a separate cache line in SMP)
940  Return err
Caller
NameDescribe
SYSCALL_DEFINE3
SYSCALL_DEFINE2