--- - branch: netbsd-8 date: Sun Apr 1 08:45:43 UTC 2018 files: - new: 1.206.6.2 old: 1.206.6.1 path: src/sys/kern/kern_proc.c pathrev: src/sys/kern/kern_proc.c@1.206.6.2 type: modified id: 20180401T084543Z.f3fa6036e75726ad67dc7830ed024056e164ebba log: "Pull up following revision(s) (requested by kamil in ticket #679):\n\n\tsys/kern/kern_proc.c: revision 1.211\n\nMake sysctl_doeproc() more predictable\n\nSwap the order of looking into zombie and all process lists, start now\nwith the zombie one. This prevents a race observed previously that the\nsame process could be detected on both lists during a single polling call.\n\nWhile there:\n - Short-circuit break for KERN_PROC_PID, once a pid has been detected.\n - Removal of redundant \"if (kbuf)\" and \"if (marker)\" checks.\n - Update of comments regarding potential optimization, explaining why we\n don't want to it as of now. Performance gain from lookup call vs\n iteration over a list is neglible on a regular system.\n - Return ESRCH when no results have been found. This allows more easily\n to implement a retry or abandon algorithm.\n\nThis corrects races observed in the existing ATF ptrace(2) tests, related\nto await_zombie(). This function was expecting to check whether a process\nhas been transformed into a zombie, however it was causing occasional\ncrashes as it was overflowing the return buffer, returning the same pid\ntwice: once from allproc list and the second time from zombieproc one.\n\nFix suggested by \nShort-circuit break suggested by \n\nDiscussed on tech-kern.\n\nSponsored by \n" module: src subject: 'CVS commit: [netbsd-8] src/sys/kern' unixtime: '1522572343' user: martin