I am having code for ejecting CDROM in my Linux system. This is code <br><blockquote style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><b>#include &lt;sys/types.h&gt;</b><br>

<b>#include &lt;sys/ioctl.h&gt;</b><br><b>#include &lt;fcntl.h&gt;</b><br><b>#include &lt;linux/cdrom.h&gt;</b><br><b>#include &lt;stdio.h&gt;</b><br><b>#include &lt;stdlib.h&gt;</b><br><b>int main( int argc, char **argv )</b><br>

<b>{</b><br><b>        int cdrom;</b><br><b>        int i;</b><br><br><b>        /* open device */</b><br><b>        if ((cdrom = open(&quot;/dev/cdrom&quot;,O_RDONLY | O_NONBLOCK)) &lt; 0) {</b><br><b>                perror(&quot;open&quot;);</b><br>

<b>        exit(1);</b><br><b>        }</b><br><br><b>        /* eject  */</b><br><b>        if(ioctl(cdrom, CDROMEJECT) &lt; 0) {</b><br><b>                printf(&quot;Could not eject cdrom tray\n&quot;);</b><br><b>        }</b><br>

<br><b>        /* close device */</b><br><b>        close(cdrom);</b><br><b>        return 0;</b><br><b>}</b><br><b> </b><br></blockquote>CDROM
 is ejecting fine. ie its opening. But i don&#39;t know how to make my CDROM
 to close. Even if i run these program again its not closing. Can anyone
 help me..