I was assuming a signal model, where your user-space program receives a signal when an exec occurs. Multiple exec's will result in only 1 signal posted to your process. If multiple exec's occurred before your process had a chance to run you can't distinguish between 1 or 20 exec's - you get only 1 signal.
A model where you create a queue of exec'd process names could work, and a signal could be used to notify you that data is available in the queue. You'd read the entire queue. Alternate methods could be employed (you could create a driver, which allows your user-space app to select/poll/epoll awaiting data to accumulate.
The key point to these implementations is your process receives "notifications" only *when* it is actually running on the processor, and the notifications may be single notify, multiple execs.
Consider, by defintition, when an exec occurs, it is some *other* process that is running at that moment, not your process, which is likely sleeping.
|