0

I am reading a bug fix in an OpenSource project. There was a fix related with enabling larger shared memory region. I don't understand this fix here. Could anyone explain what's the difference between those two statements?

Old: if (-1 == (buf->id = open(buf->seg_name, O_CREAT | O_RDWR, 0600))) { New: if (-1 == (buf->id = open(buf->seg_name, O_RDWR))) { 

Thanks!

Please let me know if you need more info.

1
  • 1
    What has become of the fine art of reading the open(2) manual page? Commented Oct 24, 2014 at 21:50

1 Answer 1

2

The new code will insist on the file named by buff->seg_name to exist, while the old code (attempts to) create it with permission 0600 if it doesn't.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.