Ignore:
Timestamp:
Jan 11, 2019, 6:35:07 PM (5 years ago)
Author:
alain
Message:

Fix several bugs in vfs.c, fatfs.c, and devfs.c to support
the <.> and <..> directory entries.

File:
1 edited

Legend:

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

    r611 r612  
    3030#include <vfs.h>
    3131#include <process.h>
    32 #include <remote_dir.h>
     32#include <user_dir.h>
    3333#include <syscalls.h>
    3434#include <shared_syscalls.h>
     
    4040    error_t         error;
    4141    vseg_t        * vseg;               // for user space checking of buffer
    42     xptr_t          dir_xp;             // extended pointer on remote_dir_t structure
    43     remote_dir_t  * dir_ptr;            // local pointer on remote_dir_t structure
    44     cxy_t           dir_cxy;            // remote_dir_t stucture cluster identifier
     42    xptr_t          dir_xp;             // extended pointer on user_dir structure
     43    user_dir_t    * dir_ptr;            // local pointer on user_dir structure
     44    cxy_t           dir_cxy;            // user_dir stucture cluster identifier
    4545    struct dirent * direntp;            // dirent pointer in user space 
    4646    uint32_t        entries;            // total number of dirent entries
     
    7575        }       
    7676
    77     // get pointers on remote_dir_t structure from dirp
    78     dir_xp  = remote_dir_from_ident( (intptr_t)dirp );
     77    // get pointers on user_dir structure from dirp
     78    dir_xp  = user_dir_from_ident( (intptr_t)dirp );
    7979    dir_ptr = GET_PTR( dir_xp );
    8080    dir_cxy = GET_CXY( dir_xp );
     
    9191        }       
    9292
    93     // get "current" and "entries_nr" values from remote_dir_t structure
     93    // get "current" and "entries_nr" values from user_dir_t structure
    9494    current = hal_remote_l32( XPTR( dir_cxy , &dir_ptr->current ) );
    9595    entries = hal_remote_l32( XPTR( dir_cxy , &dir_ptr->entries ) );
     
    114114    hal_copy_to_uspace( buffer, &direntp , sizeof(void *) );
    115115
    116     // update current index in "remote_dir_t" structure
     116    // update current index in user_dir structure
    117117    hal_remote_atomic_add( XPTR( dir_cxy , &dir_ptr->current ) , 1 );
    118118
Note: See TracChangeset for help on using the changeset viewer.