Hi All,<br><br>As my understanding, with libevent, any io should be non_blocking, and here comes my dumb q;-)<br><br>I want log stuffs(trace) to a disk file in my comm callback, so I open a file like below, but I didn&#39;t get any write event to call back. I am using Ubuntu Dapper and my target system is Solaris 10.
<br><br>Using stdout worked.<br><br>Thanks.<br><br>Arthur<br>---------------------<br>&nbsp;&nbsp;&nbsp; fdmsg = open(glbCfg.msg_file, O_WRONLY|O_CREAT|O_APPEND|O_NONBLOCK, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);<br>&nbsp;&nbsp;&nbsp; if(fdmsg&lt;0)<br>
&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp; err(-1, &quot;Can&#39;t open file to write %s&quot;, glbCfg.msg_file);<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; //fdmsg = fileno(stdout);<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; if(fcntl(fdmsg, F_SETFL, O_NONBLOCK)==-1)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp; err(-1, &quot;fcntl&quot;);
<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; rcd = io_new_sink(fdmsg);<br>&nbsp;&nbsp;&nbsp; printf(&quot;rcd %p %d\n&quot;, rcd, fdmsg);<br><br>