in reply to O_RDWR and O_APPEND???

Did you import O_RDWR and O_APPEND? Your example code doesn't show this - and your "no warnings" is a red flag.