sockets: for stat(2) on a socket don't report hiwat as block size

The code appeared in d8392c6c39 with not good explanation.  It is
very unlikely any software in the world needs that.

Differential revision:	https://reviews.freebsd.org/D36283
This commit is contained in:
Gleb Smirnoff 2022-08-26 08:16:15 -07:00
parent 5876499023
commit 7c04ca1fad
2 changed files with 2 additions and 14 deletions

View File

@ -335,7 +335,8 @@ soo_stat(struct file *fp, struct stat *ub, struct ucred *active_cred)
}
ub->st_uid = so->so_cred->cr_uid;
ub->st_gid = so->so_cred->cr_gid;
error = so->so_proto->pr_sense(so, ub);
if (so->so_proto->pr_sense)
error = so->so_proto->pr_sense(so, ub);
SOCK_UNLOCK(so);
return (error);
}

View File

@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$");
#include <sys/rmlock.h>
#include <sys/socketvar.h>
#include <sys/systm.h>
#include <sys/stat.h> /* XXXGL: remove */
#include <machine/atomic.h>
@ -175,17 +174,6 @@ pr_ready_notsupp(struct socket *so, struct mbuf *m, int count)
return (EOPNOTSUPP);
}
/*
* This isn't really a ``null'' operation, but it's the default one and
* doesn't do anything destructive.
*/
static int
pr_sense_notsupp(struct socket *so, struct stat *sb)
{
sb->st_blksize = so->so_snd.sb_hiwat;
return (0);
}
static int
pr_shutdown_notsupp(struct socket *so)
{
@ -246,7 +234,6 @@ pr_init(struct protosw *pr)
NOTSUPP(pr_rcvd);
NOTSUPP(pr_rcvoob);
NOTSUPP(pr_send);
NOTSUPP(pr_sense);
NOTSUPP(pr_shutdown);
NOTSUPP(pr_sockaddr);
NOTSUPP(pr_sosend);