包含BSD套接口的信息。它不独立存在,一般位于一个VFS inode结构中。
[b]struct socket {
short type; [/b] /* SOCK_STREAM, ... */
[b]socket_state state;
long flags;
struct proto_ops *ops; [/b] /* protocols do most everything */
[b]void *data; [/b] /* protocol data */
[b]struct socket *conn; [/b] /* server socket connected to */
[b]struct socket *iconn; [/b] /* incomplete client conn.s */
[b] struct socket *next;[/b]
[b]struct wait_queue **wait;[/b] /* ptr to place to wait on */
[b]struct inode *inode;[/b]
[b]struct fasync_struct *fasync_list; [/b]/* Asynchronous wake up list */
[b]struct file *file;[/b] /* File back pointer for gc */
[b]};[/b]
[b]struct socket {
short type; [/b] /* SOCK_STREAM, ... */
[b]socket_state state;
long flags;
struct proto_ops *ops; [/b] /* protocols do most everything */
[b]void *data; [/b] /* protocol data */
[b]struct socket *conn; [/b] /* server socket connected to */
[b]struct socket *iconn; [/b] /* incomplete client conn.s */
[b] struct socket *next;[/b]
[b]struct wait_queue **wait;[/b] /* ptr to place to wait on */
[b]struct inode *inode;[/b]
[b]struct fasync_struct *fasync_list; [/b]/* Asynchronous wake up list */
[b]struct file *file;[/b] /* File back pointer for gc */
[b]};[/b]