From: Matthias Kruk Date: Mon, 10 Aug 2020 15:49:12 +0000 (+0900) Subject: sys/test: Print the return value of pipe() and the file descriptors that we got from... X-Git-Url: https://git.corax.cc/?a=commitdiff_plain;h=12e93679cf2d4c794035a8a97f5f7f522a5c9737;p=corax sys/test: Print the return value of pipe() and the file descriptors that we got from the IO process --- diff --git a/sys/test/main.c b/sys/test/main.c index ecba8fa..4f991c9 100644 --- a/sys/test/main.c +++ b/sys/test/main.c @@ -8,33 +8,18 @@ int main(int argc, char *argv[]) char buf[128]; int fds[2]; int ret_val; - void *abuf; - void *bbuf; - void *heap; - heap = sbrk(0); - - ret_val = snprintf(buf, sizeof(buf), "Heap base: %p / 0x%08lx\n", heap, heap); - debug(buf, ret_val); - - abuf = sbrk(2048); - - ret_val = snprintf(buf, sizeof(buf), "Allocated 4096B at %p / 0x%08lx\n", abuf, abuf); - debug(buf, ret_val); - - bbuf = malloc(4096); - - ret_val = snprintf(buf, sizeof(buf), "Allocated 4096B at %p / 0x%08x\n", bbuf, buf); - debug(buf, ret_val); - - ret_val = snprintf(buf, sizeof(buf), "Calling pipe()\n"); - debug(buf, ret_val); + fds[0] = -1; + fds[1] = -1; ret_val = pipe(fds); ret_val = snprintf(buf, sizeof(buf), "pipe() returned %u\n", ret_val); debug(buf, ret_val); + ret_val = snprintf(buf, sizeof(buf), "fds[0] = %d, fds[1] = %d\n", fds[0], fds[1]); + debug(buf, ret_val); + while(1) { #if 0 struct cxmsg msg;