Optimize Posix calls.
Merge pull request #132 from ForNeVeR/posix-optimization

POSIX calls optimization