docs - refresh man pages
This commit is contained in:
1 parent
7eda8b1a8d
commit
a463834e0a
21 files changed
+972
-524
No files matched your search
+16
-5
@@ -111,13 +111,16 @@
|
||||
<pre><code><strong>NAME</strong>
|
||||
spawn, waitpid - create and wait for processes
|
||||
|
||||
|
||||
<strong>SYNOPSIS</strong>
|
||||
<strong> int montauk::spawn(const char* path, const char* args = nullptr);</strong>
|
||||
<strong> void montauk::waitpid(int pid);</strong>
|
||||
<strong> int montauk::getargs(char* buf, uint64_t maxLen);</strong>
|
||||
<strong>int montauk::spawn(const char* path, const char* args = nullptr);</strong>
|
||||
<strong>void montauk::waitpid(int pid);</strong>
|
||||
<strong>int montauk::getargs(char* buf, uint64_t maxLen);</strong>
|
||||
|
||||
|
||||
<strong>DESCRIPTION</strong>
|
||||
|
||||
|
||||
<strong>spawn</strong>
|
||||
Loads the ELF64 binary at the given VFS path and creates a new
|
||||
process. The path must include the drive prefix, for example:
|
||||
@@ -136,6 +139,7 @@
|
||||
Failure occurs when there are no free process slots (max 256),
|
||||
the file cannot be found, or the ELF is invalid.
|
||||
|
||||
|
||||
<strong>waitpid</strong>
|
||||
Blocks the calling process until the process with the given PID
|
||||
has exited. Internally, this yields the CPU in a loop:
|
||||
@@ -146,6 +150,7 @@
|
||||
it spawns a child and waits for it to complete before showing
|
||||
the next prompt.
|
||||
|
||||
|
||||
<strong>EXAMPLES</strong>
|
||||
Spawn a program and wait for it:
|
||||
|
||||
@@ -157,6 +162,7 @@
|
||||
montauk::print("child exited\n");
|
||||
}
|
||||
|
||||
|
||||
<strong>getargs</strong>
|
||||
Copies the argument string into buf (up to maxLen bytes, always
|
||||
null-terminated). Returns the number of characters copied, or
|
||||
@@ -168,15 +174,20 @@
|
||||
The argument string is set by the parent when calling spawn().
|
||||
If no arguments were provided, the buffer will be empty.
|
||||
|
||||
A spawned child inherits a snapshot of its parent's environment. Libc
|
||||
exposes it through getenv(), setenv(), and environ. posix_spawn() can
|
||||
instead provide an explicit envp for the child.
|
||||
|
||||
|
||||
<strong>NOTES</strong>
|
||||
The _start() entry point receives no argc/argv. Use getargs()
|
||||
to retrieve the argument string passed by the parent process.
|
||||
|
||||
Process exit codes are not yet collected by waitpid.
|
||||
|
||||
<strong>SEE ALSO</strong>
|
||||
syscalls(2), file(2)</code></pre>
|
||||
|
||||
<strong>SEE ALSO</strong>
|
||||
<a href="syscalls.html">syscalls(2)</a>, <a href="file.html">file(2)</a></code></pre>
|
||||
<hr>
|
||||
|
||||
<div class="center">
|
||||
|
||||
Reference in new issue
Block a user