title: Windows Linux compatibility layer. Function not implemented?
body: <p><strong>ORIGINAL:</strong></p>
  <p>I've been trying to implement a basic shared memory program using the Windows Subsystem for Linux (aka Bash on Ubuntu on Windows). Here is the code I wrote:</p>
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;string.h&gt;
  #include &lt;signal.h&gt;
  #include &lt;sys/types.h&gt;
  #include &lt;sys/ipc.h&gt;
  #include &lt;sys/shm.h&gt;
  
  #define KEY 1374
  
  int shmid;
  char *dataPtr;
  
  int main (void) {
      shmid = shmget((key_t)KEY,1024, IPC_CREAT | 0666);
      dataPtr = shmat(shmid, (void*)0,0);
      if(dataPtr == (char*)(-1))
          perror(&quot;shmat error&quot;);
      strcpy(dataPtr,&quot;test&quot;);
      sleep(10);
      shmdt(dataPtr);
      shmctl(shmid, IPC_RMID, NULL);
  }
  </code></pre>
  <p>I compiled it with GCC without any error or warning, but when I tried to run it, I got this error message:</p>
  <blockquote>
  <p>shmat error: Function not implemented</p>
  <p>Segmentation fault (core dumped)</p>
  </blockquote>
  <p>I tried to get to the bottom of this error, but when I googled it, I
  <a href="https://i.stack.imgur.com/rYe04.jpg" rel="nofollow noreferrer">literally got nothing</a>.</p>
  <p>So the question is: did I horribly messed-up something very simple, or is it possible that the shared-memory system isn't implemented on &quot;Ubuntu on Windows&quot;?</p>
  <p><strong>EDIT:</strong></p>
  <p>I tried to run my code on my faculty's linux server, and it worked fine. So apparently the problem is with the Bash on Ubuntu on Windows system. The shared-memory system probably isn't implemented at all.</p>