#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 ls.c.
14{
15 int fd;
16 int status;
18
19 if (argc != 2) {
21 return 1;
22 }
23
25 if (fd < 0) {
27 return 1;
28 }
29
30 while (1) {
32
33 status =
OSReadDir(fd, (
char *)&de,
sizeof(de), &offset);
34 if (status == 0) {
35 break;
36 }
37 if (status < 0) {
38 printf(
"OSReadDir Error: %x\n", -status);
39 return 1;
40 }
41
43 }
44
45 return 0;
46}
uint64_t OSOpen(const char *path, uint64_t flags)
int OSReadDir(uint64_t fd, char *buf, size_t length, uint64_t *offset)
int printf(const char *fmt,...)
int fputs(const char *str, FILE *fh)