[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150121174422.260bc3e3@lxorguk.ukuu.org.uk>
Date: Wed, 21 Jan 2015 17:44:22 +0000
From: One Thousand Gnomes <gnomes@...rguk.ukuu.org.uk>
To: Siddhartha De <siddhartha.de87@...il.com>
Cc: kernelnewbies@...nelnewbies.org,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: Question about kernel interfaces
On Sun, 18 Jan 2015 15:03:55 +0530
> Let's say you need to call an ioctl from a shell script ( I know its a
> very rare use case but please bear with me ... :) )
>
> So the current way of doing it is probably to write a C program which
> actually calls the ioctl and then call the C program from the shell
> script ...
That's how Unix is designed yes. It means that the ioctl internals are
hidden from the scripts and the tools provided can be used instead.
> and the IOCTL_EJECT ioctl would get called on /dev/cdrom
> that is ioctl ( &handle_to_/dev/cdrom , IOCTL_EJECT , &some_buffer )
> would get called ( by our translator running as a separate program or
> as a service daemon )
You can just run "eject". It knows about all the details of doing an
eject.
The equivalent of a "library" in shell scripts is a program. Small,
simple tools that do one job and do it right, or at least before GNU got
hold of them 8)
Alan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists