/* TAGS: c */ #include #include #include #include #include int main() { int fd = open( "test", O_WRONLY | O_CREAT, 0644 ); assert( fd >= 0 ); struct stat st; fstat( fd, &st ); assert( ( st.st_mode & 0777 ) == 0644 ); assert( st.st_nlink == 1 ); return 0; }