Ignore:
Timestamp:
May 3, 2018, 5:51:22 PM (6 years ago)
Author:
alain
Message:

1/ Fix a bug in the Multithreaded "sort" applicationr:
The pthread_create() arguments must be declared as global variables.
2/ The exit syscall can be called by any thread of a process..

File:
1 edited

Legend:

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

    r124 r440  
    22 * sys_getcwd.c - get process current work directory
    33 *
    4  * Author    Alain Greiner (2016,2017)
     4 * Author    Alain Greiner (2016,2017,2018)
    55 *
    66 * Copyright (c)  UPMC Sorbonne Universites
     
    4040{
    4141        error_t    error;
    42     paddr_t    paddr;
     42    vseg_t   * vseg;
    4343    char       kbuf[CONFIG_VFS_MAX_PATH_LENGTH];
    4444 
     
    4949        if( nbytes < CONFIG_VFS_MAX_PATH_LENGTH )
    5050        {
    51         printk("\n[ERROR] in %s : buffer too small\n", __FUNCTION__ );
    52                 this->errno = ERANGE;
     51
     52#if DEBUG_SYSCALLS_ERROR
     53printk("\n[ERROR] in %s : buffer too small / thread %x / process %x\n",
     54__FUNCTION__ , this->trdid , process->pid );
     55#endif
     56                this->errno = EINVAL;
    5357        return -1;
    5458        }
    5559
    5660    // check buffer in user space
    57     error = vmm_v2p_translate( false , buf , &paddr );
     61    error = vmm_get_vseg( process, (intptr_t)buf , &vseg );
    5862
    5963        if( error )
    6064        {
    61         printk("\n[ERROR] in %s : user buffer unmapped\n", __FUNCTION__ );
    62                 this->errno = EFAULT;
     65
     66#if DEBUG_SYSCALLS_ERROR
     67printk("\n[ERROR] in %s : user buffer unmapped %x / thread %x / process %x\n",
     68__FUNCTION__ , (intptr_t)buf , this->trdid , process->pid );
     69#endif
     70                this->errno = EINVAL;
    6371        return -1;
    6472        }
Note: See TracChangeset for help on using the changeset viewer.