|
@@ -173,6 +173,21 @@ void vm_UNAME(struct lilith* vm)
|
|
|
writeout_string(vm, arch_name, vm->reg[0] + 260);
|
|
|
}
|
|
|
|
|
|
+void vm_GETCWD(struct lilith* vm)
|
|
|
+{
|
|
|
+ char* s = malloc(vm->reg[1]);
|
|
|
+ s = getcwd(s, vm->reg[1]);
|
|
|
+ if(NULL == s)
|
|
|
+ {
|
|
|
+ vm->reg[0] = 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ writeout_string(vm, s, vm->reg[0]);
|
|
|
+ }
|
|
|
+ free(s);
|
|
|
+}
|
|
|
+
|
|
|
void vm_CHDIR(struct lilith* vm)
|
|
|
{
|
|
|
char* s = string_copy(vm, vm->reg[0]);
|