Similar to what we introduced for Cray's CLE in #1416, but more general, in order to cover other OSes.