On Tue, 4 Jan 2000, Brian Dean wrote:

> Since no one seems to recall why these features were removed, and I
> don't see any reference to them in the CVS log, would someone please

The were gone in the base version (4.4Lite1).

> consider applying the included patch to re-enable them?

> +static int
> +nap ( int microsec )
> +{
> +        int rc;
> +
> +        rc = usleep ( microsec );
> +        if (rc != 0) {
> +                fprintf ( stderr, 
> +                          "warning: ldelay or cdelay interrupted, "
> +                          "delay time cut short: %s\n",
> +                          strerror(errno) );
> +        }
> +
> +        return 0;
> +}

usleep() has a resolution of 2/HZ seconds (normally 20msec), so the above
gives very slow output (50-100 cps).  Using a low baud rate (500-1000 bps)
give the same result.  If you want a shorter delay/faster output, then
there is nothing better than a busy-wait loop for implementing nap().
Using a not so low baud rate (1200+ bps) may work better.  Perhaps nap()
was dropped because it can't be implemented reasonably.

>  /*
>   * FTP - send single character
>   *  wait for echo & handle timeout
> @@ -573,15 +592,11 @@
>  
>         cc = c;
>         xpwrite(FD, &cc, 1);
> -#ifdef notdef
>         if (number(value(CDELAY)) > 0 && c != '\r')
>                 nap(number(value(CDELAY)));
> -#endif
>         if (!boolean(value(ECHOCHECK))) {
> -#ifdef notdef
>                 if (number(value(LDELAY)) > 0 && c == '\r')
>                         nap(number(value(LDELAY)));
> -#endif
>                 return;
>         }
>  tryagain:

This seems to rely on the driver adding a suitable delay for the c == '\r'
case.  The tty driver has never supported delays for special characters.
The necessary delays are even harder to implement in the kernel than in
userland, since timeout() resolution is the same as usleep() resolution
and busy waiting is not acceptable in the kernel.

Bruce



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to