#include <xinu.h>
#include <stdio.h>
Go to the source code of this file.
◆ xsh_ls()
shellcmd xsh_ls |
( |
int |
nargs, |
|
|
char * |
args[] |
|
) |
| |
Definition at line 10 of file xsh_ls.c.
References fprintf(), ldentry::ld_name, LF_AREA_DIR, Lf_data, lfdata::lf_dir, lfdata::lf_dirpresent, lfdata::lf_dskdev, lfdata::lf_mutex, lfdir::lfd_files, lfdir::lfd_nfiles, lfscheck(), printf(), read(), signal(), stderr, strncmp(), SYSERR, TRUE, and wait().
18 if (nargs == 2 &&
strncmp(args[1],
"--help", 7) == 0) {
19 printf(
"Use: %s\n\n", args[0]);
21 printf(
"\tlists the names of files\n");
23 printf(
"\t--help\t display this help and exit\n");
28 printf(
"illegal option: try --help for more information\n");
42 fprintf(
stderr,
"THe disk does not contain a Xinu file system\n");
52 for (i=0; i<dirptr->lfd_nfiles; i++) {
53 ldptr = &dirptr->lfd_files[i];
int32 strncmp(const char *, const char *, int32)
syscall read(did32, char *, uint32)
int32 printf(const char *,...)
char ld_name[LF_NAME_LEN]
#define TRUE
Boolean True(1)
int int32
符号あり32ビット整数(int)
int32 fprintf(int, char *,...)
syscall signal(sid32)
セマフォにシグナルを送り、待機プロセスがある場合は解除する。
status lfscheck(struct lfdir *)