

![]() | 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: |
4 messages in net.java.dev.jna.usersRe: [jna-users] Unable to link to sta...| From | Sent On | Attachments |
|---|---|---|
| Kevin Burton | Mar 25, 2009 5:39 pm | |
| Daniel Kaufmann | Mar 25, 2009 6:00 pm | |
| Kevin Burton | Mar 25, 2009 7:09 pm | |
| Kevin Burton | Mar 25, 2009 7:15 pm |

![]() | 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: | Re: [jna-users] Unable to link to stat..... | Actions... |
|---|---|---|
| From: | Daniel Kaufmann (dani...@gmail.com) | |
| Date: | Mar 25, 2009 6:00:53 pm | |
| List: | net.java.dev.jna.users | |
This has being previously posted on the list. Please check this thread: https://jna.dev.java.net/servlets/ReadMsg?list=users&msgNo=712
Regards, Daniel
On Wed, Mar 25, 2009 at 8:39 PM, Kevin Burton <bur...@spinn3r.com> wrote:
OK.... I'm currently running into this bug.
On OS X I have a stat() function which works. It doesn't work on Linux.
Exception in thread "main" java.lang.UnsatisfiedLinkError: Error looking up function 'stat': /lib/libc.so.6: undefined symbol: stat at com.sun.jna.Function.<init>(Function.java:129) at com.sun.jna.NativeLibrary.getFunction(NativeLibrary.java:250) at com.sun.jna.Library$Handler.invoke(Library.java:191) at posix.$Proxy0.stat(Unknown Source) at posix.stat.stat(stat.java:184) at posix.Example.main(Example.java:23)
..... I'm working on a posix compat library to call some important posix functions.
This on is mkfifo + stat (stat is needed to verify that it IS a fifo).
Here's what my code looks like:
private static StatInterface delegate = (StatInterface)Native.loadLibrary( "c", StatInterface.class);
public static class StatStructure extends Structure {
public long st_dev; /* ID of device containing file */ public long st_ino; /* inode number */ public long st_mode; /* protection */ public long st_nlink; /* number of hard links */ public long st_uid; /* user ID of owner */ public long st_gid; /* group ID of owner */ public long st_rdev; /* device ID (if special file) */ public long st_size; /* total size, in bytes */ public long st_blksize; /* blocksize for filesystem I/O */ public long st_blocks; /* number of blocks allocated */ public long st_atime; /* time of last access */ public long st_mtime; /* time of last modification */ public long st_ctime; /* time of last status change */
}
public static int stat(String path, stat.StatStructure stat ) { return delegate.stat( path, stat ); }
}
interface StatInterface extends Library {
int mkfifo( String pathname, int mode_t ); int unlink( String path ); int chmod( String path, int mode_t ); int stat( String path, stat.StatStructure stat ); }
-- Founder/CEO Spinn3r.com Location: San Francisco, CA AIM/YIM: sfburtonator Skype: burtonator Work: http://spinn3r.com







