networking · beginner · ~15 min

Abstract socket address?

Distinguish abstract from filesystem sockets.

Challenge

In our notation an abstract-namespace unix socket starts with '@'. Implement int is_abstract(const char *path) returning 1 if path begins with '@', else 0.

Starter code

int is_abstract(const char *path) {
    /* TODO */
    return 0;
}

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