Commit Graph

30 Commits

Author SHA1 Message Date
auronandace 93d6fc091f refactor sys_types_internal to reduce namespace pollution 2026-07-03 14:23:00 +01:00
auronandace e714c570bc make mut_from_ref deny 2026-07-02 08:28:38 +01:00
auronandace a80dda35eb add missing flag to spawn 2026-06-24 10:30:19 +01:00
Wildan M 5779743a9a Remove posix_spawn string allocation 2026-06-20 12:31:32 +07:00
Wildan M 56d5fe6bce Fix posix_spawn various issues 2026-06-20 07:05:28 +07:00
auronandace 35425db05e add descriptions to the spawn header functions 2026-06-17 13:07:08 +01:00
auronandace 40f22b62ab set style to Type instead of Tag 2026-06-17 08:08:34 +01:00
auronandace e69aba445e spawn header cleanup 2026-06-17 07:43:35 +01:00
R Aadarsh 789be35518 Add comments to cbindgen.toml 2026-06-15 17:08:11 +05:30
R Aadarsh 58fefac9f5 Enable sched params change 2026-06-15 17:08:11 +05:30
R Aadarsh 484fe42c0e * Add docs
* Change safety signatures

* Change tests

* Correctly set u/g id
2026-06-15 17:08:11 +05:30
R Aadarsh 6d14437f34 Implement u/g id change based on executable's s(u/g)id mode bit 2026-06-15 17:08:11 +05:30
R Aadarsh ad151e0de8 * Correctly determine argv[0]
- If the function called is `posix_spawnp`, and the passed program name **does not** contain a slash, the path is used unmodified, and the path to the directory containing the program on $PATH is prepended to the program's path and assigned to `argv[0]. If the program name **does** contain a slash, the path is absolutised relative to CWD, and assigned to argv[0]

    - If the function called is `posix_spawn`, the behaviour is as described above in the case where path contains a slash

* Add initial tests
2026-06-15 17:08:11 +05:30
R Aadarsh f59e292744 Change spawn to use CString. String not-being null-terminated prevented files on PATH from being opened. 2026-06-15 17:08:11 +05:30
R Aadarsh 4ea8f329b6 Remove unused constants 2026-06-15 17:08:11 +05:30
R Aadarsh 72ee48df3f Change file_actions implementation to mirror other pthread 2026-06-15 17:08:11 +05:30
R Aadarsh 632c8302a4 Change assertions and panics to display ERRNO 2026-06-15 17:08:11 +05:30
R Aadarsh a941458ba0 Remove the use of platform::redox::path 2026-06-15 17:08:11 +05:30
R Aadarsh fefea0f0a9 Make code safer by disallowing NULL argv, empty argv and NULL values for pointer arguments to functions 2026-06-15 17:08:11 +05:30
R Aadarsh 8c65ed481a Make path to be owned 2026-06-15 17:08:11 +05:30
R Aadarsh 91933b4165 * Change Operation to Action
* Change the linked list to a `Vec<Action>`

* Make functions unsafe
2026-06-15 17:08:11 +05:30
R Aadarsh 2df7484e6c * Make posix_spawnp consider the program argument as a path if it contains a slash
* Remove existence and file type check

* Make envp optional

* Ensure that the CWD of the calling process is same before and after spawning
2026-06-15 17:08:11 +05:30
R Aadarsh 0810991d7d Do the requested sigmask changes and u/g id changes 2026-06-15 17:08:11 +05:30
R Aadarsh 0e5210cb4d Make close operation work 2026-06-15 17:08:11 +05:30
R Aadarsh e3d2257f64 * Make posix_spawn_file_actions_t an iterator
* Fix bug that caused the spawned process to not start

* Make the spawned process inherit the parent's file descriptos
2026-06-15 17:08:11 +05:30
R Aadarsh ad83227225 Change the posix_spawn_file_actions_t struct to use a linked list instead of an array 2026-06-15 17:08:11 +05:30
R Aadarsh 88185cbd8d Make posix_spawnp work 2026-06-15 17:08:11 +05:30
R Aadarsh 119f078216 * Fix bug that caused pid of the child process to be returned instead of 0 or errorno
* Add `same_process` field to not change the address space when `fexec_impl` is called on a different process
2026-06-15 17:08:11 +05:30
R Aadarsh 1bc472e7e1 Add posix_spawn and posix_spawnp for RedoxOS 2026-06-15 17:08:11 +05:30
R Aadarsh df78820f01 Add posix_spawn_file_actions_t and posix_spawnattr_t and tests 2026-06-15 17:08:11 +05:30