title: sem_open - valgrind complains about uninitialised bytes
body: <p>I have a trivial program:
  </p>
  
  <pre><code>int main(void)
  {
    const char sname[]="xxx";
    sem_t *pSemaphor;
    if ((pSemaphor = sem_open(sname, O_CREAT, 0644, 0)) == SEM_FAILED) {
      perror("semaphore initilization");
      exit(1);
    }
    sem_unlink(sname);
    sem_close(pSemaphor);
  }
  </code></pre>
  
  <p>When I run it under valgrind, I get the following error:</p>
  
  <pre><code>==12702== Syscall param write(buf) points to uninitialised byte(s)
  ==12702==    at 0x4E457A0: __write_nocancel (syscall-template.S:81)
  ==12702==    by 0x4E446FC: sem_open (sem_open.c:245)
  ==12702==    by 0x4007D0: main (test.cpp:15)
  ==12702==  Address 0xfff00023c is on thread 1's stack
  ==12702==  in frame #1, created by sem_open (sem_open.c:139)
  </code></pre>
  
  <p>The code was extracted from a bigger project where it ran successfully for years, but now it is causing segmentation fault.</p>
  
  <p>The valgrind error from my example is the same as seen in the bigger project, but there it causes a crash, which my small example doesn't.</p>