2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
10 #include <afsconfig.h>
11 #include <afs/param.h>
17 #include <afs/com_err.h>
19 #include <afs/venus.h>
22 #include "afs/prs_fs.h"
23 #include <afs/afsint.h>
24 #include <afs/cellconfig.h>
26 #include <afs/com_err.h>
27 #include <afs/afs_consts.h>
28 #include <afs/sys_prototypes.h>
30 #define MAXINSIZE 1300 /* pioctl complains if data is larger than this */
31 #define VMSGSIZE 128 /* size of msg buf in volume hdr */
33 static void Die(int code, char *filename);
35 static char pn[] = "fs";
36 static int rxInitDone = 0;
39 Twiddle(struct cmd_syndesc *as, void *arock)
42 struct ViceIoctl blob;
47 ti = as->parms[0].items;
52 rxp.rx_initReceiveWindow = tmp;
53 ti = as->parms[1].items;
58 rxp.rx_maxReceiveWindow = tmp;
59 ti = as->parms[2].items;
64 rxp.rx_initSendWindow = tmp;
65 ti = as->parms[3].items;
70 rxp.rx_maxSendWindow = tmp;
71 ti = as->parms[4].items;
76 rxp.rxi_nSendFrags = tmp;
77 ti = as->parms[5].items;
82 rxp.rxi_nRecvFrags = tmp;
83 ti = as->parms[6].items;
88 rxp.rxi_OrphanFragSize = tmp;
89 ti = as->parms[7].items;
94 rxp.rx_maxReceiveSize = tmp;
95 ti = as->parms[8].items;
100 rxp.rx_MyMaxSendSize = tmp;
102 blob.in = (char *)&rxp;
103 blob.out = (char *)&rxp;
104 blob.in_size = sizeof(rxp);
105 blob.out_size = sizeof(rxp);
106 code = pioctl(0, VIOC_TWIDDLE, &blob, 1);
114 #include "AFS_component_version_number.c"
117 main(int argc, char **argv)
120 struct cmd_syndesc *ts;
124 * The following signal action for AIX is necessary so that in case of a
125 * crash (i.e. core is generated) we can include the user's data section
126 * in the core dump. Unfortunately, by default, only a partial core is
127 * generated which, in many cases, isn't too useful.
129 struct sigaction nsa;
131 sigemptyset(&nsa.sa_mask);
132 nsa.sa_handler = SIG_DFL;
133 nsa.sa_flags = SA_FULLDUMP;
134 sigaction(SIGSEGV, &nsa, NULL);
136 /* try to find volume location information */
139 ts = cmd_CreateSyntax(NULL, Twiddle, NULL, "adjust rx parms");
140 cmd_AddParm(ts, "-initReceiveWindow ", CMD_SINGLE, CMD_OPTIONAL, "16");
141 cmd_AddParm(ts, "-maxReceiveWindow ", CMD_SINGLE, CMD_OPTIONAL, "16");
142 cmd_AddParm(ts, "-initSendWindow ", CMD_SINGLE, CMD_OPTIONAL, "8");
143 cmd_AddParm(ts, "-maxSendWindow ", CMD_SINGLE, CMD_OPTIONAL, "16");
144 cmd_AddParm(ts, "-nSendFrags ", CMD_SINGLE, CMD_OPTIONAL, "4");
145 cmd_AddParm(ts, "-nRecvFrags ", CMD_SINGLE, CMD_OPTIONAL, "4");
146 cmd_AddParm(ts, "-OrphanFragSize ", CMD_SINGLE, CMD_OPTIONAL, "512");
147 cmd_AddParm(ts, "-maxReceiveSize ", CMD_SINGLE, CMD_OPTIONAL, "");
148 cmd_AddParm(ts, "-MyMaxSendSize ", CMD_SINGLE, CMD_OPTIONAL, "");
150 code = cmd_Dispatch(argc, argv);
158 Die(int code, char *filename)
161 if (errno == EINVAL) {
164 "%s: Invalid argument; it is possible that %s is not in AFS.\n",
167 fprintf(stderr, "%s: Invalid argument.\n", pn);
168 } else if (errno == ENOENT) {
170 fprintf(stderr, "%s: File '%s' doesn't exist\n", pn, filename);
172 fprintf(stderr, "%s: no such file returned\n", pn);
173 } else if (errno == EROFS)
175 "%s: You can not change a backup or readonly volume\n", pn);
176 else if (errno == EACCES || errno == EPERM) {
179 "%s: You don't have the required access rights on '%s'\n",
183 "%s: You do not have the required rights to do this operation\n",
187 fprintf(stderr, "%s:'%s'", pn, filename);
189 fprintf(stderr, "%s", pn);
190 fprintf(stderr, ": %s\n", afs_error_message(errno));