diff options
| author | Robert Watson <rwatson@FreeBSD.org> | 2004-06-20 17:35:50 +0000 |
|---|---|---|
| committer | Robert Watson <rwatson@FreeBSD.org> | 2004-06-20 17:35:50 +0000 |
| commit | d43c1f67ccb03038614bdf9fc0e7ba735203246e (patch) | |
| tree | 69417ad2898a3a7f4c7c47d9ad7e7a8bdb849fc3 /sys/kern/sys_socket.c | |
| parent | 3971dcfa4b90ddd5045d6c3896f9aa7a1f7fb097 (diff) | |
Notes
Diffstat (limited to 'sys/kern/sys_socket.c')
| -rw-r--r-- | sys/kern/sys_socket.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/kern/sys_socket.c b/sys/kern/sys_socket.c index 986edf7ed5b7..e59823cb0621 100644 --- a/sys/kern/sys_socket.c +++ b/sys/kern/sys_socket.c @@ -170,6 +170,7 @@ soo_ioctl(fp, cmd, data, active_cred, td) return (0); case FIONREAD: + /* Unlocked read. */ *(int *)data = so->so_rcv.sb_cc; return (0); @@ -188,6 +189,7 @@ soo_ioctl(fp, cmd, data, active_cred, td) return (0); case SIOCATMARK: + /* Unlocked read. */ *(int *)data = (so->so_rcv.sb_state & SBS_RCVATMARK) != 0; return (0); } @@ -229,7 +231,11 @@ soo_stat(fp, ub, active_cred, td) /* * If SBS_CANTRCVMORE is set, but there's still data left in the * receive buffer, the socket is still readable. + * + * XXXRW: perhaps should lock socket buffer so st_size result + * is consistent. */ + /* Unlocked read. */ if ((so->so_rcv.sb_state & SBS_CANTRCVMORE) == 0 || so->so_rcv.sb_cc != 0) ub->st_mode |= S_IRUSR | S_IRGRP | S_IROTH; |
