Ignore:
Timestamp:
May 3, 2018, 5:51:22 PM (4 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_read.c

    r438 r440  
    22 * sys_read.c - read bytes from a file
    33 *
    4  * Author     Alain Greiner (2016,2017)
     4 * Author     Alain Greiner (2016,2017,2018)
    55 *
    66 * Copyright (c) UPMC Sorbonne Universites
     
    5858{
    5959    error_t      error;
    60     paddr_t      paddr;       // required for user space checking
     60    vseg_t     * vseg;        // required for user space checking
    6161        xptr_t       file_xp;     // remote file extended pointer
    6262    uint32_t     nbytes;      // number of bytes actually read
     
    9191
    9292    // check user buffer in user space
    93     error = vmm_v2p_translate( false , vaddr , &paddr );
     93    error = vmm_get_vseg( process , (intptr_t)vaddr , &vseg );
    9494
    9595    if ( error )
     
    9797
    9898#if DEBUG_SYSCALLS_ERROR
    99 printk("\n[ERROR] in %s : user buffer unmapped = %x\n",
    100 __FUNCTION__ , (intptr_t)vaddr );
     99printk("\n[ERROR] in %s : user buffer unmapped %x / thread %x / process %x\n",
     100__FUNCTION__ , (intptr_t)vaddr, this->trdid, process->pid );
     101vmm_display( process , false );
    101102#endif
    102103                this->errno = EINVAL;
Note: See TracChangeset for help on using the changeset viewer.