Subversion Repositories HelenOS-historic

Rev

Rev 1321 | Rev 1325 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1321 Rev 1322
Line 254... Line 254...
254
{
254
{
255
    char *str;
255
    char *str;
256
    sysinfo_rettype_t ret;
256
    sysinfo_rettype_t ret;
257
    str=malloc(len+1,0);
257
    str=malloc(len+1,0);
258
    ASSERT(str);
258
    ASSERT(str);
259
    if(copy_from_uspace(str,(void *)ptr,len+1)) return 0;
259
    if(!((copy_from_uspace(str,(void *)ptr,len+1))||(str[len])))
260
    if(str[len]) return 0;          /*This is not len lenght C string*/
-
 
261
    ret=sysinfo_get_val(str,NULL);
260
        ret=sysinfo_get_val(str,NULL);
262
    free(str);
261
    free(str);
263
    return ret.valid;
262
    return ret.valid;
264
}
263
}
265
 
264
 
266
__native sys_sysinfo_value(__native ptr,__native len)
265
__native sys_sysinfo_value(__native ptr,__native len)
267
{
266
{
268
    char *str;
267
    char *str;
269
    sysinfo_rettype_t ret;
268
    sysinfo_rettype_t ret;
270
    str=malloc(len+1,0);
269
    str=malloc(len+1,0);
271
    ASSERT(str);
270
    ASSERT(str);
272
    if(copy_from_uspace(str,(void *)ptr,len+1)) return 0;
271
    if(!((copy_from_uspace(str,(void *)ptr,len+1))||(str[len])))
273
    if(str[len]) return 0;          /*This is not len lenght C string*/
-
 
274
    ret=sysinfo_get_val(str,NULL);
272
        ret=sysinfo_get_val(str,NULL);
275
    free(str);
273
    free(str);
276
    return ret.val;
274
    return ret.val;
277
}
275
}
278
 
276
 
279
 
277