Changeset 597 for trunk/libs/mini-libc


Ignore:
Timestamp:
Nov 10, 2018, 2:56:43 PM (5 years ago)
Author:
alain
Message:

Rewrite the mmap() and stat() syscalls to implement the cat command in ksh.

Location:
trunk/libs/mini-libc
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/libs/mini-libc/mman.c

    r473 r597  
    2828#include <stdio.h>
    2929
    30 ////////////////////////////////y
     30////////////////////////////////
    3131int munmap( void         * addr,
    3232            unsigned int   size )
     
    4747    mmap_attr_t attr;
    4848
    49     attr.addr   = addr;
     49    // addr argument must be NULL
     50    if( addr != NULL )
     51    {
     52        printf("\n[ERROR] in %s : the <addr> argument must be NULL\n", __FUNCTION__ );
     53        return NULL;
     54    }
     55
     56    //set the mmap attributes
     57    attr.addr   = NULL;
    5058    attr.length = length;
    5159    attr.prot   = prot;
  • trunk/libs/mini-libc/mman.h

    r449 r597  
    4040 * @ addr    : requested address in virtual space / unused : should be NULL.
    4141 * @ length  : requested number of bytes.
    42  * @ prot    : access mode.
    43  * @ flags   : MAP_FILE / MAP_ANON / MAP_PRIVATE / MAP_SHARED.
     42 * @ prot    : access mode bit vector (PROT_EXEC / PROT_READ / PROT_WRITE)
     43 * @ flags   : bit_vector (MAP_FILE / MAP_ANON / MAPREMOTE / MAP_PRIVATE / MAP_SHARED)
    4444 * @ fdid    : file descriptor index (if MAP_FILE).
    4545 * @ offset  : offset in file (if MAP_FILE).
  • trunk/libs/mini-libc/stat.c

    r457 r597  
    4545}
    4646
    47 ///////////////////////////////
    48 int chmod( char     * pathname,
     47///////////////////////////////////
     48int chmod( char         * pathname,
    4949           unsigned int   rights )
    5050{
  • trunk/libs/mini-libc/stat.h

    r449 r597  
    7777int stat( const char  * pathname,
    7878          struct stat * stat );
     79
    7980#endif /* _SYS_STAT_H_ */
Note: See TracChangeset for help on using the changeset viewer.