warning
openat() flags are the same of open()
openat() flags are the same of open()
Correctly distinguish a directory