diff options
author | kbyanc <kbyanc@FreeBSD.org> | 2002-11-01 21:31:13 +0000 |
---|---|---|
committer | kbyanc <kbyanc@FreeBSD.org> | 2002-11-01 21:31:13 +0000 |
commit | 3cb06349962a2f2646cb1ebae052da4298764a40 (patch) | |
tree | 62edcab7b94a403073bcd43c26cbb50f9a8e43cb /sys | |
parent | c70af01e8027513cb16aa9d60244c105336fe3e6 (diff) | |
download | FreeBSD-src-3cb06349962a2f2646cb1ebae052da4298764a40.zip FreeBSD-src-3cb06349962a2f2646cb1ebae052da4298764a40.tar.gz |
Update the st_size reported via stat(2) to accurately reflect the amount
of data available to read for non-TCP sockets.
Reviewed by: -net, -arch
Sponsored by: NTT Multimedia Communications Labs
MFC after: 2 weeks
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/sys_socket.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/sys_socket.c b/sys/kern/sys_socket.c index e41821c..328ff51 100644 --- a/sys/kern/sys_socket.c +++ b/sys/kern/sys_socket.c @@ -206,7 +206,7 @@ soo_stat(fp, ub, active_cred, td) ub->st_mode |= S_IRUSR | S_IRGRP | S_IROTH; if ((so->so_state & SS_CANTSENDMORE) == 0) ub->st_mode |= S_IWUSR | S_IWGRP | S_IWOTH; - ub->st_size = so->so_rcv.sb_cc; + ub->st_size = so->so_rcv.sb_cc - so->so_rcv.sb_ctl; ub->st_uid = so->so_cred->cr_uid; ub->st_gid = so->so_cred->cr_gid; return ((*so->so_proto->pr_usrreqs->pru_sense)(so, ub)); |