Path: utzoo!attcan!uunet!husc6!cmcl2!adm!smoke!gwyn
From: gwyn@smoke.ARPA (Doug Gwyn )
Newsgroups: comp.unix.questions
Subject: Re: fcntl() versus ioctl() - yes!
Message-ID: <8533@smoke.ARPA>
Date: 19 Sep 88 02:46:52 GMT
References: <1380@solo7.cs.vu.nl> <7034@ki4pv.uucp> <1407@solo12.cs.vu.nl> <7039@ki4pv.uucp>
Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) )
Organization: Ballistic Research Lab (BRL), APG, MD.
Lines: 15

In article <7039@ki4pv.uucp> tanner@ki4pv.uucp (Dr. T. Andrews) writes:
>In article <1407@solo12.cs.vu.nl>, maart@cs.vu.nl (Maarten Litmaath) writes:
>) Aha! And where's the expected next statement: why has fcntl() been
>) invented in the first place?
>My suspicion is that it seemed to someone like a good idea at the
>time.

It IS a good idea.  If you check out the internals of the kernel,
you'll find that ioctl is really supposed to be a hook into I/O
device drivers for things that don't fit the open/read/write/close
model.  fnctl on the other hand is for manipulating file table
entries and other similar actions that should not involve the
device driver at all.  Since both of them enter the kernel, either
COULD do anything at all, but a clean partitioning of function is
desirable.