#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <syscall.h>
#include <sys/syscall.h>
#include <sys/dirent.h>
Go to the source code of this file.
|
int | main (int argc, const char *argv[]) |
|
◆ main()
int main |
( |
int |
argc, |
|
|
const char * |
argv[] |
|
) |
| |
Definition at line 13 of file cat.c.
14{
15 int i;
16 int status, fd;
19
20 if (argc < 2) {
22 return 1;
23 }
24
25 if (argc > 2) {
26 fputs(
"Too many arguments, expected one\n",
stdout);
27 return 1;
28 }
29
30 status =
OSStat(argv[1], &sb);
31 if (status != 0) {
33 return 0;
34 }
36 for (i = 0; i < sb.st_size; i += 256) {
37 int len = (sb.st_size - i > 256) ? 256 : (sb.st_size - i);
38
41 }
42
43 return 0;
44}
int OSRead(uint64_t fd, void *addr, uint64_t off, uint64_t length)
uint64_t OSOpen(const char *path, uint64_t flags)
int OSWrite(uint64_t fd, const void *addr, uint64_t off, uint64_t length)
int OSStat(const char *path, struct stat *sb)
int fputs(const char *str, FILE *fh)