summaryrefslogtreecommitdiff
path: root/utils/storeinfo.c
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1995-11-06 21:18:09 +0000
committerMiles Bader <miles@gnu.org>1995-11-06 21:18:09 +0000
commite234ff742e1e383684ae8d0cd5557fabd2284682 (patch)
treec37dd14c7fcced80fefce7ae758e10bc2714d8f8 /utils/storeinfo.c
parent7449f71e5d38361546520ac90a8d55ddb483172e (diff)
(print_info):
Use the new FLAGS argument to file_get_storage_info. Add new storage types.
Diffstat (limited to 'utils/storeinfo.c')
-rw-r--r--utils/storeinfo.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/utils/storeinfo.c b/utils/storeinfo.c
index 18cfd287..00d568a8 100644
--- a/utils/storeinfo.c
+++ b/utils/storeinfo.c
@@ -68,6 +68,7 @@ static error_t
print_info (mach_port_t node, char *source, unsigned what)
{
error_t err;
+ int flags;
int first = 1;
int kind, i;
char *kind_name;
@@ -108,7 +109,7 @@ print_info (mach_port_t node, char *source, unsigned what)
}
err = file_get_storage_info (node, &kind, &runs, &runs_len, &block_size,
- name, &store_port, &misc, &misc_len);
+ name, &store_port, &misc, &misc_len, &flags);
if (err)
return err;
mach_port_deallocate (mach_task_self (), store_port);
@@ -118,10 +119,10 @@ print_info (mach_port_t node, char *source, unsigned what)
{
case STORAGE_OTHER: kind_name = "other"; break;
case STORAGE_DEVICE: kind_name = "device"; break;
- case STORAGE_DEVICE_MUTATED: kind_name = "device_mutated"; break;
case STORAGE_HURD_FILE: kind_name = "file"; break;
- case STORAGE_HURD_FILE_MUTATED: kind_name = "file_mutated"; break;
case STORAGE_NETWORK: kind_name = "network"; break;
+ case STORAGE_MEMORY: kind_name = "memory"; break;
+ case STORAGE_TASK: kind_name = "task"; break;
default:
sprintf (unknown_kind_name, "%d", kind);
kind_name = unknown_kind_name;
@@ -129,14 +130,16 @@ print_info (mach_port_t node, char *source, unsigned what)
for (i = 0; i < runs_len; i += 2)
{
- if (runs[0] >= 0)
- blocks += runs[1];
- size += runs[1];
+ if (runs[i] >= 0)
+ blocks += runs[i+1];
+ size += runs[i+1];
}
size *= block_size;
pstr (source, 0);
pstr (kind_name, W_KIND);
+ if ((flags & STORAGE_MUTATED) && (what & W_KIND))
+ fputs ("/mutated", stdout);
pstr (name, W_NAME);
pint (block_size, W_BLOCK_SIZE);
pint (blocks, W_BLOCKS);