• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 382
  • Last Modified:

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?
0
joele23
Asked:
joele23
1 Solution
 
sunnycoderCommented:
What are you trying to do?

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
0
 
grg99Commented:
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...

0
 
joele23Author Commented:
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.

 
0
Worried about phishing attacks?

90% of attacks start with a phish. It’s critical that IT admins and MSSPs have the right security in place to protect their end users from these phishing attacks. Check out our latest feature brief for tips and tricks to keep your employees off a hackers line!

 
sunnycoderCommented:
did ulimit help ?
0
 
joele23Author Commented:
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?
0
 
sunnycoderCommented:
ulimit -p from shell was what I meant ... check man bash
0
 
moduloCommented:
PAQed with points refunded (75)

modulo
Community Support Moderator
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Firewall Management 201 with Professor Wool

In this whiteboard video, Professor Wool highlights the challenges, benefits and trade-offs of utilizing zero-touch automation for security policy change management. Watch and Learn!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now