LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices



Reply
 
Search this Thread
Old 05-08-2007, 10:24 AM   #1
geom06005
LQ Newbie
 
Registered: Jan 2007
Distribution: slackware 10.2
Posts: 8

Rep: Reputation: 0
What means Pipe failed, too many files opened?


i am running a code and created a pipe. When i compile it and run it says that "pipe failed, too many files opened"

Does anyone know what does this mean?
 
Old 05-08-2007, 12:13 PM   #2
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 70
It means that you have too many open files for your user or program’s permissions…
pipe() probably failed with EMFILE. To correct this, you to change your resource limits (specifically RLIMIT_NOFILE).
 
Old 05-08-2007, 01:46 PM   #3
geom06005
LQ Newbie
 
Registered: Jan 2007
Distribution: slackware 10.2
Posts: 8

Original Poster
Rep: Reputation: 0
Dear osor


I have created a pipe and then forked the procedure, but it tells me that piped failed and has too many open files. I think that this response comes because
fd[0] element opens too many files for reading and the system memory is too low.
When i am using less files the procedure works fine

I wander how you change your resource limits, and what is RLIMIT_NOFILE() in order the pipe to read the files?

i give you a part of the pipe process
int i;
int status;
int pid[2];
int pipe_fd[2];

for(i = 0; i < n; i++)
{
strcpy(name,uncompressed[i]->d_name);
if (pipe(pipe_fd) < 0)
{
perror ("pipe failed");
exit (errno);I realy think that the process ends here

if ((pid[0]=fork()) < 0)
{
perror ("Fork failed");
exit(errno);
 
Old 05-08-2007, 03:45 PM   #4
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 70
Quote:
Originally Posted by geom06005
I wander how you change your resource limits
You can change resource limits with the ulimit command (which should be implemented by your shell). To see your current resource limits, type (in a terminal) “ulimit -a”. You can see how many open file descriptors a process is allowed to have.
Quote:
Originally Posted by geom06005
and what is RLIMIT_NOFILE
RLIMIT_NOFILE is a macro describing the number of open file descriptors a process is allowed to have. It is normally used by getrlimit() and setrlimit().

There are many reasons why your resource limits might be too low. The most common culprit is PAM. A quick google might get you started.
 
Old 05-08-2007, 05:15 PM   #5
rworkman
Slackware Contributor
 
Registered: Oct 2004
Location: Tuscaloosa, Alabama (USA)
Distribution: Slackware
Posts: 1,969

Rep: Reputation: Disabled
http://slackwiki.org/Resource_Limits
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find out the number of files currently opened closet geek Linux - Kernel 4 12-22-2006 02:45 PM
how does one use DD to recombine files from using pipe to split files originally? nerdful1 Linux - General 3 03-28-2006 08:46 AM
[SOLVED] working on files with sed and pipe angel115 Linux - Newbie 4 10-23-2005 07:15 PM
Doom 3 demo: snd_pcm_writei failed: Broken pipe nikolaj Linux - Games 0 04-14-2005 01:00 PM
Failed Dependencies, not sure what it means.. ex0r Linux - Newbie 3 03-01-2004 02:16 AM


All times are GMT -5. The time now is 03:20 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration