named pipe in native code?

567 views
Skip to first unread message

zeeshan

unread,
Feb 25, 2010, 9:41:06 AM2/25/10
to android-ndk
HI Dear,

i am trying to create a named pipe in my native code which i will
access in my java code
here is my sample code to create piple which doesn't work

---------------------------------------------------------------------------
#include <string.h>
#include <jni.h>
#include <unistd.h>
#include <sys/types.h>
#include <stdio.h>
#include <unistd.h>

/* This is a trivial JNI example where we use a native method
* to return a new VM String. See the corresponding Java source
* file located at:
*
* apps/samples/hello-jni/project/src/com/example/HelloJni/
HelloJni.java
*/
jstring
Java_com_example_hellojni_HelloJni_stringFromJNI( JNIEnv* env,
jobject thiz )
{

// mkfifo(const char* path, mode_t mode);
mkfifo("test_fifo", S_IRUSR );
return (*env)->NewStringUTF(env, "Hello JNI !");
}

------------------------------------------------------------------------------------

i have configured cygwin make with my eclipse and when it compiles
this program it gives me error at mkfifo as it doesn't know s_IRUSR

could anybody help me to figure out what is the problem and how can i
solve it

David Turner

unread,
Feb 25, 2010, 12:20:49 PM2/25/10
to andro...@googlegroups.com
Please do not cross-post.

You are missing a #include <sys/stat.h> I believe.


--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.


Reply all
Reply to author
Forward
0 new messages