use a portable way for finding the pids.