Bind outputs an error when it fails
authorBarret Rhoden <brho@cs.berkeley.edu>
Tue, 1 Jul 2014 23:23:48 +0000 (16:23 -0700)
committerBarret Rhoden <brho@cs.berkeley.edu>
Tue, 1 Jul 2014 23:23:48 +0000 (16:23 -0700)
And it turns out we haven't been binding #p to /proc!

tests/bind.c

index 564cf80..d61bda7 100644 (file)
@@ -47,5 +47,7 @@ int main(int argc, char *argv[])
        printf("bind %s -> %s flag %d\n", src_path, onto_path, flag);
        ret = syscall(SYS_nbind, src_path, strlen(src_path), onto_path,
                      strlen(onto_path), flag);
+       if (ret < 0)
+               perror("Bind failed");
        return ret;
 }