mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Native Linux backtrace.
This commit is contained in:
committed by
Christoffer Lerno
parent
f39aa1a41e
commit
dc0aa35522
@@ -269,6 +269,13 @@ fn ZString* tcopy_env(String[] environment) @local @inline @if(env::POSIX)
|
||||
return copy;
|
||||
}
|
||||
|
||||
fn String! execute_stdout_to_buffer(char[] buffer, String[] command_line, SubProcessOptions options = {}, String[] environment = {})
|
||||
{
|
||||
SubProcess process = process::create(command_line, options, environment)!;
|
||||
process.join()!;
|
||||
usz len = process.read_stdout(buffer.ptr, buffer.len)!;
|
||||
return (String)buffer[:len - 1];
|
||||
}
|
||||
|
||||
/**
|
||||
* @require !environment || !options.inherit_environment
|
||||
|
||||
Reference in New Issue
Block a user