Ignore:
Timestamp:
Nov 7, 2017, 3:08:12 PM (7 years ago)
Author:
alain
Message:

First implementation of fork/exec.

File:
1 edited

Legend:

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

    r305 r407  
    5555    }
    5656
    57     // get pathname copy in kernel space
    58     error = hal_strcpy_from_uspace( kbuf , pathname , CONFIG_VFS_MAX_PATH_LENGTH );
    59 
    60     if( error )
     57    // check pathname length
     58    if( hal_strlen_from_uspace( pathname ) >= CONFIG_VFS_MAX_PATH_LENGTH )
    6159    {
    6260        printk("\n[ERROR] in %s : pathname too long\n", __FUNCTION__ );
     
    6563    }
    6664
     65    // copy pathname in kernel space
     66    hal_strcpy_from_uspace( kbuf , pathname , CONFIG_VFS_MAX_PATH_LENGTH );
     67
    6768    // get cluster and local pointer on reference process
    6869    xptr_t      ref_xp  = process->ref_xp;
     
    7071    cxy_t       ref_cxy = GET_CXY( ref_xp );
    7172
    72     // get extended pointer on cwd inode
    73     xptr_t cwd_xp = hal_remote_lwd( XPTR( ref_cxy , &ref_ptr->vfs_cwd_xp ) );
    74 
    7573    // get the cwd lock in read mode from reference process
    7674    remote_rwlock_rd_lock( XPTR( ref_cxy , &ref_ptr->cwd_lock ) );
    7775
    7876    // call the relevant VFS function
    79     error = vfs_open( cwd_xp,
     77    error = vfs_open( process,
    8078                      kbuf,
    8179                      flags,
Note: See TracChangeset for help on using the changeset viewer.