Changeset 35a96cf in mainline for generic/src/sysinfo/sysinfo.c


Ignore:
Timestamp:
2006-05-13T20:11:13Z (19 years ago)
Author:
Jakub Vana <jakub.vana@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6326f5e6
Parents:
2666daa
Message:

Sysinfo userspace interface

File:
1 edited

Legend:

Unmodified
Added
Removed
  • generic/src/sysinfo/sysinfo.c

    r2666daa r35a96cf  
    22#include <mm/slab.h>
    33#include <print.h>
     4#include <syscall/copy.h>
    45
    56sysinfo_item_t *_root=NULL;
     
    221222        return ret;
    222223}
     224
     225__native sys_sysinfo_valid(__native ptr,__native len)
     226{
     227        char *str;
     228        sysinfo_rettype_t ret;
     229        str=malloc(len+1,0);
     230        ASSERT(str);
     231        copy_from_uspace(str,(void *)ptr,len+1);
     232        if(str[len]) return 0;          /*This is not len lenght C string*/
     233        ret=sysinfo_get_val(str,NULL);
     234        free(str);
     235        return ret.valid;
     236}
     237
     238__native sys_sysinfo_value(__native ptr,__native len)
     239{
     240        char *str;
     241        sysinfo_rettype_t ret;
     242        str=malloc(len+1,0);
     243        ASSERT(str);
     244        copy_from_uspace(str,(void *)ptr,len+1);
     245        if(str[len]) return 0;          /*This is not len lenght C string*/
     246        ret=sysinfo_get_val(str,NULL);
     247        free(str);
     248        return ret.val;
     249}
     250
     251
Note: See TracChangeset for help on using the changeset viewer.