summaryrefslogtreecommitdiff
path: root/sys/kern/sys_socket.c
diff options
context:
space:
mode:
authorEd Maste <emaste@FreeBSD.org>2009-06-30 13:38:49 +0000
committerEd Maste <emaste@FreeBSD.org>2009-06-30 13:38:49 +0000
commit2dafac3976b1e65dc6e1fe9aee59191d4cd19af1 (patch)
tree8b55a5b1eeeffcba51735b6a4fdb499a8936add5 /sys/kern/sys_socket.c
parentb2d758545bc5d29786ee9ab87d10de7ab52a7334 (diff)
Notes
Diffstat (limited to 'sys/kern/sys_socket.c')
-rw-r--r--sys/kern/sys_socket.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/kern/sys_socket.c b/sys/kern/sys_socket.c
index ecfb4adca6d3..c29ecc6445f6 100644
--- a/sys/kern/sys_socket.c
+++ b/sys/kern/sys_socket.c
@@ -174,6 +174,14 @@ soo_ioctl(struct file *fp, u_long cmd, void *data, struct ucred *active_cred,
*(int *)data = so->so_snd.sb_cc;
break;
+ case FIONSPACE:
+ if ((so->so_snd.sb_hiwat < so->so_snd.sb_cc) ||
+ (so->so_snd.sb_mbmax < so->so_snd.sb_mbcnt))
+ *(int *)data = 0;
+ else
+ *(int *)data = sbspace(&so->so_snd);
+ break;
+
case FIOSETOWN:
error = fsetown(*(int *)data, &so->so_sigio);
break;