open(2) packs its options into one int: O_CREAT, O_APPEND, O_TRUNC and O_NONBLOCK are independent bits ored together, and the kernel tests each with a single and instead of parsing a list of options. The low two bits are not a set - they are a small field holding O_RDONLY, O_WRONLY or O_RDWR, and O_RDONLY is 0, so that part is read with a mask and a compare rather than a bit test. Permissions are pure bits again: chmod stores read, write and execute for owner, group and other as nine of them, which is why 0644 is a readable way to write a set, and a new flag costs a bit rather than a new argument.