lkml.org 
[lkml]   [1998]   [Dec]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: /dev/one - why not /dev/repeat?
On Fri, 25 Dec 1998, Dave Cinege wrote:

> One use would be for low level file (device) acesss as mentioned in
> the 'wipe' thread. Compounding two pipes, to strip 4,000,000,000
> line feeds, from using the 'yes' | 'tr' is slow and sloppy. It also
> assumes both commands are actually available.

There is no reason to believe that a kernel-based version would be
significantly faster or smaller than a user-space version.

cat >> repeat.c
#include <stdio.h>
int main(int argc, char **argv)
{
if (argc != 2) {
fprintf(stderr, "Usage: repeat [text]\n");
exit(1);
}
while(1)
printf("%s", argv[1]);
exit(0);
}

[dmiller@mothra dmiller]$ gcc repeat.c -o repeat
[dmiller@mothra dmiller]$ strip repeat
[dmiller@mothra dmiller]$ ls -l repeat
-rwxrwxr-x 1 dmiller dmiller 2876 Dec 26 09:36 repeat

Surely that wasn't worth all the whinging.

Regards,
Damien Miller

--
| "Bombay is 250ms from New York in the new world order" - Alan Cox
| Damien Miller - http://www.ilogic.com.au/~dmiller


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:46    [W:0.040 / U:0.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site