Discussion:
having problem with mkfifo I/O operations in android
(too old to reply)
Shahriar Vaghar
2018-09-08 16:40:35 UTC
Permalink
Hello,

Please direct me to the right group if this not right one.

I am using named pipe for inter-process communication in my native
processes on android arm 64 (version > 24).

I use mkfifo to create the named pipe successfully. I set the size of the
pipe to 264KB.

The problems is the writer side reports EAGAIN (11) after writing less than
10KB in to the pipe and can never recover from the error.

aec_fd = open(pipe_name, O_WRONLY | O_SYNC | O_NONBLOCK);


pipeFD = open(pipe_name, O_RDONLY);

bytes_wrote = write(aec_fd, buffer, bytes);


Why the pipe overflows so fast? How do you recover from it?



Best regards, Shahriar
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk+***@googlegroups.com.
To post to this group, send email to android-***@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/9a5577d9-c624-405d-ae65-a461782bf1e4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
'Dan Albert' via android-ndk
2018-09-08 17:47:24 UTC
Permalink
EAGAIN doesn't mean the pipe is full, it means the operation was
interrupted. Use TEMP_FAILURE_RETRY.
Post by Shahriar Vaghar
Hello,
Please direct me to the right group if this not right one.
I am using named pipe for inter-process communication in my native
processes on android arm 64 (version > 24).
I use mkfifo to create the named pipe successfully. I set the size of the
pipe to 264KB.
The problems is the writer side reports EAGAIN (11) after writing less
than 10KB in to the pipe and can never recover from the error.
aec_fd = open(pipe_name, O_WRONLY | O_SYNC | O_NONBLOCK);
pipeFD = open(pipe_name, O_RDONLY);
bytes_wrote = write(aec_fd, buffer, bytes);
Why the pipe overflows so fast? How do you recover from it?
Best regards, Shahriar
--
You received this message because you are subscribed to the Google Groups
"android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit
https://groups.google.com/d/msgid/android-ndk/9a5577d9-c624-405d-ae65-a461782bf1e4%40googlegroups.com
<https://groups.google.com/d/msgid/android-ndk/9a5577d9-c624-405d-ae65-a461782bf1e4%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk+***@googlegroups.com.
To post to this group, send email to android-***@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/CAFVaGhv%3D9N2%3DYQbt9kYPUg54dY-iPY%3DaPNoMnrL6SSi19xcgTQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Shahriar Vaghar
2018-09-08 22:48:35 UTC
Permalink
Hi

Thanks for the suggestion. I'll try that.

To give you more information about my problem

In normal runtime condition, write returns EAGAIN after a while several minutes.

But to find out why, I tested by not reading from the pipe. Write returns EAGAIN after 6 writes of 1K buffer.
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk+***@googlegroups.com.
To post to this group, send email to android-***@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/4e9a317a-b709-4d1c-b845-bac3cdc418b4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...