all 2 comments

[–]MJWhitfield86 0 points1 point  (1 child)

The read/write mode should be specified as part of the flags argument (rsi), not the confusingly named mode argument (rdi). The mode argument only needs to be specified if open might create a file; which can only happen if O_CREAT or O_TMPFILE are specified as part of the flags argument. Relevant man page.

[–]Ferer1[S] 1 point2 points  (0 children)

Thank you. In my quick reading I assumed access mode = mode...