Re: why file descriptor an int



In article <fgrdj2$f13$1@xxxxxxxxxxxxx>,
"kkzhou" <kkzhou@xxxxxxxxxxxxxxxx> wrote:

oh, I meant that system calls such as "read(int filedes,..." have an int
parameter which
represents a system resource.
In my opinion, "read( fd_t filedes,.." may be better as an interface defined
by standard

The convention of using typedefs like this is pretty recent, only about
10 or so years old. The basic filesystem system calls are very old,
going back over 30 years. Although some of the traditional APIs have
been updated, file descriptors are often put in structures, so
programmers would have to redefine all these structures to accomodate
the change.

So I guess they decided that forcing a change like this would be more
trouble than it's worth.

--
Barry Margolin, barmar@xxxxxxxxxxxx
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
.