int main(void) { print_statfs("/proc/self/status", "PROC_SUPER_MAGIC"); print_statfs(".", NULL); long rc = SYSCALL_INVOKE("", -1, 0, sizeof(STRUCT_STATFS)); const char *errstr = sprintrc(rc); PRINT_SYSCALL_HEADER("", -1, sizeof(STRUCT_STATFS)); printf("NULL) = %s\n", errstr); #ifdef CHECK_ODD_SIZE const unsigned long addr = (unsigned long) 0xfacefeeddeadbeef; rc = SYSCALL_INVOKE("", -1, addr, sizeof(STRUCT_STATFS) + 1); errstr = sprintrc(rc); PRINT_SYSCALL_HEADER("", -1, sizeof(STRUCT_STATFS) + 1); printf("%#lx) = %s\n", addr, errstr); #endif puts("+++ exited with 0 +++"); return 0; }
int chirp_do_statfs(int argc, char **argv) { if (argc != 3) { printf("condor_chirp statfs remotepath\n"); return -1; } struct chirp_client *client = 0; CONNECT_STARTER(client); struct chirp_statfs statfs; int status = chirp_client_statfs(client, argv[2], &statfs); if(status >= 0) { print_statfs(&statfs); } DISCONNECT_AND_RETURN(client, status); }