Re: sockfd_lookup

Tim Hollebeek (tim@franck.Princeton.EDU)
Sat, 10 May 1997 15:07:13 -0400 (EDT)


James R. Leu writes ...
>
> I have a question about the declaration of the function sockfd_lookup().
> Here is the declaration as taken from net/socket.c:
>
> extern __inline struct socket *sockfd_lookup(int fd, struct file **pfile)
>
> I though I knew ANSI C, but I have never seen this combination in a function
> declaration.
>
> 1) What does this delcaration mean?
> 2) Is it acceptable to use this function outside of socket.c by declaring it as
> the following instead?
>
> __inline struct socket *sockfd_lookup(int fd, struct file **pfile)

Function prototypes are extern by default; declaring it extern explicitly
is merely redundant. The two lines are equivalent.

---------------------------------------------------------------------------
Tim Hollebeek | Disclaimer :=> Everything above is a true statement,
Electron Psychologist | for sufficiently false values of true.
Princeton University | email: tim@wfn-shop.princeton.edu
----------------------| http://wfn-shop.princeton.edu/~tim (NEW! IMPROVED!)