1__SKB_TRY_RECV_DATAG(9) Linux Networking __SKB_TRY_RECV_DATAG(9)
2
3
4
6 __skb_try_recv_datagram - Receive a datagram skbuff
7
9 struct sk_buff * __skb_try_recv_datagram(struct sock * sk,
10 unsigned int flags,
11 void (*destructor) (struct sock *sk, struct sk_buff *skb),
12 int * peeked, int * off,
13 int * err,
14 struct sk_buff ** last);
15
17 sk
18 socket
19
20 flags
21 MSG_ flags
22
23 destructor
24 invoked under the receive lock on successful dequeue
25
26 peeked
27 returns non-zero if this packet has been seen before
28
29 off
30 an offset in bytes to peek skb from. Returns an offset within an
31 skb where data actually starts
32
33 err
34 error code returned
35
36 last
37 set to last peeked message to inform the wait function what to look
38 for when peeking
39
41 Get a datagram skbuff, understands the peeking, nonblocking wakeups and
42 possible races. This replaces identical code in packet, raw and udp, as
43 well as the IPX AX.25 and Appletalk. It also finally fixes the long
44 standing peek and read race for datagram sockets. If you alter this
45 routine remember it must be re-entrant.
46
47 This function will lock the socket if a skb is returned, so the caller
48 needs to unlock the socket in that case (usually by calling
49 skb_free_datagram). Returns NULL with *err set to -EAGAIN if no data
50 was available or to some other value if an error was detected.
51
52 * It does not lock socket since today. This function is * free of race
53 conditions. This measure should/can improve * significantly datagram
54 socket latencies at high loads, * when data copying to user space takes
55 lots of time. * (BTW I've just killed the last cli in
56 IP/IPv6/core/netlink/packet * 8) Great win.) * --ANK (980729)
57
58 The order of the tests when we find no data waiting are specified quite
59 explicitly by POSIX 1003.1g, don't change them without having the
60 standard around please.
61
63Kernel Hackers Manual 3.10 June 2019 __SKB_TRY_RECV_DATAG(9)