15 #include <linux/module.h>
16 #include <linux/net.h>
17 #include <linux/signal.h>
18 #include <linux/tcp.h>
19 #include <linux/wait.h>
33 if (sk_stream_wspace(sk) >= sk_stream_min_wspace(sk) && sock) {
38 if (wq_has_sleeper(wq))
62 int err = sock_error(sk);
69 if (signal_pending(tsk))
70 return sock_intr_errno(*timeo_p);
76 !((1 << sk->sk_state) &
89 static inline int sk_stream_closing(
struct sock *
sk)
91 return (1 << sk->sk_state) &
105 }
while (!signal_pending(
current) && timeout);
121 long current_timeo = *timeo_p;
124 if (sk_stream_memory_free(sk))
125 current_timeo = vm_wait = (
net_random() % (
HZ / 5)) + 2;
139 if (sk_stream_memory_free(sk) && !vm_wait)
146 (sk_stream_memory_free(sk) &&
151 vm_wait -= current_timeo;
152 current_timeo = *timeo_p;
154 (current_timeo -= vm_wait) < 0)
158 *timeo_p = current_timeo;
171 err = sock_intr_errno(*timeo_p);
179 err = sock_error(sk) ? : -
EPIPE;