system based implementation of posixSysWhich