

![]() | Start a set with this search |
![]() | Include this search in one of my sets |
![]() | Exclude this search from one of my sets |
![]() | Permalink to these results Paste this link in email or IM: |
| Atom feed for tracking future search results Paste this URL into your reader: |
19 messages in net.java.dev.jna.usersstat() not mapping on Linux for me...| From | Sent On | Attachments |
|---|---|---|
| Thomas Enebo | Nov 26, 2007 11:00 am | |
| Timothy Wall | Nov 26, 2007 1:07 pm | |
| Timothy Wall | Nov 26, 2007 1:58 pm | |
| Thomas E Enebo | Nov 27, 2007 8:36 am | |
| Timothy Wall | Nov 27, 2007 9:16 am | |
| Glick, Gene (GE Indust, Security) | Nov 27, 2007 12:45 pm | |
| Stephen Connolly | Nov 27, 2007 3:18 pm | |
| Glick, Gene (GE Indust, Security) | Nov 28, 2007 6:16 am | |
| Timothy Wall | Nov 28, 2007 9:15 am | |
| Glick, Gene (GE Indust, Security) | Nov 28, 2007 11:37 am | |
| Glick, Gene (GE Indust, Security) | Nov 28, 2007 11:59 am | |
| Glick, Gene (GE Indust, Security) | Nov 28, 2007 12:05 pm | |
| Timothy Wall | Nov 28, 2007 12:05 pm | |
| Wayne Meissner | Nov 28, 2007 7:59 pm | |
| Glick, Gene (GE Indust, Security) | Nov 29, 2007 6:43 am | |
| Nikolas Lotz | Nov 29, 2007 7:41 am | |
| Glick, Gene (GE Indust, Security) | Nov 30, 2007 9:05 am | |
| Timothy Wall | Nov 30, 2007 11:13 am | |
| Glick, Gene (GE Indust, Security) | Nov 30, 2007 11:56 am |

![]() | Permalink for this message Paste this link in email or IM: |
![]() | Permalink for this thread Paste this link in email or IM: |
| Atom feed for this thread Paste this URL into your reader: |
| Subject: | stat() not mapping on Linux for me... | Actions... |
|---|---|---|
| From: | Thomas Enebo (Thom...@Sun.COM) | |
| Date: | Nov 26, 2007 11:00:30 am | |
| List: | net.java.dev.jna.users | |
Hello,
I am a developer on the JRuby project and I have gotten stat/lstat mapped on MacOS. I have tried running against Linux FC5 (yeah pretty old) and I get the following error:
Exception in thread "main" java.lang.UnsatisfiedLinkError: Cannot locate function 'stat' at com.sun.jna.NativeLibrary.getFunctionAddress(NativeLibrary.java:200) at com.sun.jna.Function.<init>(Function.java:106) at com.sun.jna.NativeLibrary.getFunction(NativeLibrary.java:187) at com.sun.jna.Library$Handler.invoke(Library.java:155) at $Proxy0.stat(Unknown Source) at org.jruby.Ruby.getPosixStat(Ruby.java:2498) at org.jruby.RubyFileStat.setup(RubyFileStat.java:96) ...
Like I said this is working on MacOS and the library did appear to load, but does not appear to think this signature of stat exists.
Here is my Library and Structure defs (some extra stuff omitted for brevity): public interface POSIX extends Library { public static class FileStat extends Structure { public int st_dev; // device inode resides on (dev_t) public int st_ino; // inode's number (ino_t) public short st_mode; // inode protection mode (mode_t - uint16) public short st_nlink; // number or hard links to the file (nlink_y - uint16) public int st_uid; // user-id of owner (uid_t) public int st_gid; // group-id of owner (gid_t) public int st_rdev; // device type, for special file inode (st_rdev - dev_t) public int st_atime; // Time of last access (time_t) public int st_atimensec; // Time of last access (nanoseconds) public int st_mtime; // Last data modification time (time_t) public int st_mtimensec; // Last data modification time (nanoseconds) public int st_ctime; // Time of last status change (time_t) public int st_ctimensec; // Time of last status change (nanoseconds) public long st_size; // file size, in bytes public long st_blocks; // blocks allocated for file public int st_blksize; // optimal file system I/O ops blocksize public int st_flags; // user defined flags for file public int st_gen; // file generation number public int st_lspare; // RESERVED: DO NOT USE! public long[] st_qspare; // RESERVED: DO NOT USE! .... }
public int chmod(String filename, int mode); public int chown(String filename, int user, int group); public int getegid(); public int geteuid(); public int getgid(); public int getpgid(); public int getpgrp(); public int getppid(); public int getpid(); public int getuid(); public int lchmod(String filename, int mode); public int lchown(String filename, int user, int group); public int link(String oldpath,String newpath); public int lstat(String path, FileStat stat); public int stat(String path, FileStat stat); public int symlink(String oldpath,String newpath); }
Code which loads library:
boolean isWindows = System.getProperty("os.name").startsWith("Windows"); POSIX posix = (POSIX) Native.loadLibrary(isWindows ? "msvcrt" : "c", POSIX.class, options);
Any ideas? It seems like stat() should be a part of libc...
So far I am loving JNA...
-Tom
P.S. - When is JNA3 being released? :)
-- Thomas E Enebo <thom...@sun.com> JRuby Core Developer, http://www.bloglines.com/blog/ThomasEEnebo







