Updated with kripken's suggestions.
Fixes in pread()

The bug occurs when pread() doesn't return 0 when asked to read an
offset beyond its buffer.

This behavior is explicitly documented at:
http://pubs.opengroup.org/onlinepubs/000095399/functions/read.html

> If the starting position is at or after the end-of-file, 0
> shall be returned
Add stub for `glLogicOp` to prevent runtime exceptions.