title: JNA causes UnsatisfiedLinkException with Unix Stat
body: <p>So, I'm attempting to call the Linux C - stat function. </p>
  
  <p>My JNA code: </p>
  
  <pre><code>    public int stat(bap path, bap statdump);
  </code></pre>
  
  <p>the bap class: </p>
  
  <pre><code>public static class bap extends Structure {
  
      public byte[] array;
  
      public bap(int size) {
          array = new byte[size];
      }
  
      @Override
      protected List getFieldOrder() {
          return Arrays.asList(new String[]{"array"});
      }
  
  }
  </code></pre>
  
  <p>Which, while nasty, performs as a byte array pointer for many other functions successfully.
  What I think the problem is, is here: <code>int stat(const char *restrict path, struct stat *restrict buf);</code>, as defined by <a href="http://linux.die.net/man/3/stat" rel="nofollow">http://linux.die.net/man/3/stat</a></p>
  
  <p>How do I pass a constant char array, and what does the *restrict mean? I attempted to google, but I don't think it liked * in the search query, as nothing was relevant.</p>
  
  <p>EDIT: full exception</p>
  
  <pre><code>Exception in thread "main" java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:      43)
      at java.lang.reflect.Method.invoke(Method.java:497)
      at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
  Caused by: java.lang.UnsatisfiedLinkError: Error looking up function 'stat': java: undefined       symbol: stat
      at com.sun.jna.Function.&lt;init&gt;(Function.java:208)
      at com.sun.jna.NativeLibrary.getFunction(NativeLibrary.java:536)
      at com.sun.jna.NativeLibrary.getFunction(NativeLibrary.java:513)
      at com.sun.jna.NativeLibrary.getFunction(NativeLibrary.java:499)
      at com.sun.jna.Library$Handler.invoke(Library.java:199)
      at com.sun.proxy.$Proxy0.stat(Unknown Source)
  </code></pre>