+getstdopts(options, flagp)
+ char *options;
+ long *flagp;
+{
+ register char *opt;
+ int negative;
+ char *optbuf[BUFSIZ], *strtok();
+
+ strcpy(optbuf, options);
+ for (opt = strtok(optbuf, ","); opt; opt = strtok(NULL, ",")) {
+ if (opt[0] == 'n' && opt[1] == 'o') {
+ negative++;
+ opt += 2;
+ } else {
+ negative = 0;
+ }
+ if (!strcasecmp(opt, "exec")) {
+ if (negative)
+ *flagp |= M_NOEXEC;
+ continue;
+ }
+ if (!strcasecmp(opt, "suid")) {
+ if (negative)
+ *flagp |= M_NOSUID;
+ continue;
+ }
+ if (!strcasecmp(opt, "dev")) {
+ if (negative)
+ *flagp |= M_NODEV;
+ continue;
+ }
+ if (!strcasecmp(opt, "synchronous")) {
+ if (!negative)
+ *flagp |= M_SYNCHRONOUS;
+ continue;
+ }
+ }
+}
+