fixes for non-GNU targets (eg.: solaris)