Re: Basic kernel mechanisms

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Hariharan L Thantry wrote:

> Your page was very helpful. But could you tell me why under sys/socket.h
> (which I assume is /usr/include/sys/socket.h) the socket call is declared
> as "extern int socket__P(,,)". Where is this function defined?

You've missed out the spaces:

extern int socket __P ((int __domain, int __type, int __protocol));

The __P() macro is defined in sys/cdefs.h thus (extraneous lines have
been snipped):

# if (defined __STDC__ && __STDC__) || defined __cplusplus
#  define __P(args)	args
# else	/* Not ANSI C or C++.  */
#  define __P(args)	()	/* No prototypes.  */
# endif	/* ANSI C or C++.  */

IOW, it generates either K&R or ANSI prototypes as appropriate.

-- 
Glynn Clements <glynn@sensei.co.uk>
-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.rutgers.edu


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux