summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authormaxim <maxim@FreeBSD.org>2004-11-25 09:27:56 +0000
committermaxim <maxim@FreeBSD.org>2004-11-25 09:27:56 +0000
commit52c7e742ee5cbc42df2e3e067f6203b9012be878 (patch)
tree38115d87e159576c97409c40e87b2b2fdf5bfe17 /usr.sbin
parent5525bf46398c6eea71b4e89be1564af0c4d8131b (diff)
downloadFreeBSD-src-52c7e742ee5cbc42df2e3e067f6203b9012be878.zip
FreeBSD-src-52c7e742ee5cbc42df2e3e067f6203b9012be878.tar.gz
Increase a socket receive buffer size. This helps 'ngctl list'
to deal with a big number of nodes. Submitted by: archie Approved by: archie Reported and tested: Konstantin Timashkov MFC after: 1 month
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/ngctl/main.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/ngctl/main.c b/usr.sbin/ngctl/main.c
index fcd61df..4be794f 100644
--- a/usr.sbin/ngctl/main.c
+++ b/usr.sbin/ngctl/main.c
@@ -114,7 +114,7 @@ main(int ac, char *av[])
char name[NG_NODESIZ];
int interactive = isatty(0) && isatty(1);
FILE *fp = NULL;
- int ch, rtn = 0;
+ int ch, size, rtn = 0;
/* Set default node name */
snprintf(name, sizeof(name), "ngctl%d", getpid());
@@ -146,7 +146,9 @@ main(int ac, char *av[])
/* Create a new socket node */
if (NgMkSockNode(name, &csock, &dsock) < 0)
err(EX_OSERR, "can't create node");
-
+ size = 128 * 1024;
+ if (setsockopt(csock, SOL_SOCKET, SO_RCVBUF, &size, sizeof(size)) == -1)
+ err(1, "setsockopt");
/* Do commands as requested */
if (ac == 0) {
if (fp != NULL) {
OpenPOWER on IntegriCloud