INT64_T chirp_global_lsalloc(const char *host, const char *path, char *alloc_path, INT64_T * size, INT64_T * inuse, time_t stoptime) { if(is_multi_path(host)) { errno = EACCES; return -1; } else if(not_empty(host)) { return chirp_reli_lsalloc(host, path, alloc_path, size, inuse, stoptime); } else { errno = EACCES; return -1; } }
static INT64_T do_lsalloc(int argc, char **argv) { char full_path[CHIRP_PATH_MAX]; char alloc_path[CHIRP_PATH_MAX]; INT64_T total, inuse; int result; if(argc != 2) argv[1] = "."; complete_remote_path(argv[1], full_path); result = chirp_reli_lsalloc(current_host, full_path, alloc_path, &total, &inuse, stoptime); if(result >= 0) { printf("%s\n", alloc_path); printf("%sB TOTAL\n", string_metric(total, -1, 0)); printf("%sB INUSE\n", string_metric(inuse, -1, 0)); } return result; }