Ignore:
Timestamp:
Oct 4, 2018, 11:50:21 PM (6 years ago)
Author:
alain
Message:

Complete restructuration of kernel locks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/syscalls/sys_chmod.c

    r506 r566  
    3232#include <syscalls.h>
    3333
    34 //////////////////////////////////
    35 int sys_chmod( const char * pathname,
    36                uint32_t     rights )
     34///////////////////////////////////
     35int sys_chmod( char    * pathname,
     36               uint32_t   rights __attribute__((unused)) )
    3737{
    3838    error_t     error;
     
    4545    if( hal_strlen_from_uspace( pathname ) >= CONFIG_VFS_MAX_PATH_LENGTH )
    4646    {
    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
    4852        this->errno = ENFILE;
    4953        return -1;
     
    5357    hal_strcpy_from_uspace( kbuf , pathname , CONFIG_VFS_MAX_PATH_LENGTH );
    5458
     59    printk("\n[ERROR] in %s : not implemented yet\n", __FUNCTION__ );
     60    return -1;
     61
    5562    // 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 );
    6566
    6667    // 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 );
    7371
    7472    if( error )
    7573    {
    7674        printk("\n[ERROR] in %s : cannot remove directory %s\n",
    77                __FUNCTION__ , kbuf );
     75        __FUNCTION__ , kbuf );
    7876        this->errno = error;
    7977        return -1;
Note: See TracChangeset for help on using the changeset viewer.