summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorattilio <attilio@FreeBSD.org>2013-02-08 23:59:21 +0000
committerattilio <attilio@FreeBSD.org>2013-02-08 23:59:21 +0000
commit450eca0c4dcf45d80e1b47ef0f8f534027e67fd3 (patch)
tree82e77728c2b91e78b54bb235fd86d605344f1299 /bin
parent5efa156edcb187c952cb48193661867644a4de26 (diff)
downloadFreeBSD-src-450eca0c4dcf45d80e1b47ef0f8f534027e67fd3.zip
FreeBSD-src-450eca0c4dcf45d80e1b47ef0f8f534027e67fd3.tar.gz
Merge from vmcontention
Diffstat (limited to 'bin')
-rw-r--r--bin/ps/ps.13
-rw-r--r--bin/setfacl/setfacl.120
-rw-r--r--bin/sh/jobs.c2
-rw-r--r--bin/sh/mksyntax.c154
-rw-r--r--bin/sh/parser.h2
5 files changed, 83 insertions, 98 deletions
diff --git a/bin/ps/ps.1 b/bin/ps/ps.1
index 21e8eaf..7f69137 100644
--- a/bin/ps/ps.1
+++ b/bin/ps/ps.1
@@ -29,7 +29,7 @@
.\" @(#)ps.1 8.3 (Berkeley) 4/18/94
.\" $FreeBSD$
.\"
-.Dd September 18, 2012
+.Dd February 7, 2013
.Dt PS 1
.Os
.Sh NAME
@@ -323,6 +323,7 @@ the include file
.It Dv "P_INMEM" Ta No "0x10000000" Ta "Loaded into memory"
.It Dv "P_SWAPPINGOUT" Ta No "0x20000000" Ta "Process is being swapped out"
.It Dv "P_SWAPPINGIN" Ta No "0x40000000" Ta "Process is being swapped in"
+.It Dv "P_PPTRACE" Ta No "0x80000000" Ta "Vforked child issued ptrace(PT_TRACEME)"
.El
.It Cm label
The MAC label of the process.
diff --git a/bin/setfacl/setfacl.1 b/bin/setfacl/setfacl.1
index 3d7b517..83dc41a 100644
--- a/bin/setfacl/setfacl.1
+++ b/bin/setfacl/setfacl.1
@@ -26,7 +26,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd September 2, 2012
+.Dd February 8, 2013
.Dt SETFACL 1
.Os
.Sh NAME
@@ -91,10 +91,16 @@ An error will be reported if any of
the specified files cannot have a default entry (i.e.\&
non-directories). This option is not applicable to NFSv4 ACLs.
.It Fl m Ar entries
-Modify the ACL entries on the specified files by adding new
-entries and modifying existing ACL entries with the ACL entries
-specified in
-.Ar entries .
+Modify the ACL on the specified file.
+New entries will be added, and existing entries will be modified
+according to the
+.Ar entries
+argument.
+For NFSv4 ACLs, it is recommended to use the
+.Fl a
+and
+.Fl x
+options instead.
.It Fl M Ar file
Modify the ACL entries on the specified files by adding new
ACL entries and modifying existing ACL entries with the ACL
@@ -319,9 +325,9 @@ write_data
execute
.It p
append_data
-.It d
-delete_child
.It D
+delete_child
+.It d
delete
.It a
read_attributes
diff --git a/bin/sh/jobs.c b/bin/sh/jobs.c
index d2e1d57..c86394f 100644
--- a/bin/sh/jobs.c
+++ b/bin/sh/jobs.c
@@ -1030,7 +1030,7 @@ dowait(int mode, struct job *job)
int wflags;
int restore_sigchld;
- TRACE(("dowait(%d) called\n", block));
+ TRACE(("dowait(%d, %p) called\n", mode, job));
restore_sigchld = 0;
if ((mode & DOWAIT_SIG) != 0) {
sigfillset(&mask);
diff --git a/bin/sh/mksyntax.c b/bin/sh/mksyntax.c
index 6594da3..c6bf480 100644
--- a/bin/sh/mksyntax.c
+++ b/bin/sh/mksyntax.c
@@ -103,23 +103,16 @@ static char writer[] = "\
static FILE *cfile;
static FILE *hfile;
-static const char *syntax[513];
-static int base;
-static int size; /* number of values which a char variable can have */
-static int nbits; /* number of bits in a character */
-static void filltable(const char *);
-static void init(void);
+static void add_default(void);
+static void finish(void);
+static void init(const char *);
static void add(const char *, const char *);
-static void print(const char *);
static void output_type_macros(void);
int
main(int argc __unused, char **argv __unused)
{
- char c;
- char d;
- int sign;
int i;
char buf[80];
int pos;
@@ -136,27 +129,8 @@ main(int argc __unused, char **argv __unused)
fputs(writer, hfile);
fputs(writer, cfile);
- /* Determine the characteristics of chars. */
- c = -1;
- sign = (c > 0) ? 0 : 1;
- for (nbits = 1 ; ; nbits++) {
- d = (1 << nbits) - 1;
- if (d == c)
- break;
- }
-#if 0
- printf("%s %d bit chars\n", sign? "signed" : "unsigned", nbits);
-#endif
- if (nbits > 9) {
- fputs("Characters can't have more than 9 bits\n", stderr);
- exit(2);
- }
- size = (1 << nbits) + 1;
- base = 1;
- if (sign)
- base += 1 << (nbits - 1);
-
fputs("#include <sys/cdefs.h>\n", hfile);
+ fputs("#include <limits.h>\n\n", hfile);
/* Generate the #define statements in the header file */
fputs("/* Syntax classes */\n", hfile);
@@ -177,8 +151,8 @@ main(int argc __unused, char **argv __unused)
fprintf(hfile, "/* %s */\n", is_entry[i].comment);
}
putc('\n', hfile);
- fprintf(hfile, "#define SYNBASE %d\n", base);
- fprintf(hfile, "#define PEOF %d\n\n", -base);
+ fputs("#define SYNBASE (1 - CHAR_MIN)\n", hfile);
+ fputs("#define PEOF -SYNBASE\n\n", hfile);
putc('\n', hfile);
fputs("#define BASESYNTAX (basesyntax + SYNBASE)\n", hfile);
fputs("#define DQSYNTAX (dqsyntax + SYNBASE)\n", hfile);
@@ -189,10 +163,13 @@ main(int argc __unused, char **argv __unused)
putc('\n', hfile);
/* Generate the syntax tables. */
+ fputs("#include \"parser.h\"\n", cfile);
fputs("#include \"shell.h\"\n", cfile);
fputs("#include \"syntax.h\"\n\n", cfile);
- init();
+
fputs("/* syntax table used when not in quotes */\n", cfile);
+ init("basesyntax");
+ add_default();
add("\n", "CNL");
add("\\", "CBACK");
add("'", "CSQUOTE");
@@ -201,9 +178,11 @@ main(int argc __unused, char **argv __unused)
add("$", "CVAR");
add("}", "CENDVAR");
add("<>();&| \t", "CSPCL");
- print("basesyntax");
- init();
+ finish();
+
fputs("\n/* syntax table used when in double quotes */\n", cfile);
+ init("dqsyntax");
+ add_default();
add("\n", "CNL");
add("\\", "CBACK");
add("\"", "CENDQUOTE");
@@ -212,17 +191,21 @@ main(int argc __unused, char **argv __unused)
add("}", "CENDVAR");
/* ':/' for tilde expansion, '-^]' for [a\-x] pattern ranges */
add("!*?[]=~:/-^", "CCTL");
- print("dqsyntax");
- init();
+ finish();
+
fputs("\n/* syntax table used when in single quotes */\n", cfile);
+ init("sqsyntax");
+ add_default();
add("\n", "CNL");
add("\\", "CSBACK");
add("'", "CENDQUOTE");
/* ':/' for tilde expansion, '-^]' for [a\-x] pattern ranges */
add("!*?[]=~:/-^", "CCTL");
- print("sqsyntax");
- init();
+ finish();
+
fputs("\n/* syntax table used when in arithmetic */\n", cfile);
+ init("arisyntax");
+ add_default();
add("\n", "CNL");
add("\\", "CBACK");
add("`", "CBQUOTE");
@@ -231,100 +214,95 @@ main(int argc __unused, char **argv __unused)
add("}", "CENDVAR");
add("(", "CLP");
add(")", "CRP");
- print("arisyntax");
- filltable("0");
+ finish();
+
fputs("\n/* character classification table */\n", cfile);
+ init("is_type");
add("0123456789", "ISDIGIT");
add("abcdefghijklmnopqrstuvwxyz", "ISLOWER");
add("ABCDEFGHIJKLMNOPQRSTUVWXYZ", "ISUPPER");
add("_", "ISUNDER");
add("#?$!-*@", "ISSPECL");
- print("is_type");
+ finish();
+
exit(0);
}
-
/*
- * Clear the syntax table.
+ * Output the header and declaration of a syntax table.
*/
static void
-filltable(const char *dftval)
+init(const char *name)
{
- int i;
+ fprintf(hfile, "extern const char %s[];\n", name);
+ fprintf(cfile, "const char %s[SYNBASE + CHAR_MAX + 1] = {\n", name);
+}
- for (i = 0 ; i < size ; i++)
- syntax[i] = dftval;
+
+static void
+add_one(const char *key, const char *type)
+{
+ fprintf(cfile, "\t[SYNBASE + %s] = %s,\n", key, type);
}
/*
- * Initialize the syntax table with default values.
+ * Add default values to the syntax table.
*/
static void
-init(void)
+add_default(void)
{
- filltable("CWORD");
- syntax[0] = "CEOF";
- syntax[base + CTLESC] = "CCTL";
- syntax[base + CTLVAR] = "CCTL";
- syntax[base + CTLENDVAR] = "CCTL";
- syntax[base + CTLBACKQ] = "CCTL";
- syntax[base + CTLBACKQ + CTLQUOTE] = "CCTL";
- syntax[base + CTLARI] = "CCTL";
- syntax[base + CTLENDARI] = "CCTL";
- syntax[base + CTLQUOTEMARK] = "CCTL";
- syntax[base + CTLQUOTEEND] = "CCTL";
+ add_one("PEOF", "CEOF");
+ add_one("CTLESC", "CCTL");
+ add_one("CTLVAR", "CCTL");
+ add_one("CTLENDVAR", "CCTL");
+ add_one("CTLBACKQ", "CCTL");
+ add_one("CTLBACKQ + CTLQUOTE", "CCTL");
+ add_one("CTLARI", "CCTL");
+ add_one("CTLENDARI", "CCTL");
+ add_one("CTLQUOTEMARK", "CCTL");
+ add_one("CTLQUOTEEND", "CCTL");
}
/*
- * Add entries to the syntax table.
+ * Output the footer of a syntax table.
*/
static void
-add(const char *p, const char *type)
+finish(void)
{
- while (*p)
- syntax[*p++ + base] = type;
+ fputs("};\n", cfile);
}
-
/*
- * Output the syntax table.
+ * Add entries to the syntax table.
*/
static void
-print(const char *name)
+add(const char *p, const char *type)
{
- int i;
- int col;
-
- fprintf(hfile, "extern const char %s[];\n", name);
- fprintf(cfile, "const char %s[%d] = {\n", name, size);
- col = 0;
- for (i = 0 ; i < size ; i++) {
- if (i == 0) {
- fputs(" ", cfile);
- } else if ((i & 03) == 0) {
- fputs(",\n ", cfile);
- col = 0;
- } else {
- putc(',', cfile);
- while (++col < 9 * (i & 03))
- putc(' ', cfile);
+ for (; *p; ++p) {
+ char c = *p;
+ switch (c) {
+ case '\t': c = 't'; break;
+ case '\n': c = 'n'; break;
+ case '\'': c = '\''; break;
+ case '\\': c = '\\'; break;
+
+ default:
+ fprintf(cfile, "\t[SYNBASE + '%c'] = %s,\n", c, type);
+ continue;
}
- fputs(syntax[i], cfile);
- col += strlen(syntax[i]);
+ fprintf(cfile, "\t[SYNBASE + '\\%c'] = %s,\n", c, type);
}
- fputs("\n};\n", cfile);
}
-
/*
* Output character classification macros (e.g. is_digit). If digits are
* contiguous, we can test for them quickly.
diff --git a/bin/sh/parser.h b/bin/sh/parser.h
index 9a996d0..f80d917 100644
--- a/bin/sh/parser.h
+++ b/bin/sh/parser.h
@@ -39,7 +39,7 @@
#define CTLENDVAR '\371'
#define CTLBACKQ '\372'
#define CTLQUOTE 01 /* ored with CTLBACKQ code if in quotes */
-/* CTLBACKQ | CTLQUOTE == '\205' */
+/* CTLBACKQ | CTLQUOTE == '\373' */
#define CTLARI '\374'
#define CTLENDARI '\375'
#define CTLQUOTEMARK '\376'
OpenPOWER on IntegriCloud