1
0
mirror of https://git.FreeBSD.org/src.git synced 2026-06-02 11:24:32 +00:00

tty: Retire zombie dtrwait

Nothing uses dtrwait anymore. This was elimianted with the tty mpsafe
rewrite for FreeBSD 8. Only these zombie symbols and functionality
remain. GC them. Add comcontrol to the list things to remove in 16.0.

Sponsored by:		Netflix
Reviewed by:		kevans, emaste
Differential Revision:	https://reviews.freebsd.org/D52317
This commit is contained in:
Warner Losh
2025-09-02 23:17:43 -06:00
parent ffe00a0522
commit 4b4cf0d52c
3 changed files with 13 additions and 39 deletions
+7 -11
View File
@@ -1,13 +1,17 @@
.Dd May 15, 1994
.Dd August 31, 2025
.Dt COMCONTROL 8
.Os
.Sh NAME
.Nm comcontrol
.Nd control a special tty device
.Sh DEPRECATION NOTICE
The
.Nm
utility is deprecated and will be removed in
.Fx 16.0 .
.Sh SYNOPSIS
.Nm
.Ar special_device
.Op dtrwait Ar number
.Op drainwait Ar number
.Sh DESCRIPTION
The
@@ -22,13 +26,6 @@ Only the superuser can change the settings.
.Pp
The following options are available:
.Bl -tag -width indent
.It Cm dtrwait Ar number
Set the time to wait after dropping DTR
to the given number.
The units are hundredths of a second.
The default is 300 hundredths, i.e., 3 seconds.
This option needed mainly to set proper recover time after
modem reset.
.It Cm drainwait Ar number
Set the time to wait for output drain
to the given number.
@@ -57,7 +54,6 @@ dialout devices
Originally part of cgd's com package patches, version 0.2.1, to
.Bx 386 0.1 .
Once controlled bidirectional capabilities.
Little is left to control now
that these capabilities are standard.
Little is left to control now that these capabilities are standard.
.Sh AUTHORS
.An Christopher G. Demetriou
+4 -26
View File
@@ -46,7 +46,7 @@ static void
usage(void)
{
fprintf(stderr,
"usage: comcontrol <filename> [dtrwait <n>] [drainwait <n>]\n");
"usage: comcontrol <filename> [drainwait <n>]\n");
exit(1);
}
@@ -55,8 +55,8 @@ main(int argc, char *argv[])
{
int fd;
int res = 0;
int print_dtrwait = 1, print_drainwait = 1;
int dtrwait = -1, drainwait = -1;
int print_drainwait = 1;
int drainwait = -1;
if (argc < 2)
usage();
@@ -71,13 +71,6 @@ main(int argc, char *argv[])
}
}
if (argc == 2) {
if (ioctl(fd, TIOCMGDTRWAIT, &dtrwait) < 0) {
print_dtrwait = 0;
if (errno != ENOTTY) {
res = 1;
warn("TIOCMGDTRWAIT");
}
}
if (ioctl(fd, TIOCGDRAINWAIT, &drainwait) < 0) {
print_drainwait = 0;
if (errno != ENOTTY) {
@@ -85,21 +78,12 @@ main(int argc, char *argv[])
warn("TIOCGDRAINWAIT");
}
}
if (print_dtrwait)
printf("dtrwait %d ", dtrwait);
if (print_drainwait)
printf("drainwait %d ", drainwait);
printf("\n");
} else {
while (argv[2] != NULL) {
if (!strcmp(argv[2],"dtrwait")) {
if (dtrwait >= 0)
usage();
if (argv[3] == NULL || !isdigit(argv[3][0]))
usage();
dtrwait = atoi(argv[3]);
argv += 2;
} else if (!strcmp(argv[2],"drainwait")) {
if (!strcmp(argv[2],"drainwait")) {
if (drainwait >= 0)
usage();
if (argv[3] == NULL || !isdigit(argv[3][0]))
@@ -109,12 +93,6 @@ main(int argc, char *argv[])
} else
usage();
}
if (dtrwait >= 0) {
if (ioctl(fd, TIOCMSDTRWAIT, &dtrwait) < 0) {
res = 1;
warn("TIOCMSDTRWAIT");
}
}
if (drainwait >= 0) {
if (ioctl(fd, TIOCSDRAINWAIT, &drainwait) < 0) {
res = 1;
+2 -2
View File
@@ -69,8 +69,8 @@
/* 89-91 conflicts: tun and tap */
#define TIOCTIMESTAMP _IOR('t', 89, struct timeval) /* enable/get timestamp
* of last input event */
#define TIOCMGDTRWAIT _IOR('t', 90, int) /* modem: get wait on close */
#define TIOCMSDTRWAIT _IOW('t', 91, int) /* modem: set wait on close */
/* TIOCMGDTRWAIT _IOR('t', 90, int) * was modem: get wait on close */
/* TIOCMSDTRWAIT _IOW('t', 91, int) * was modem: set wait on close */
/* 92-93 tun and tap */
/* 94-97 conflicts: tun and tap */
#define TIOCDRAIN _IO('t', 94) /* wait till output drained */