aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2021-07-22 16:50:09 -0400
committerB. Watson <yalhcru@gmail.com>2021-07-22 16:50:09 -0400
commit77fb4c791241998a85496388337a2d4c80e512c7 (patch)
treefcc37e0fdbbf3e9384121d91dbebebf02f5d588b
parent94551e832f65bc95f21925d8b9ae51044536b3a5 (diff)
downloadslowbaud-77fb4c791241998a85496388337a2d4c80e512c7.tar.gz
Add -b (benchmark) flag
-rw-r--r--README.txt67
-rw-r--r--slowbaud.162
-rw-r--r--slowbaud.c49
-rw-r--r--slowbaud.rst58
-rw-r--r--test.sh6
5 files changed, 161 insertions, 81 deletions
diff --git a/README.txt b/README.txt
index d9e2c32..870f356 100644
--- a/README.txt
+++ b/README.txt
@@ -10,6 +10,8 @@ SYNOPSIS
slowbaud [<bits-per-sec>] -e <string> [<string> ...]
+ slowbaud [<bits-per-sec>] -b [<bytes>]
+
DESCRIPTION
slowbaud by default acts as a filter, or like the cat(1) command. It reads
files or its standard input, and writes the contents unmodified to standard
@@ -17,7 +19,7 @@ DESCRIPTION
unbuffered.
slowbaud can also act like echo(1) (the -e option), or run an interactive com‐
- mand (the -c option).
+ mand in a pseudo-tty (the -c option).
The <bits-per-sec> argument is optional. If it's not given, the bit rate will
be set from SLOWBAUD_BPS in the environment, or a built-in default of 2400 if
@@ -25,46 +27,58 @@ DESCRIPTION
OPTIONS
bits-per-sec
- The bit ("baud") rate to simulate. This must be the first argument.
- slowbaud assumes that if the first argument is a number, it's the bit
- rate. If you're trying to pass a filename that consists only of dig‐
- its, give -- as the first argument, or use e.g. ./filename.
+ The bit ("baud") rate to simulate. Range is 1 to 500000. This must be
+ the first argument. slowbaud assumes that if the first argument is a
+ number, it's the bit rate. If you're trying to pass a filename that
+ consists only of digits, give -- as the first argument, or use e.g.
+ ./filename.
-e Echo mode. Prints all further arguments as strings to stdout, separated
- by a single space, at the given bit rate. Does not support back‐
- slash-escapes, or any of the options of the regular echo command.
+ by a single space, at the given bit rate. Does not support back‐
+ slash-escapes, or any of the options of the regular echo command. At
+ least one argument is required after -e.
-c Command mode. Next argument (if present) is the command to run, any
remaining arguments become arguments to the command. With no arguments
after -c, a shell is spawned. This creates a pseudo-tty, so the com‐
mand can be interactive.
+ -b Benchmark mode. Prints <bytes> (or 4096, if no <bytes> given) bytes of
+ zeroes to /dev/null. Mostly useful for development and troubleshooting.
+
+ -h, -? Show built-in help message and exit.
+
ENVIRONMENT
SLOWBAUD_BPS
- Can be used to set the bit rate, when no <bits-per-sec> argument is
+ Can be used to set the bit rate, when no <bits-per-sec> argument is
used.
SLOWBAUD_DEBUG
- Set this (to any value) in the environment to see verbose debug output
+ Set this (to any value) in the environment to see verbose debug output
on stderr, including timing accuracy stats.
SHELL Standard *nix environment variable, used to determine what shell to run
when -c is given with no <command>. If unset, /bin/sh is used.
EXIT STATUS
- Without -c, 0 for success, non-zero on any error such as nonexistent/unread‐
- able files. slowbaud exits immediately on such errors (this is unlike cat(1)).
+ Without -c or -e, 0 for success, non-zero on any error such as nonexis‐
+ tent/unreadable files. slowbaud exits immediately on such errors (this is
+ unlike cat(1)).
+
+ With -e, exit status is 0, unless there were no arguments to echo.
With -c, exit status is that of the child process, or 127 if the child process
couldn't be spawned (e.g. command not found). Of course, the child process
could also exit with status 127...
+ With -b, exit status is 0, unless something catastrophic happened (e.g. unable
+ to open /dev/null for writing).
+
NOTES
- The bitrate has a range of 1 to 500000. Timing accuracy depends on your OS,
- kernel config (HZ and/or NO_HZ on Linux), and system load. No "fancy" tech‐
- niques like realtime scheduling or hardware event timers are used. At bitrates
- up to 57600, on a typical unloaded Linux system, the timing should be at least
- 99.7% accurate.
+ Timing accuracy depends on your OS, kernel config (HZ and/or NO_HZ on Linux),
+ and system load. No "fancy" techniques like realtime scheduling or hardware
+ event timers are used. At bitrates up to 57600, on a typical unloaded Linux
+ system, the timing should be at least 99.7% accurate.
We can't really insert a delay between the bits of a byte, since I/O is done
with byte granularity. For calculation purposes, <bits-per-sec> is divided by
@@ -77,8 +91,8 @@ NOTES
works well, and the CPU overhead is barely noticeable (at least on reasonably
fast modern systems).
- The timing error will almost always result in the bitrate being slightly too
- slow at lower bitrates and slightly too fast at higher ones.
+ The timing inaccuracy will almost always result in the bitrate being slightly
+ too slow.
Timing is more accurate on Linux than OSX. It's done with getitimer() and sig‐
wait(). This works out to be slightly more accurate than using usleep() on
@@ -86,23 +100,24 @@ NOTES
and clock_gettime() API on Linux, for possibly even better accuracy, but OSX
doesn't have these (and I want to be portable).
- If this were a truly useful application, it would be worth trying to decrease
- latency further, with realtime process scheduling. I didn't do this because
+ If this were a truly useful application, it would be worth trying to increase
+ accuracy further, with realtime process scheduling. I didn't do this because
slowbaud is just a toy, and because the RT stuff tends to be unportable and
require elevated privileges (root, or something like setrtlimit or extended
filesystem attributes to manage capabilities).
About the name... I'm aware that "baud" is not synonymous with bps. I just
think "slowbaud" sounds better than "slowbps", as a name. Anyway the stty com‐
- mand on Linux misuses the term ("speed 38400 baud"), so I'm in good company.
+ mand on both Linux and OSX misuses the term ("speed 38400 baud"), as well as
+ the man page for termios(3), so I'm in good company.
BUGS
- With -c, signals aren't handled gracefully. Window size changes (SIGWINCH)
- don't get propagated to the child process, and pressing ^C doesn't interrupt
- the process. Yet.
+ With -c, signals aren't handled gracefully. Window size changes (SIGWINCH)
+ don't get propagated to the child process, and pressing ^C doesn't interrupt
+ the process until all pending output is processed.
COPYRIGHT
- slowbaud is copyright 2021, B. Watson <yalhcru@gmail.com>. Released under the
+ slowbaud is copyright 2021, B. Watson <yalhcru@gmail.com>. Released under the
WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
-0.0.1 2021-07-21 SLOWBAUD(1)
+0.0.1 2021-07-22 SLOWBAUD(1)
diff --git a/slowbaud.1 b/slowbaud.1
index c25d8e9..863383d 100644
--- a/slowbaud.1
+++ b/slowbaud.1
@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
-.TH SLOWBAUD 1 "2021-07-21" "0.0.1" "Urchlay's Useless Stuff"
+.TH SLOWBAUD 1 "2021-07-22" "0.0.1" "Urchlay's Useless Stuff"
.SH NAME
slowbaud \- simulate a low bitrate serial connection
.
@@ -36,6 +36,12 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
.
.\" rst2man.py comes from the SBo development/docutils package.
.
+.\" Note: if you edit this, run "make" to recreate the man page and README,
+.
+.\" *then* do a "git commit -a". Even though they're generated files, the man
+.
+.\" page and README.txt are tracked by git.
+.
.SH SYNOPSIS
.sp
\fBslowbaud\fP [\fI<bits\-per\-sec>\fP] [\fI<file>\fP ...]
@@ -43,6 +49,8 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
\fBslowbaud\fP [\fI<bits\-per\-sec>\fP] \fB\-c\fP [\fI<command>\fP [\fI<arg>\fP ...]]
.sp
\fBslowbaud\fP [\fI<bits\-per\-sec>\fP] \fB\-e\fP \fI<string>\fP [\fI<string>\fP ...]
+.sp
+\fBslowbaud\fP [\fI<bits\-per\-sec>\fP] \fB\-b\fP [\fI<bytes>\fP]
.SH DESCRIPTION
.sp
slowbaud by default acts as a filter, or like the \fBcat(1)\fP command. It
@@ -51,7 +59,7 @@ to standard output... but slowly, at the given bits\-per\-second rate.
Input and output are unbuffered.
.sp
slowbaud can also act like \fBecho(1)\fP (the \fB\-e\fP option), or run an
-interactive command (the \fB\-c\fP option).
+interactive command in a pseudo\-tty (the \fB\-c\fP option).
.sp
The \fI<bits\-per\-sec>\fP argument is optional. If it\(aqs not given, the
bit rate will be set from \fBSLOWBAUD_BPS\fP in the environment, or a
@@ -60,20 +68,29 @@ built\-in default of 2400 if not set.
.INDENT 0.0
.TP
.B \fBbits\-per\-sec\fP
-The bit ("baud") rate to simulate. This must be the first argument.
-slowbaud assumes that if the first argument is a number, it\(aqs the bit rate.
-If you\(aqre trying to pass a filename that consists only of digits, give
-\fB\-\-\fP as the first argument, or use e.g. \fI\&./filename\fP\&.
+The bit ("baud") rate to simulate. Range is 1 to 500000. This
+must be the first argument. slowbaud assumes that if the first
+argument is a number, it\(aqs the bit rate. If you\(aqre trying to pass
+a filename that consists only of digits, give \fB\-\-\fP as the first
+argument, or use e.g. \fI\&./filename\fP\&.
.TP
.B \fB\-e\fP
Echo mode. Prints all further arguments as strings to stdout, separated
by a single space, at the given bit rate. Does not support backslash\-escapes, or any of
-the options of the regular \fBecho\fP command.
+the options of the regular \fBecho\fP command. At least one argument is required
+after \fB\-e\fP\&.
.TP
.B \fB\-c\fP
Command mode. Next argument (if present) is the command to run, any remaining arguments
become arguments to the command. With no arguments after \fB\-c\fP, a shell is spawned.
This creates a pseudo\-tty, so the command can be interactive.
+.TP
+.B \fB\-b\fP
+Benchmark mode. Prints \fI<bytes>\fP (or 4096, if no \fI<bytes>\fP given) bytes of
+zeroes to /dev/null. Mostly useful for development and troubleshooting.
+.TP
+.B \fB\-h\fP, \fB\-?\fP
+Show built\-in help message and exit.
.UNINDENT
.SH ENVIRONMENT
.INDENT 0.0
@@ -92,20 +109,25 @@ unset, \fB/bin/sh\fP is used.
.UNINDENT
.SH EXIT STATUS
.sp
-Without \fB\-c\fP, 0 for success, non\-zero on any error such as
+Without \fB\-c\fP or \fB\-e\fP, 0 for success, non\-zero on any error such as
nonexistent/unreadable files. slowbaud exits immediately on such
errors (this is unlike \fBcat(1)\fP).
.sp
+With \fB\-e\fP, exit status is 0, unless there were no arguments to echo.
+.sp
With \fB\-c\fP, exit status is that of the child process, or 127 if
the child process couldn\(aqt be spawned (e.g. command not found).
Of course, the child process could also exit with status 127...
+.sp
+With \fB\-b\fP, exit status is 0, unless something catastrophic happened
+(e.g. unable to open \fB/dev/null\fP for writing).
.SH NOTES
.sp
-The bitrate has a range of 1 to 500000. Timing accuracy depends on
-your OS, kernel config (HZ and/or NO_HZ on Linux), and system load. No
-"fancy" techniques like realtime scheduling or hardware event timers
-are used. At bitrates up to 57600, on a typical unloaded Linux system,
-the timing should be at least 99.7% accurate.
+Timing accuracy depends on your OS, kernel config (HZ and/or NO_HZ
+on Linux), and system load. No "fancy" techniques like realtime
+scheduling or hardware event timers are used. At bitrates up to 57600,
+on a typical unloaded Linux system, the timing should be at least
+99.7% accurate.
.sp
We can\(aqt really insert a delay between the bits of a byte, since
I/O is done with byte granularity. For calculation purposes,
@@ -119,9 +141,8 @@ than that, then busy\-waiting until the rest of the interval expires.
At slower bitrates, this works well, and the CPU overhead is barely
noticeable (at least on reasonably fast modern systems).
.sp
-The timing error will almost always result in the bitrate
-being slightly too slow at lower bitrates and slightly too fast at
-higher ones.
+The timing inaccuracy will almost always result in the bitrate
+being slightly too slow.
.sp
Timing is more accurate on Linux than OSX. It\(aqs done with getitimer()
and sigwait(). This works out to be slightly more accurate than
@@ -131,20 +152,21 @@ possibly even better accuracy, but OSX doesn\(aqt have these (and I want to be
portable).
.sp
If this were a truly useful application, it would be worth trying to
-decrease latency further, with realtime process scheduling. I didn\(aqt
+increase accuracy further, with realtime process scheduling. I didn\(aqt
do this because slowbaud is just a toy, and because the RT stuff tends
to be unportable and require elevated privileges (root, or something
like setrtlimit or extended filesystem attributes to manage capabilities).
.sp
About the name... I\(aqm aware that "baud" is not synonymous with bps. I
just think "slowbaud" sounds better than "slowbps", as a name. Anyway
-the stty command on Linux misuses the term ("speed 38400 baud"), so
-I\(aqm in good company.
+the stty command on both Linux and OSX misuses the term ("speed
+38400 baud"), as well as the man page for termios(3), so I\(aqm in good
+company.
.SH BUGS
.sp
With \fB\-c\fP, signals aren\(aqt handled gracefully. Window size changes
(SIGWINCH) don\(aqt get propagated to the child process, and pressing ^C
-doesn\(aqt interrupt the process. Yet.
+doesn\(aqt interrupt the process until all pending output is processed.
.SH COPYRIGHT
.sp
slowbaud is copyright 2021, B. Watson <\fI\%yalhcru@gmail.com\fP>. Released
diff --git a/slowbaud.c b/slowbaud.c
index bbf31ac..63a8a3b 100644
--- a/slowbaud.c
+++ b/slowbaud.c
@@ -26,7 +26,7 @@
#include <pty.h>
#endif
-#define DEFAULT_BPS 1200
+#define DEFAULT_BPS 2400
#define MIN_BPS 1
#define MAX_BPS 500000
@@ -67,6 +67,8 @@ void setup_timer(void) {
sigprocmask(SIG_BLOCK, &sigmask, NULL);
}
+/* on both Linux and OSX, using setitimer() and sigwait() gives better
+ timing accuracy than usleep() or nanosleep(). */
void slow_write(int outfd, char c) {
int j;
unsigned long now, target, overslept;
@@ -84,13 +86,8 @@ void slow_write(int outfd, char c) {
if(now > target) {
overslept = now - target;
if(overslept < interval) {
- unsigned long old = itv.it_interval.tv_usec;
itv.it_interval.tv_usec -= overslept;
itv.it_value.tv_usec = itv.it_interval.tv_usec;
- if(debug) {
- fprintf(stderr, "tv_usec was %ldms, overslept %ld, new tv_usec %ldms\n",
- old, overslept, itv.it_interval.tv_usec);
- }
}
} else {
while(NOW_USEC() < target)
@@ -99,24 +96,25 @@ void slow_write(int outfd, char c) {
}
void debug_stats(void) {
- if(outbytes && debug) {
+ if(outbytes) {
unsigned long elapsed_us = NOW_USEC() - starttime;
double elapsed_sec = ((double)elapsed_us/1000000.0L);
double finterval = (1000000.0L / ((double)bps / 10.0L));
double actual = ((double)outbytes * 10.0L) / elapsed_sec;
double offby = 100.0L * (((double)bps / actual) - 1.0L);
fprintf(stderr,
- "outbytes %lu, elapsed_us %lu, requested bps %d (%.2fms), "
+ "outbytes %lu, elapsed_us %lu, tv_usec %lu, requested bps %d (%.2fms), "
"actual %.2f, accuracy %.2f%%\n",
- outbytes, elapsed_us, bps, finterval, actual, 100.0 - offby);
+ outbytes, elapsed_us, itv.it_value.tv_usec, bps, finterval, actual, 100.0 - offby);
}
- outbytes = 0;
}
void slowcat(int infd) {
int c;
+ outbytes = 0;
starttime = NOW_USEC();
+
while(read(infd, &c, 1) == 1) {
slow_write(1, c);
}
@@ -216,12 +214,32 @@ void echo_args(char **args) {
exit(0);
}
+void benchmark(char **args) {
+ int bytes = 0, devnull;
+
+ if(*args) bytes = atoi(*args);
+ if(bytes < 1) bytes = 4096;
+ fprintf(stderr, "benchmarking with %d bytes\n", bytes);
+
+ devnull = open("/dev/null", O_RDONLY);
+ if(devnull < 1) die("/dev/null");
+
+ starttime = NOW_USEC();
+ while(bytes--)
+ slow_write(devnull, 0);
+ close(devnull);
+
+ debug_stats();
+ exit(0);
+}
+
void usage(int exitstat) {
printf("Usage: %s [<bits-per-sec>] [<file> [<file> ...]]\n", self);
printf(" With no filenames, reads stdin.\n");
printf("or: %s [<bits-per-sec>] -c [<command> [<arg> ...]]\n", self);
printf(" With no command, spawns a shell.\n");
printf("or: %s [<bits-per-sec>] -e <string> [<string> ...]\n", self);
+ printf("or: %s [<bits-per-sec>] -b [<bytes>]\n", self);
printf("With no <bits-per-sec>, default rate is %d\n", DEFAULT_BPS);
exit(exitstat);
}
@@ -232,6 +250,7 @@ int main(int argc, char **argv) {
if(getenv("SLOWBAUD_DEBUG")) debug = 1;
+ /* for usage message, we want "slowbaud", not "/path/to/slowbaud" */
self = argv[0];
for(p = argv[0]; *p; p++) {
if(*p == '/') self = p + 1;
@@ -259,7 +278,12 @@ int main(int argc, char **argv) {
}
/* if we used only integer math here, we couldn't support bps not
- a multiple of 10 (e.g. 75 would be taken as 70). */
+ a multiple of 10 (e.g. 75 would be taken as 70).
+ We still have a rounding problem: 115200bps is 86.81ms/char, but
+ it gets rounded down to 86 here. Which would be around 116279bps,
+ or almost 1% too fast. We never reach 100% speed anyway, so the
+ loss from overhead actually offsets the extra bit of speed.
+ */
interval = (unsigned long)(1000000.0L / ((double)bps / 10.0L));
if(debug) fprintf(stderr, "interval %ld us\n", interval);
@@ -284,6 +308,9 @@ int main(int argc, char **argv) {
if(debug) fprintf(stderr, "-e given, echoing args\n");
echo_args(++argv);
break;
+ case 'b':
+ benchmark(++argv);
+ break;
case 'h':
case '?':
usage(0);
diff --git a/slowbaud.rst b/slowbaud.rst
index e88f890..e270df7 100644
--- a/slowbaud.rst
+++ b/slowbaud.rst
@@ -2,6 +2,10 @@
.. rst2man.py slowbaud.rst > slowbaud.1
.. rst2man.py comes from the SBo development/docutils package.
+.. Note: if you edit this, run "make" to recreate the man page and README,
+.. *then* do a "git commit -a". Even though they're generated files, the man
+.. page and README.txt are tracked by git.
+
.. |version| replace:: 0.0.1
.. |date| date::
@@ -27,6 +31,8 @@ SYNOPSIS
**slowbaud** [*<bits-per-sec>*] **-e** *<string>* [*<string>* ...]
+**slowbaud** [*<bits-per-sec>*] **-b** [*<bytes>*]
+
DESCRIPTION
===========
@@ -36,7 +42,7 @@ to standard output... but slowly, at the given bits-per-second rate.
Input and output are unbuffered.
slowbaud can also act like **echo(1)** (the **-e** option), or run an
-interactive command (the **-c** option).
+interactive command in a pseudo-tty (the **-c** option).
The *<bits-per-sec>* argument is optional. If it's not given, the
bit rate will be set from **SLOWBAUD_BPS** in the environment, or a
@@ -46,21 +52,30 @@ OPTIONS
=======
**bits-per-sec**
- The bit ("baud") rate to simulate. This must be the first argument.
- slowbaud assumes that if the first argument is a number, it's the bit rate.
- If you're trying to pass a filename that consists only of digits, give
- **--** as the first argument, or use e.g. *./filename*.
+ The bit ("baud") rate to simulate. Range is 1 to 500000. This
+ must be the first argument. slowbaud assumes that if the first
+ argument is a number, it's the bit rate. If you're trying to pass
+ a filename that consists only of digits, give **--** as the first
+ argument, or use e.g. *./filename*.
**-e**
Echo mode. Prints all further arguments as strings to stdout, separated
by a single space, at the given bit rate. Does not support backslash-escapes, or any of
- the options of the regular **echo** command.
+ the options of the regular **echo** command. At least one argument is required
+ after **-e**.
**-c**
Command mode. Next argument (if present) is the command to run, any remaining arguments
become arguments to the command. With no arguments after **-c**, a shell is spawned.
This creates a pseudo-tty, so the command can be interactive.
+**-b**
+ Benchmark mode. Prints *<bytes>* (or 4096, if no *<bytes>* given) bytes of
+ zeroes to /dev/null. Mostly useful for development and troubleshooting.
+
+**-h**, **-?**
+ Show built-in help message and exit.
+
ENVIRONMENT
===========
@@ -79,22 +94,27 @@ ENVIRONMENT
EXIT STATUS
===========
-Without **-c**, 0 for success, non-zero on any error such as
+Without **-c** or **-e**, 0 for success, non-zero on any error such as
nonexistent/unreadable files. slowbaud exits immediately on such
errors (this is unlike **cat(1)**).
+With **-e**, exit status is 0, unless there were no arguments to echo.
+
With **-c**, exit status is that of the child process, or 127 if
the child process couldn't be spawned (e.g. command not found).
Of course, the child process could also exit with status 127...
+With **-b**, exit status is 0, unless something catastrophic happened
+(e.g. unable to open **/dev/null** for writing).
+
NOTES
=====
-The bitrate has a range of 1 to 500000. Timing accuracy depends on
-your OS, kernel config (HZ and/or NO_HZ on Linux), and system load. No
-"fancy" techniques like realtime scheduling or hardware event timers
-are used. At bitrates up to 57600, on a typical unloaded Linux system,
-the timing should be at least 99.7% accurate.
+Timing accuracy depends on your OS, kernel config (HZ and/or NO_HZ
+on Linux), and system load. No "fancy" techniques like realtime
+scheduling or hardware event timers are used. At bitrates up to 57600,
+on a typical unloaded Linux system, the timing should be at least
+99.7% accurate.
We can't really insert a delay between the bits of a byte, since
I/O is done with byte granularity. For calculation purposes,
@@ -108,9 +128,8 @@ than that, then busy-waiting until the rest of the interval expires.
At slower bitrates, this works well, and the CPU overhead is barely
noticeable (at least on reasonably fast modern systems).
-The timing error will almost always result in the bitrate
-being slightly too slow at lower bitrates and slightly too fast at
-higher ones.
+The timing inaccuracy will almost always result in the bitrate
+being slightly too slow.
Timing is more accurate on Linux than OSX. It's done with getitimer()
and sigwait(). This works out to be slightly more accurate than
@@ -120,22 +139,23 @@ possibly even better accuracy, but OSX doesn't have these (and I want to be
portable).
If this were a truly useful application, it would be worth trying to
-decrease latency further, with realtime process scheduling. I didn't
+increase accuracy further, with realtime process scheduling. I didn't
do this because slowbaud is just a toy, and because the RT stuff tends
to be unportable and require elevated privileges (root, or something
like setrtlimit or extended filesystem attributes to manage capabilities).
About the name... I'm aware that "baud" is not synonymous with bps. I
just think "slowbaud" sounds better than "slowbps", as a name. Anyway
-the stty command on Linux misuses the term ("speed 38400 baud"), so
-I'm in good company.
+the stty command on both Linux and OSX misuses the term ("speed
+38400 baud"), as well as the man page for termios(3), so I'm in good
+company.
BUGS
====
With **-c**, signals aren't handled gracefully. Window size changes
(SIGWINCH) don't get propagated to the child process, and pressing ^C
-doesn't interrupt the process. Yet.
+doesn't interrupt the process until all pending output is processed.
COPYRIGHT
=========
diff --git a/test.sh b/test.sh
index 81edd29..84d3ee9 100644
--- a/test.sh
+++ b/test.sh
@@ -1,13 +1,9 @@
#!/bin/sh
bytes=${1:-100}
-rm -f x.$bytes
-dd if=/dev/zero of=x.$bytes bs=$bytes count=1
make &>/dev/null
for i in 300 1200 2400 4800 9600 19200 33600 57600 115200; do
- SLOWBAUD_DEBUG=1 time ./slowbaud $i x.$bytes >/dev/null
+ SLOWBAUD_DEBUG=1 time ./slowbaud $i -b $bytes
done 2>&1 | tee test.out
-
-rm -f x.$bytes