Changeset 566 for trunk/kernel/syscalls/sys_chmod.c
- Timestamp:
- Oct 4, 2018, 11:50:21 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/syscalls/sys_chmod.c
r506 r566 32 32 #include <syscalls.h> 33 33 34 ////////////////////////////////// 35 int sys_chmod( c onst char* pathname,36 uint32_t rights)34 /////////////////////////////////// 35 int sys_chmod( char * pathname, 36 uint32_t rights __attribute__((unused)) ) 37 37 { 38 38 error_t error; … … 45 45 if( hal_strlen_from_uspace( pathname ) >= CONFIG_VFS_MAX_PATH_LENGTH ) 46 46 { 47 printk("\n[ERROR] in %s : pathname too long\n", __FUNCTION__ ); 47 48 #if DEBUG_SYSCALLS_ERROR 49 printk("\n[ERROR] in %s : pathname too long / thread %x in process %x\n", 50 __FUNCTION__, this->trdid, process->pid ); 51 #endif 48 52 this->errno = ENFILE; 49 53 return -1; … … 53 57 hal_strcpy_from_uspace( kbuf , pathname , CONFIG_VFS_MAX_PATH_LENGTH ); 54 58 59 printk("\n[ERROR] in %s : not implemented yet\n", __FUNCTION__ ); 60 return -1; 61 55 62 // get cluster and local pointer on reference process 56 xptr_t ref_xp = process->ref_xp; 57 process_t * ref_ptr = (process_t *)GET_PTR( ref_xp ); 58 cxy_t ref_cxy = GET_CXY( ref_xp ); 59 60 // get extended pointer on cwd inode 61 xptr_t cwd_xp = hal_remote_lwd( XPTR( ref_cxy , &ref_ptr->vfs_cwd_xp ) ); 62 63 // get the cwd lock in read mode from reference process 64 remote_rwlock_rd_lock( XPTR( ref_cxy , &ref_ptr->cwd_lock ) ); 63 // xptr_t ref_xp = process->ref_xp; 64 // process_t * ref_ptr = (process_t *)GET_PTR( ref_xp ); 65 // cxy_t ref_cxy = GET_CXY( ref_xp ); 65 66 66 67 // call the relevant VFS function 67 error = vfs_chmod( cwd_xp, 68 kbuf, 69 rights ); 70 71 // release the cwd lock 72 remote_rwlock_rd_unlock( XPTR( ref_cxy , &ref_ptr->cwd_lock ) ); 68 // error = vfs_chmod( cwd_xp, 69 // kbuf, 70 // rights ); 73 71 74 72 if( error ) 75 73 { 76 74 printk("\n[ERROR] in %s : cannot remove directory %s\n", 77 75 __FUNCTION__ , kbuf ); 78 76 this->errno = error; 79 77 return -1;
Note: See TracChangeset
for help on using the changeset viewer.