Quoting the man page for open():
The argument flags must include one of the following access modes: O_RDONLY, O_WRONLY, or O_RDWR. These request opening the file read-only, write-only, or read/write, respectively.
Which your open call clearly doesn't follow. So add O_WRONLY or O_RDWR to your options.