Link Details

Link 52791 thumbnail
User 239704 avatar

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.
  • 10
  • 2
  • 3390
  • 771

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Voters For This Link (10)



Voters Against This Link (2)