implemented sys_getmainvars