I have two process to do the same thing, how to organize the access to the file where each process 'll write.

there is C++ code :

FILE * pFile;
pFile = fopen ("wirelessRecv.tr","a+"); ( the same file for the two process)

macmib_.ReceivedFragmentCount++; (each process have a counter )

fprintf (pFile, "\n "TIME_FORMAT" %d %d %d" ,
Scheduler::instance().clock(), netif_->node()->nodeid(),
macmib_.ReceivedFragmentCount, ch->size()-phymib_.getHdrLen11());

fclose (pFile);

Thanks
Zayzay