Changeset 2db4ac8 in mainline
- Timestamp:
- 2008-01-27T16:19:25Z (17 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 15b9970
- Parents:
- 72bde81
- Location:
- uspace
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/libc/include/fcntl.h
r72bde81 r2db4ac8 36 36 #define LIBC_FCNTL_H_ 37 37 38 #define O_CREAT 1 39 #define O_EXCL 2 40 #define O_TRUNC 4 41 #define O_APPEND 8 42 #define O_RDONLY 16 43 #define O_RDWR 32 44 #define O_WRONLY 64 45 38 46 extern int open(const char *, int, ...); 39 47 -
uspace/srv/vfs/vfs_ops.c
r72bde81 r2db4ac8 48 48 #include <unistd.h> 49 49 #include <ctype.h> 50 #include <fcntl.h> 50 51 #include <assert.h> 51 52 #include <atomic.h> … … 292 293 size_t len; 293 294 295 if (oflag & O_CREAT) 296 lflag |= L_CREATE; 297 if (oflag & O_EXCL) 298 lflag |= L_EXCLUSIVE; 299 294 300 ipc_callid_t callid; 295 301 … … 326 332 * triplet. 327 333 */ 328 rwlock_read_lock(&namespace_rwlock); 334 if (lflag & L_CREATE) 335 rwlock_write_lock(&namespace_rwlock); 336 else 337 rwlock_read_lock(&namespace_rwlock); 329 338 330 339 /* The path is now populated and we can call vfs_lookup_internal(). */ … … 332 341 rc = vfs_lookup_internal(path, len, lflag, &lr, NULL); 333 342 if (rc) { 334 rwlock_read_unlock(&namespace_rwlock); 343 if (lflag & L_CREATE) 344 rwlock_write_unlock(&namespace_rwlock); 345 else 346 rwlock_read_unlock(&namespace_rwlock); 335 347 ipc_answer_0(rid, rc); 336 348 free(path); … … 342 354 343 355 vfs_node_t *node = vfs_node_get(&lr); 344 rwlock_read_unlock(&namespace_rwlock); 356 if (lflag & L_CREATE) 357 rwlock_write_unlock(&namespace_rwlock); 358 else 359 rwlock_read_unlock(&namespace_rwlock); 345 360 346 361 /*
Note:
See TracChangeset
for help on using the changeset viewer.