core/linux/os.c
/* translate permission string to platform independent protection bits */
translate permission string to platform independent protection bits
translate permission string to platform independent protection bits
static inline uint
permstr_to_memprot(const char * const perm)
{
    uint mem_prot = 0;
    if (perm == NULL || *perm == '\0')
        return mem_prot;
    if (perm[2]=='x')
        mem_prot |= MEMPROT_EXEC;
    if (perm[1]=='w')
        mem_prot |= MEMPROT_WRITE;
    if (perm[0]=='r')
        mem_prot |= MEMPROT_READ;
    return mem_prot;
}
static inline uint permstr_to_memprot ( const char * const perm ) { uint mem_prot = 0 ; if ( perm == NULL || * perm == ' \0 ' ) return mem_prot ; if ( perm [ 2 ] == ' ' ) mem_prot |= MEMPROT_EXEC ; if ( perm [ 1 ] == ' ' ) mem_prot |= MEMPROT_WRITE ; if ( perm [ 0 ] == ' ' ) mem_prot |= MEMPROT_READ ; return mem_prot ; }
translate permission string to platform independent protection bits
translate permission string to platform independent protection bits