---
name: "struct_socket"
section: "9"
platform: "linux"
package: "linux-manual-4.9"
version: "4.9.228-1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/struct_socket"
---

# struct\_socket(9)

general BSD socket

## NAME

struct\_socket - general BSD socket

## SYNOPSIS

```
struct socket {
  socket_state state;
  short type;
  unsigned long flags;
  struct socket_wq __rcu * wq;
  struct file * file;
  struct sock * sk;
  const struct proto_ops * ops;
};
```

## MEMBERS

state

socket state (**SS\_CONNECTED**, etc)

type

socket type (**SOCK\_STREAM**, etc)

flags

socket flags (**SOCK\_NOSPACE**, etc)

wq

wait queue for several uses

file

File back pointer for gc

sk

internal networking protocol agnostic socket representation

ops

protocol specific socket operations

## COPYRIGHT
