View | Details | Raw Unified | Return to bug 215836
Collapse All | Expand All

(-)sbin/dmesg/dmesg.8 (-1 / +6 lines)
Lines 36-42 Link Here
36
.Nd "display the system message buffer"
36
.Nd "display the system message buffer"
37
.Sh SYNOPSIS
37
.Sh SYNOPSIS
38
.Nm
38
.Nm
39
.Op Fl ac
39
.Op Fl acw
40
.Op Fl M Ar core Op Fl N Ar system
40
.Op Fl M Ar core Op Fl N Ar system
41
.Sh DESCRIPTION
41
.Sh DESCRIPTION
42
The
42
The
Lines 69-74 If Link Here
69
is also specified,
69
is also specified,
70
extract the name list from the specified system instead of the default,
70
extract the name list from the specified system instead of the default,
71
which is the kernel image the system has booted from.
71
which is the kernel image the system has booted from.
72
.It Fl w
73
Loop displaying the kernel buffer. If
74
.Fl c
75
is also specified, the kernel buffer is followed; displaying new
76
messages as they arrive.
72
.El
77
.El
73
.Sh FILES
78
.Sh FILES
74
.Bl -tag -width ".Pa /var/run/dmesg.boot" -compact
79
.Bl -tag -width ".Pa /var/run/dmesg.boot" -compact
(-)sbin/dmesg/dmesg.c (-5 / +21 lines)
Lines 81-93 main(int argc, char *argv[]) Link Here
81
	size_t buflen, bufpos;
81
	size_t buflen, bufpos;
82
	long pri;
82
	long pri;
83
	int ch, clear;
83
	int ch, clear;
84
	bool all;
84
	bool all, loop;
85
85
86
	all = false;
86
	all = loop = false;
87
	clear = false;
87
	clear = false;
88
	(void) setlocale(LC_CTYPE, "");
88
	(void) setlocale(LC_CTYPE, "");
89
	memf = nlistf = NULL;
89
	memf = nlistf = NULL;
90
	while ((ch = getopt(argc, argv, "acM:N:")) != -1)
90
	while ((ch = getopt(argc, argv, "acM:N:w")) != -1)
91
		switch(ch) {
91
		switch(ch) {
92
		case 'a':
92
		case 'a':
93
			all = true;
93
			all = true;
Lines 101-106 main(int argc, char *argv[]) Link Here
101
		case 'N':
101
		case 'N':
102
			nlistf = optarg;
102
			nlistf = optarg;
103
			break;
103
			break;
104
		case 'w':
105
			loop = true;
106
			break;
104
		case '?':
107
		case '?':
105
		default:
108
		default:
106
			usage();
109
			usage();
Lines 109-114 main(int argc, char *argv[]) Link Here
109
	if (argc != 0)
112
	if (argc != 0)
110
		usage();
113
		usage();
111
114
115
again:
116
112
	if (memf == NULL) {
117
	if (memf == NULL) {
113
		/*
118
		/*
114
		 * Running kernel.  Use sysctl.  This gives an unwrapped buffer
119
		 * Running kernel.  Use sysctl.  This gives an unwrapped buffer
Lines 203-217 main(int argc, char *argv[]) Link Here
203
			}
208
			}
204
		}
209
		}
205
210
211
		if (*p == '\0') continue;
212
206
		(void)strvisx(visbp, p, nextp - p, 0);
213
		(void)strvisx(visbp, p, nextp - p, 0);
207
		(void)printf("%s", visbp);
214
		if (*visbp != '\n') (void)printf("%s", visbp);
208
	}
215
	}
216
217
	free (bp);
218
	free (visbp);
219
220
	if (loop) {
221
		usleep(100000);
222
		goto again;
223
	}
224
209
	exit(0);
225
	exit(0);
210
}
226
}
211
227
212
void
228
void
213
usage(void)
229
usage(void)
214
{
230
{
215
	fprintf(stderr, "usage: dmesg [-ac] [-M core [-N system]]\n");
231
	fprintf(stderr, "usage: dmesg [-acw] [-M core [-N system]]\n");
216
	exit(1);
232
	exit(1);
217
}
233
}

Return to bug 215836