UNIX Socket FAQ

A forum for questions and answers about network programming on Linux and all other Unix-like systems

You are not logged in.

#1 2009-05-20 03:46 PM

jacquesdirac
Member
Registered: 2009-02-06
Posts: 15

Re: FIFO size changed

Hi,

In the kernel source I have adjusted the size of the FIFOs (named pipes):

/include/linux/pipe_fs_i.h

...
#define PIPE_SIZE 8192 // used to be PAGE_SIZE (4096)
...

Now when I read from the pipe (using the read function in a C program) and the pipe contains > 4096 bytes, my process crashes and gives a Segmentation Fault.

Could someone help me on this?


Thanks in advance!

Offline

#2 2009-05-20 09:06 PM

RobSeace
Administrator
From: Boston, MA
Registered: 2002-06-12
Posts: 3,826
Website

Re: FIFO size changed

Searching my local kernel source, I can't find any code that references that macro
at all...  The only mention I can find is its definition in that header file you mention...
So, unless I'm missing something, I'd not expect changing it to do a damn thing!
Maybe your kernel source differs from mine...  What version is it?  And, did you
change anything else anywhere on the system?

But, why are you trying to change it, anyway?  What exactly are you trying to do?
Increase the pipe buffer space?  On my system (2.6.18, RHEL/CentOS modified),
there are actually 16 pages (64K) for each pipe buffer...  This is controlled by
PIPE_BUFFERS defined in that same header file; and PIPE_SIZE seems to be
completely unused for anything, as I said...

Offline

#3 2009-05-23 03:28 PM

fpmurphy
Member
From: /dev/fl
Registered: 2009-04-22
Posts: 2

Re: FIFO size changed

look at linux-2.6.8/fs/pipe.c.  PIPE_SIZE is used there.

Offline

#4 2009-05-23 04:37 PM

i3839
Oddministrator
From: Amsterdam
Registered: 2003-06-07
Posts: 2,230

Re: FIFO size changed

It's gone for a long while now.

I suppose the code assumed it was one page, hence the crash when you
increased the value without checking the rest of the code.

Offline

#5 2009-05-25 08:15 AM

jacquesdirac
Member
Registered: 2009-02-06
Posts: 15

Re: FIFO size changed

It seems that there is a great difference between Kernel v2.6 and v2.4. I am using Kernel v2.4.32.

Offline

Board footer

Powered by FluxBB