Changeset 610 for trunk/kernel/syscalls/sys_open.c
- Timestamp:
- Dec 27, 2018, 7:38:58 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/syscalls/sys_open.c
r604 r610 40 40 { 41 41 error_t error; 42 xptr_t file_xp; // extended pointer on vfs_file_t 43 uint32_t file_id; // file descriptor index 42 xptr_t file_xp; // extended pointer on vfs_file_t 43 uint32_t file_id; // file descriptor index 44 xptr_t root_inode_xp; // extended pointer on path root inode 45 44 46 char kbuf[CONFIG_VFS_MAX_PATH_LENGTH]; 45 47 … … 88 90 cxy_t ref_cxy = GET_CXY( ref_xp ); 89 91 90 // get the cwd lock in read mode from reference process 91 remote_rwlock_rd_acquire( XPTR( ref_cxy , &ref_ptr->cwd_lock ) ); 92 // compute root inode for path 93 if( kbuf[0] == '/' ) // absolute path 94 { 95 // use extended pointer on VFS root inode 96 root_inode_xp = process->vfs_root_xp; 97 } 98 else // relative path 99 { 100 // use extended pointer on CWD inode 101 root_inode_xp = hal_remote_l64( XPTR( ref_cxy , &ref_ptr->cwd_xp ) ); 102 } 92 103 93 104 // call the relevant VFS function 94 error = vfs_open( process,105 error = vfs_open( root_inode_xp, 95 106 kbuf, 107 ref_xp, 96 108 flags, 97 109 mode, 98 110 &file_xp, 99 111 &file_id ); 100 101 // release the cwd lock102 remote_rwlock_rd_release( XPTR( ref_cxy , &ref_ptr->cwd_lock ) );103 112 104 113 if( error )
Note: See TracChangeset
for help on using the changeset viewer.