mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
fs/proc: report PID-s from a pid namespace of the proc mount
Right now, we can find more than one process with the 1 PID in /proc. $ for i in `seq 10`; do > unshare -fp sleep 1000 & > done $ ls /proc 1 1 1 1 12 18 24 29 6 loadavg net sys version 1 1 1 1 16 20 26 32 cpuinfo meminfo self thread-self 1 1 1 1 17 21 28 36 filesystems mounts stat uptime PiperOrigin-RevId: 272506593
This commit is contained in:
@@ -230,7 +230,7 @@ func (rpf *rootProcFile) Readdir(ctx context.Context, file *fs.File, ser fs.Dent
|
||||
// But for whatever crazy reason, you can still walk to the given node.
|
||||
for _, tg := range rpf.iops.pidns.ThreadGroups() {
|
||||
if leader := tg.Leader(); leader != nil {
|
||||
name := strconv.FormatUint(uint64(tg.ID()), 10)
|
||||
name := strconv.FormatUint(uint64(rpf.iops.pidns.IDOfThreadGroup(tg)), 10)
|
||||
m[name] = fs.GenericDentAttr(fs.SpecialDirectory, device.ProcDevice)
|
||||
names = append(names, name)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user