]> git.corax.cc Git - corax/commitdiff
sys/test: Print the return value of pipe() and the file descriptors that we got from...
authorMatthias Kruk <m@m10k.eu>
Mon, 10 Aug 2020 15:49:12 +0000 (00:49 +0900)
committerMatthias Kruk <m@m10k.eu>
Mon, 10 Aug 2020 15:49:12 +0000 (00:49 +0900)
sys/test/main.c

index ecba8fa064d0096a6c5abb45fca069e71be6e28b..4f991c973727d629814a9dbc017321b35fd61aa9 100644 (file)
@@ -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;