Ignore:
Timestamp:
Jan 13, 2021, 12:36:17 AM (4 years ago)
Author:
alain
Message:

All modifications required to support the <tcp_chat> application
including error recovery in case of packet loss.A

File:
1 edited

Legend:

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

    r670 r683  
    3636{
    3737    vseg_t       * vseg;
    38     kmem_req_t     req;
    3938    pipe_t       * pipe;
    4039    vfs_file_t   * file_0;
     
    8887    // 2. allocate memory for fd[0] file descriptor in local cluster
    8988    // we don't use the vfs_file_create function because there is no inode.
    90         req.type  = KMEM_KCM;
    91         req.order = bits_log2( sizeof(vfs_file_t) );
    92     req.flags = AF_ZERO;
    93         file_0    = kmem_alloc( &req );
     89        file_0 = kmem_alloc( bits_log2(sizeof(vfs_file_t)) , AF_ZERO );
    9490
    9591    if( file_0 == NULL )
     
    120116
    121117    // 4. allocate memory for fd[1] file descriptor in local cluster
    122         req.type  = KMEM_KCM;
    123         req.order = bits_log2( sizeof(vfs_file_t) );
    124     req.flags = AF_ZERO;
    125         file_1    = kmem_alloc( &req );
     118    // we don't use the vfs_file_create function because there is no inode.
     119        file_1 = kmem_alloc( bits_log2(sizeof(vfs_file_t)) , AF_ZERO );
    126120
    127121    if( file_1 == NULL )
     
    178172error_5:    // release memory allocated for fd[1] file descriptor
    179173
    180     req.ptr = file_1;
    181     kmem_free( &req );
     174    kmem_free( file_1 , bits_log2(sizeof(vfs_file_t)) );
    182175
    183176error_4:    // release fdid_0 from fd_array[]
     
    187180error_3:    // release memory allocated for fd[0] file descriptor
    188181
    189     req.ptr = file_0;
    190     kmem_free( &req );
     182    kmem_free( file_0 , bits_log2(sizeof(vfs_file_t)) );
    191183
    192184error_2:    // release memory allocated for the pipe
Note: See TracChangeset for help on using the changeset viewer.