Re: Too Many Open Files --- error 24
- From: raxitsheth2000@xxxxxxxxx
- Date: Thu, 28 Jun 2007 01:23:35 -0700
David Schwartz wrote:
On Jun 26, 4:38 am, raxitsheth2...@xxxxxxxxx wrote:
Any Idea. ? why even it is not reaching to 65535, and giving "too many
open files" ?
anything with libc or so ? (I know 64-bit will help me, but currently
this is not the option for me.)
You have told us what error you get, but not what function it is a
response to!
I made a simple program... It is also behaving same way...!
I think something is missing or some misconception i am having for
behaviour.
/* === START========*/
#include<stdio.h>
#include<stdlib.h>
#include<errno.h>
int main()
{
FILE *fp=NULL;
int i;
int pid;
printf("\n Enter Pid of this Process : ");
scanf("%d",&pid);
char buf[100];
for(i=0;i<1000;i++)
{
memset(buf,0,100);
/* IF A IS NOT COMMENTED IT MAY WRITE log1.txt, log2.txt...upto
log1000.txt
if you don't want this then plz commen
// sprintf(buf,"lsof -p %d >> log[%d].txt",pid,i); //<--A
// sprintf(buf,"lsof -p %d > log.txt",pid,i); <--B
//sprintf(buf,"ls > log1.txt");
printf("\n BUF = %s",buf);fflush(stdout);
printf("\n I = %d",i);fflush(stdout);
fp=fopen("./mytest","r");
if (fp==NULL) {
printf("\n Error %d",errno);
printf("Error = %s",strerror(errno));
fflush(stdout);return -1;
}
system(buf);
}
return 0;
}
/*Approx. at 250 open fd program is showing the error Too many open
files*/
/*====STOP==========*/
DS
.
- Follow-Ups:
- Re: Too Many Open Files --- error 24
- From: David Schwartz
- Re: Too Many Open Files --- error 24
- From: Eric Sosman
- Re: Too Many Open Files --- error 24
- From: Frank Cusack
- Re: Too Many Open Files --- error 24
- References:
- Too Many Open Files --- error 24
- From: raxitsheth2000
- Re: Too Many Open Files --- error 24
- From: David Schwartz
- Too Many Open Files --- error 24
- Prev by Date: Re: How to check for stuff like '|'
- Next by Date: Re: Too Many Open Files --- error 24
- Previous by thread: Re: Too Many Open Files --- error 24
- Next by thread: Re: Too Many Open Files --- error 24
- Index(es):
Relevant Pages
|