tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

RE: In-kernel process exit hooks?



On Thu, 7 Jan 2016, Terry Moore wrote:

Will the hang occur if make dies due to a signal (control-C, or kill -9, for
example)?

It depends on which fd is numerically lower. If the /dev/filemon fd is lower, it will get closed first, which removes the reference to the log-file fd. If the log-file fd is numerically lower, it will get closed first, and will hang waiting for its reference count to clear.

In practice, I expect that make(1) will open /dev/filemon first, get an fd, and then open the log file and get another fd. The fd's are assigned on a first-free basis, so /dev/filemon gets the lower number, and no crash. But no guarantee, either!


+------------------+--------------------------+------------------------+
| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:      |
| (Retired)        | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com   |
| Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at netbsd.org |
+------------------+--------------------------+------------------------+


Home | Main Index | Thread Index | Old Index