joele23
asked on
IPC limit?
Is there a way to get past the 4096 char limit set for interprocess communication. I know that limits.h set PIPE_BUF to 4096 and I try to redefine it in my program but that doesnt seem to work.
Can someone tell me the work around?
Can someone tell me the work around?
I've played with pipes; many many frustrations due to the poorly-defined semantics.
I've spent days trying to get simple things to work, with lots of buggy behaviors.
I strongly suggest you switch over to a TCP/IP connection, it's far more straightforward, portable to other OS's, fast, reliable, documented... etc.. etc.. etc...
I've spent days trying to get simple things to work, with lots of buggy behaviors.
I strongly suggest you switch over to a TCP/IP connection, it's far more straightforward, portable to other OS's, fast, reliable, documented... etc.. etc.. etc...
ASKER
Well basically I have a program that calls a certain number of plugins (other programs) and needs to be able to get the output(stdout,stderr) from the plugins. Recently I noticed that when there was a large amount of data returned I was being cut off at 4096 chars.
I am currently using fork and pipe where I have the child execv the prog and the parent read in at the other end of the pipe unitl it gets the EOF. Which is fine unless theres more than 4096 chars.
I am currently using fork and pipe where I have the child execv the prog and the parent read in at the other end of the pipe unitl it gets the EOF. Which is fine unless theres more than 4096 chars.
did ulimit help ?
ASKER
I did
Warning: This routine is obsolete. The include file is no longer pro-
vided by glibc. Use getrlimit(2), setrlimit(2) and sysconf(3) instead.
For the shell command ulimit, see bash(1).
I checked the other calls out and could not see a way to change the pipe buf size.
As I keep looking, the only way I have actually found to do it is by recompiling the kernel with the limits changed but that really doesnt help since thats not an option.
I guess my other option would be to make all the plugins dynamically linked modules, which means a lot more work on progs already written. Any other options?
Warning: This routine is obsolete. The include file is no longer pro-
vided by glibc. Use getrlimit(2), setrlimit(2) and sysconf(3) instead.
For the shell command ulimit, see bash(1).
I checked the other calls out and could not see a way to change the pipe buf size.
As I keep looking, the only way I have actually found to do it is by recompiling the kernel with the limits changed but that really doesnt help since thats not an option.
I guess my other option would be to make all the plugins dynamically linked modules, which means a lot more work on progs already written. Any other options?
ulimit -p from shell was what I meant ... check man bash
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You can always create a buffering thread which will continuously monitor the pipe and store any available data in a buffer created by your program.
else you can try ulimit command with -p option to set the pipe buffer size ... man ulimit for more information