By byteblend
via jinvoke.com
Published: Nov 16 2007 / 10:03
J/Invoke makes it easy to invoke UNIX/POSIX system calls from pure Java code.
In this developer scenario, we will be calling the 'stat' system call on Linux. The stat() function obtains information about the named file and returns it in a struct called stat defined in sys/stat.h.
We have chosen the stat() system call in this example because:
a) It is useful. Users have asked us how to call this
b) It is representative of other system calls, having struct arguments in addition to primitives, and
c) It has a slight twist - it is actually a macro that in turn calls another system call. This way we learn a little more about the trickier system calls/functions.
Add your comment