Some test fixes, and introduce some pledge and unveil for OpenBSD.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4851 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2024-02-17 14:55:39 +00:00
parent 9af4068bb6
commit dca48fae36
3 changed files with 65 additions and 3 deletions

View File

@ -193,6 +193,7 @@ static bool _export_record_release(tf_task_t* task, export_record_t** export)
}
static JSValue _tf_task_setTimeout(JSContext* context, JSValueConst this_val, int argc, JSValueConst* argv);
static JSValue _tf_task_pokeSandbox(JSContext* context, JSValueConst this_val, int argc, JSValueConst* argv);
static promise_t* _tf_task_find_promise(tf_task_t* task, promiseid_t id);
static void _tf_task_sendPromiseExportMessage(tf_task_t* from, tf_taskstub_t* to, tf_task_message_t messageType, promiseid_t promiseId, exportid_t exportId, JSValue result);
static JSValue _tf_task_executeSource(tf_task_t* task, const char* source, const char* name);
@ -1769,6 +1770,7 @@ void tf_task_activate(tf_task_t* task)
JS_SetPropertyStr(context, global, "platform", JS_NewCFunction(context, _tf_task_platform, "platform", 0));
JS_SetPropertyStr(context, global, "getFile", JS_NewCFunction(context, _tf_task_getFile, "getFile", 1));
JS_SetPropertyStr(context, global, "setTimeout", JS_NewCFunction(context, _tf_task_setTimeout, "setTimeout", 2));
JS_SetPropertyStr(context, global, "pokeSandbox", JS_NewCFunction(context, _tf_task_pokeSandbox, "pokeSandbox", 0));
JS_FreeValue(context, global);
}
@ -2129,3 +2131,11 @@ static JSValue _tf_task_setTimeout(JSContext* context, JSValueConst this_val, in
}
return JS_NULL;
}
static JSValue _tf_task_pokeSandbox(JSContext* context, JSValueConst this_val, int argc, JSValueConst* argv)
{
tf_printf("Poking sandbox.\n");
system("pwd");
tf_printf("Sandbox poked.\n");
return JS_UNDEFINED;
}