[so] de ce imi da eroare la codul asta?

Alex so@atlantis.cs.pub.ro
Tue, 27 Apr 2004 01:37:04 -0700 (PDT)


--0-1233816596-1083055024=:91271
Content-Type: text/plain; charset=us-ascii

imi da o eroare ori segmentation error cand pornesc programul ori invalid file descriptor dupa ceva timp  ceva de genul asta...
..
..
..
struct aiocb *suspend_list[MAX_AIO_SUSPEND];
int fd[MAX_AIO_SUSPEND];

for (i=0;i<MAX_AIO_SUSPEND;i++) 
{
    if((suspend_list[i]=malloc(sizeof (struct aiocb))) ==NULL) 
 DieWithError("Esuare alocare()");;
}
..
..
..
void Thread2()
{
..
..
/////execut operatia asyncrona
while(1)
 {
     printf("deschid fd j=%d\n",fd[j]);
     fd[j]=open(t_fis,O_CREAT,0666);
     suspend_list[j]->aio_offset=t_of;
     suspend_list[j]->aio_buf=Buffer;
     suspend_list[j]->aio_nbytes=strlen(Buffer);
     suspend_list[j]->aio_fildes = fd[j];
     aio_read(suspend_list[j]);
      
     aio_suspend( (const struct aiocb**) suspend_list,1,&timeout);
      
 }
   ....
...
..
     
/////end operatia

 
si vroiam sa stiu daca ati receptionat tema 1 ca eu am trimis de f mult timp , si e tot 0, macar un "x" ca este primita 



 

multumesc

		
---------------------------------
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs 
--0-1233816596-1083055024=:91271
Content-Type: text/html; charset=us-ascii

<DIV>imi da o eroare ori segmentation error cand pornesc programul ori invalid file descriptor dupa ceva timp&nbsp; ceva de genul asta...</DIV>
<DIV>..<BR>..<BR>..</DIV>
<DIV>struct aiocb *suspend_list[MAX_AIO_SUSPEND];<BR>int fd[MAX_AIO_SUSPEND];</DIV>
<DIV><BR>for (i=0;i&lt;MAX_AIO_SUSPEND;i++) <BR>{<BR>&nbsp;&nbsp;&nbsp; if((suspend_list[i]=malloc(sizeof (struct aiocb))) ==NULL) <BR>&nbsp;DieWithError("Esuare alocare()");;<BR>}</DIV>
<DIV>..<BR>..<BR>..<BR>void Thread2()<BR>{<BR>..<BR>..<BR>/////execut operatia asyncrona</DIV>
<DIV>while(1)<BR>&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp; printf("deschid fd j=%d\n",fd[j]);<BR>&nbsp;&nbsp;&nbsp;&nbsp; fd[j]=open(t_fis,O_CREAT,0666);<BR>&nbsp;&nbsp;&nbsp;&nbsp; suspend_list[j]-&gt;aio_offset=t_of;<BR>&nbsp;&nbsp;&nbsp;&nbsp; suspend_list[j]-&gt;aio_buf=Buffer;<BR>&nbsp;&nbsp;&nbsp;&nbsp; suspend_list[j]-&gt;aio_nbytes=strlen(Buffer);<BR>&nbsp;&nbsp;&nbsp;&nbsp; suspend_list[j]-&gt;aio_fildes = fd[j];<BR>&nbsp;&nbsp;&nbsp;&nbsp; aio_read(suspend_list[j]);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp; aio_suspend( (const struct aiocb**) suspend_list,1,&amp;timeout);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;}<BR>&nbsp;&nbsp;&nbsp;....</DIV>
<DIV>...</DIV>
<DIV>..<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>/////end operatia<BR></DIV>
<DIV>&nbsp;</DIV>
<DIV>si vroiam sa stiu daca ati receptionat tema 1 ca eu am trimis de f mult timp , si e tot 0, macar un "x" ca este primita </DIV>
<P><IMG src="http://us.i1.yimg.com/us.yimg.com/i/mesg/tsmileys2/26.gif"></P>
<P>&nbsp;</P>
<P>multumesc</P><p>
		<hr size=1><font face=arial size=-1>Do you Yahoo!?<br><a href="http://pa.yahoo.com/*http://us.rd.yahoo.com/hotjobs/hotjobs_mail_signature_footer_textlink/evt=23983/*http://hotjobs.sweepstakes.yahoo.com/careermakeover">Win a $20,000 Career Makeover at Yahoo! HotJobs </a>
--0-1233816596-1083055024=:91271--