(pid *pid, isThread bool, nonBlock bool)
| 107 | } |
| 108 | |
| 109 | func (t *Task) pidFDOpen(pid *pid, isThread bool, nonBlock bool) (*vfs.FileDescription, error) { |
| 110 | f := &pidFD{ |
| 111 | isThread: isThread, |
| 112 | pid: pid, |
| 113 | } |
| 114 | |
| 115 | vd := t.Kernel().VFS().NewAnonVirtualDentry("[pidfd]") |
| 116 | defer vd.DecRef(t) |
| 117 | var flags uint32 |
| 118 | if nonBlock { |
| 119 | flags |= linux.O_NONBLOCK |
| 120 | } |
| 121 | |
| 122 | err := f.vfsFD.Init(f, flags, t.Credentials(), vd.Mount(), vd.Dentry(), &vfs.FileDescriptionOptions{ |
| 123 | UseDentryMetadata: true, |
| 124 | }) |
| 125 | if err != nil { |
| 126 | return nil, err |
| 127 | } |
| 128 | return &f.vfsFD, nil |
| 129 | } |
| 130 | |
| 131 | // PIDFDGetFD helps implement the Linux syscall pidfd_getfd(2). |
| 132 | func (t *Task) PIDFDGetFD(pidfd int32, targetfd int32, flags uint32) (uintptr, error) { |
no test coverage detected