Implement "hijackSystemCalls" as a higher-order function