LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   how does java calls the system calls which are written in c (http://www.linuxquestions.org/questions/linux-general-1/how-does-java-calls-the-system-calls-which-are-written-in-c-628846/)

babu198649 03-18-2008 01:55 AM

how does java calls the system calls which are written in c
 
hi
how does the java calls the system calls which are written in c.
in general how does a program written in one language can be combined with the other.

jainforall 03-18-2008 02:30 AM

Hi,
I don't thinks so that you can call system call directly from java.
But you can use Java Native Interface (JNI).
To call a system call you'll have to write a small C/C++ program, that
will invoke the system call. This program you will use in Java.
For more information goto
http://java.sun.com/developer/online.../jniexamp.html

babu198649 03-20-2008 05:05 AM

hi
i am really intrested in knowing how two different languages interact.i have seen the link it has api's for calling sys calls. but how does they have made the api's.

NevemTeve 12-05-2011 04:40 AM

It really doesn't matter what language is the kernel written in -- you can use system-calls from any language, provided you fill the registers properly.


All times are GMT -5. The time now is 10:54 PM.