Added a new write_stat() call to the file descriptor operations (plus syscall).

Renamed sys_read_stat() to sys_read_path_stat() - sys_read_stat() is now
the fd operation (same for the corresponding write call).
Removed the sys_write_attr_stat() call because it is no longer needed.
Added stat(), fstat(), and other POSIX calls to the kernel - many are still
missing (mainly from stdio).
Added symbols (but no implementation) for unistd.h's process id functions.
Adapted libroot calls that used sys_read_stat() before to the new architecture.
module.c and bus_man.c now use stat() directly instead of the sys_read_path_stat()
call.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1555 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2002-10-17 03:09:25 +00:00
parent 8e5ca65bc9
commit f4e51a2dfb
17 changed files with 315 additions and 197 deletions
+7 -7
View File
@@ -166,22 +166,22 @@ int cmd_pwd(int argc, char *argv[])
int cmd_stat(int argc, char *argv[])
{
int rc;
struct stat stat;
struct stat st;
if (argc < 2) {
printf("not enough arguments to stat\n");
return 0;
}
rc = sys_read_stat(argv[1], true, &stat);
rc = stat(argv[1], &st);
if (rc >= 0) {
printf("stat of file '%s': \n", argv[1]);
printf("vnid 0x%x\n", (unsigned int)stat.st_ino);
// printf("type %d\n", stat.type);
printf("size %d\n", (int)stat.st_size);
} else {
printf("vnid 0x%x\n", (unsigned int)st.st_ino);
printf("type %d\n", st.st_type);
printf("size %d\n", (int)st.st_size);
} else
printf("stat failed for file '%s'\n", argv[1]);
}
return 0;
}