minor improvement with posix calls