networking · beginner · ~15 min
Add a flag bit with bitwise OR.
Implement int add_nonblock(int flags, int o_nonblock) returning flags with the O_NONBLOCK bit OR-ed in.
int add_nonblock(int flags, int o_nonblock) {
/* TODO */
return flags;
}
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.