linux-sysprog · beginner · ~15 min

Same namespace?

Compare namespace identifiers.

Challenge

Namespaces are identified by an inode number. Implement int same_namespace(unsigned long a, unsigned long b) returning 1 if the two namespace ids are equal, else 0.

Starter code

int same_namespace(unsigned long a, unsigned long b) {
    /* TODO */
    return 0;
}

Solve this exercise in the browser editor — compile and run against the test harness, no setup required.