move POSIX spawn, exec and child tracking into posixsrv, keep process transactions alive across reconnects and preserve stable PIDs across image replacement, flesh out spawn with ordered file actions, process-group selection and signal inheritance, implement execve with bootstrap validation and rollback before retiring the old process, add vfork children that share the native process while keeping separate POSIX descriptor and signal state, replace local spawn bookkeeping with child reaping, nonblocking and process-group waits and orphan cleanup, add signal dispositions, per-thread masks, pending delivery, process/group signalling and alarms, translate native exceptions into POSIX signals and inherit masks when creating threads, make pipe waits interruptible and raise SIGPIPE for broken pipes, pass arguments and environment into main and add getenv/environ, add direct user APC notifications that can run without an alertable wait, add current-thread capabilities and resume-and-wait, let accepted IPC endpoints open restricted peer process capabilities and preserve caller security during spawn and exec, make process preparation reusable and improve DLL lookup across current, executable and fallback directories, move keyboard repeat into RSSRV so PS/2 and USB share one repeat policy, fix video presentation, report launch failure stages and status codes, mooaaar tests.
This commit is contained in:
1 parent
73abd6f90d
commit
899225f551
57 files changed
+8817
-1216
No files matched your search
@@ -2,11 +2,62 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <sys/types.h>
|
||||
#include <signal.h>
|
||||
#include <ntlite_posix_api.h>
|
||||
|
||||
typedef void* posix_spawn_file_actions_t;
|
||||
typedef void* posix_spawnattr_t;
|
||||
#define POSIX_SPAWN_SETPGROUP 0x00000001u
|
||||
#define POSIX_SPAWN_SETSIGMASK 0x00000002u
|
||||
#define POSIX_SPAWN_SETSIGDEF 0x00000004u
|
||||
#define POSIX_SPAWN_FILE_ACTION_CAPACITY 64u
|
||||
|
||||
#define NTL_POSIX_SPAWN_FILE_ACTION_NONE 0u
|
||||
#define NTL_POSIX_SPAWN_FILE_ACTION_CLOSE 1u
|
||||
#define NTL_POSIX_SPAWN_FILE_ACTION_DUP2 2u
|
||||
#define NTL_POSIX_SPAWN_FILE_ACTION_OPEN 3u
|
||||
|
||||
typedef struct posix_spawn_file_action_entry {
|
||||
uint32_t Type;
|
||||
int FileDescriptor;
|
||||
int NewFileDescriptor;
|
||||
int OpenFlags;
|
||||
mode_t Mode;
|
||||
char* Path;
|
||||
} posix_spawn_file_action_entry;
|
||||
|
||||
typedef struct posix_spawn_file_actions_t {
|
||||
uint32_t Initialized;
|
||||
uint32_t Count;
|
||||
posix_spawn_file_action_entry Entries[POSIX_SPAWN_FILE_ACTION_CAPACITY];
|
||||
} posix_spawn_file_actions_t;
|
||||
|
||||
typedef struct posix_spawnattr_t {
|
||||
uint32_t Initialized;
|
||||
uint32_t Flags;
|
||||
pid_t ProcessGroup;
|
||||
sigset_t SignalMask;
|
||||
sigset_t SignalDefault;
|
||||
} posix_spawnattr_t;
|
||||
|
||||
NTL_POSIX_API int posix_spawn_file_actions_init(posix_spawn_file_actions_t* actions);
|
||||
NTL_POSIX_API int posix_spawn_file_actions_destroy(posix_spawn_file_actions_t* actions);
|
||||
NTL_POSIX_API int posix_spawn_file_actions_addclose(posix_spawn_file_actions_t* actions, int fd);
|
||||
NTL_POSIX_API int posix_spawn_file_actions_adddup2(posix_spawn_file_actions_t* actions,
|
||||
int fd, int newFd);
|
||||
NTL_POSIX_API int posix_spawn_file_actions_addopen(posix_spawn_file_actions_t* actions, int fd,
|
||||
const char* path, int openFlags, mode_t mode);
|
||||
|
||||
NTL_POSIX_API int posix_spawnattr_init(posix_spawnattr_t* attributes);
|
||||
NTL_POSIX_API int posix_spawnattr_destroy(posix_spawnattr_t* attributes);
|
||||
NTL_POSIX_API int posix_spawnattr_getflags(const posix_spawnattr_t* attributes, short* flags);
|
||||
NTL_POSIX_API int posix_spawnattr_setflags(posix_spawnattr_t* attributes, short flags);
|
||||
NTL_POSIX_API int posix_spawnattr_getpgroup(const posix_spawnattr_t* attributes, pid_t* pgroup);
|
||||
NTL_POSIX_API int posix_spawnattr_setpgroup(posix_spawnattr_t* attributes, pid_t pgroup);
|
||||
NTL_POSIX_API int posix_spawnattr_getsigmask(const posix_spawnattr_t* attributes, sigset_t* mask);
|
||||
NTL_POSIX_API int posix_spawnattr_setsigmask(posix_spawnattr_t* attributes, const sigset_t* mask);
|
||||
NTL_POSIX_API int posix_spawnattr_getsigdefault(const posix_spawnattr_t* attributes, sigset_t* set);
|
||||
NTL_POSIX_API int posix_spawnattr_setsigdefault(posix_spawnattr_t* attributes, const sigset_t* set);
|
||||
|
||||
NTL_POSIX_API int posix_spawn(pid_t* pid, const char* path,
|
||||
const posix_spawn_file_actions_t* fileActions,
|
||||
|
||||
Reference in new issue
Block a user