All of lore.kernel.org
 help / color / mirror / Atom feed
From: michael young <mhyoung@valdosta.edu>
To: Rechberger Markus <mrechberger@gmail.com>
Cc: linux-c-programming@vger.kernel.org, mailing-lists@xs4all.nl
Subject: Re: ioctl.h
Date: Mon, 07 Mar 2005 09:45:53 -0500	[thread overview]
Message-ID: <422C6921.7080602@valdosta.edu> (raw)
In-Reply-To: <d9def9db0503041355660768a0@mail.gmail.com>

kool
thanks guys
i think can run with the info i have

Mike

Rechberger Markus wrote:

>hey Michael,
>
>here just an example:
>
>this small tool opens the cd tray
>
>#include <sys/types.h>
>#include <sys/ioctl.h>
>#include <fcntl.h>
>#include <linux/cdrom.h>
>
>int main(){
>    int cdrom;
>    if ((cdrom = open("/dev/cdrom",O_RDONLY | O_NONBLOCK)) < 0) {
>            perror("open");
>            exit(1);
>    }
>    if (ioctl(cdrom,CDROMEJECT,0)<0) {
>            perror("ioctl");
>            exit(1);
>    }
>    close(cdrom);
>    return(0);
>}
>
>simply build it with gcc tray.c -o tray
>
>look at cdrom.h for more defined operations, you will also find
>CDROMEJECT in there, 0 is an argument see the manpage (man ioctl) for
>more infos..
>
>Markus
>
>On Fri, 04 Mar 2005 14:15:04 -0500, michael young <mhyoung@valdosta.edu> wrote:
>  
>
>>Hi,
>>how do you use the ioctl.h?
>>there seems to be little info on it
>>on the web or in print. If you know
>>of anything on the web please let me
>>know.
>>
>>thank you,
>>Mike
>>
>>-
>>To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
>>the body of a message to majordomo@vger.kernel.org
>>More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
>>    
>>
>
>  
>


      reply	other threads:[~2005-03-07 14:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-04 19:15 ioctl.h michael young
2005-03-04 20:54 ` ioctl.h J.
2005-03-04 21:55 ` ioctl.h Rechberger Markus
2005-03-07 14:45   ` michael young [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=422C6921.7080602@valdosta.edu \
    --to=mhyoung@valdosta.edu \
    --cc=linux-c-programming@vger.kernel.org \
    --cc=mailing-lists@xs4all.nl \
    --cc=mrechberger@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.