title: How to use statx syscall?
body: <p><code>Ubuntu 18.04</code></p>
  
  <p>I'm trying to use <code>statx</code> syscall introduced in the Linux Kernel <code>4.11</code>. There is a manual entry:</p>
  
  <pre><code>#include &lt;sys/types.h&gt;
  #include &lt;sys/stat.h&gt;
  #include &lt;unistd.h&gt;
  #include &lt;fcntl.h&gt;           /* Definition of AT_* constants */
  
  int statx(int dirfd, const char *pathname, int flags,
               unsigned int mask, struct statx *statxbuf);
  </code></pre>
  
  <p>So I tried to write an example by myself:</p>
  
  <pre><code>const char *dir_path = NULL;
  const char *file_path = NULL;
  //read from command line arguments
  int dir_fd = open(dir_path, O_DIRECTORY);
  
  struct statx st; //&lt;--------------------------- compile error
  statx(dir_fd, file_path, 0, &amp;statx);
  </code></pre>
  
  <p>But it simply does not compile. The error is the <code>sizeof(statx)</code> is unknown. And actually it is not defined in <code>sys/stat.h</code>, but in <code>linux/stat.h</code> which is not included by <code>sys/stat.h</code>. But after including <code>linux/stat.h</code> the problem is there is no definition for</p>
  
  <pre><code>int statx(int dirfd, const char *pathname, int flags,
               unsigned int mask, struct statx *statxbuf);
  </code></pre>
  
  <p>I expected that since</p>
  
  <pre><code>$ uname -r
  4.15.0-39-generic
  </code></pre>
  
  <p>and 4.15.0-39-generic newer than 4.11 I can use it.</p>
  
  <p>What's wrong?</p>