a quick C cat

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2020-06-03 07:00:06 +00:00
parent 17ed296e2d
commit 6202b44eba
5 changed files with 88 additions and 68 deletions

13
userland/c/cat.c Normal file
View File

@@ -0,0 +1,13 @@
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <lkmc/file_io.h>
int main(int argc, char **argv) {
assert(argc == 2);
char *s = lkmc_file_read(argv[1]);
puts(s);
free(s);
return EXIT_SUCCESS;
}