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

In message <Pine.LNX.4.04.9812260929550.438-100000@mothra.ilogic.com.au>, Damie
n Miller wrote:
} 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.
Indeed, even statically linked on my FreeBSD system, that's only 40960 bytes
in size. Change the printf's to fputs calls, and it shrinks to 16384 bytes.
Hardly worth all the hoopla, and certainly not of enough utility to
warrant putting it in the kernel. Then again, Dave is arguing that you
might not be able to rely upon ``yes'' or ``tr'' even being available,
so he's either grasping at straws, or unwilling to admit that such a
situation is far removed from ordinary use.

--
Jon Hamilton
hamilton@pobox.com


-
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    [from the cache]
©2003-2011 Jasper Spaans. Advertise on this site