encapsulate fcntl