Partial exec, environment variables

This commit is contained in:
2026-03-17 19:14:29 +01:00
parent b1648a146a
commit c69ee1b745
9 changed files with 199 additions and 26 deletions

View File

@@ -28,6 +28,7 @@ static const char* str_status[] = {
[ST_REMOVE_ERROR] = "remove error",
[ST_XDRV_READ_ERROR] = "drive read error",
[ST_XDRV_WRITE_ERROR] = "drive write error",
[ST_NOT_PARTIAL] = "not a partially created process",
};
#endif // _LIBSYSTEM_STR_STATUS_H

View File

@@ -87,10 +87,16 @@ int create_volume (const char* key, int fs_type, const char* device_key) {
return (int)do_syscall (SYS_CREATE_VOLUME, key, fs_type, device_key);
}
int env_set (const char* key, void* buffer, size_t len) {
return (int)do_syscall (SYS_ENV_SET, key, buffer, len);
int env_set (int pid, const char* key, void* buffer, size_t len) {
return (int)do_syscall (SYS_ENV_SET, pid, key, buffer, len);
}
int env_get (const char* key, void* buffer, size_t len) {
return (int)do_syscall (SYS_ENV_GET, key, buffer, len);
int env_get (int pid, const char* key, void* buffer, size_t len) {
return (int)do_syscall (SYS_ENV_GET, pid, key, buffer, len);
}
int exec_partial (const char* volume, const char* path) {
return (int)do_syscall (SYS_EXEC_PARTIAL, volume, path);
}
int exec_partial_fini (int pid) { return (int)do_syscall (SYS_EXEC_PARTIAL_FINI, pid); }

View File

@@ -94,9 +94,15 @@ int remove (const char* path);
int create_volume (const char* key, int fs_type, const char* device_key);
/* Set environment variable */
int env_set (const char* key, void* buffer, size_t len);
int env_set (int pid, const char* key, void* buffer, size_t len);
/* Get environment variable */
int env_get (const char* key, void* buffer, size_t len);
int env_get (int pid, const char* key, void* buffer, size_t len);
/* Prepare process for execution */
int exec_partial (const char* volume, const char* path);
/* Finish process for execution - run it! */
int exec_partial_fini (int pid);
#endif // _LIBMSL_M_SYSTEM_H