Skip to content
Snippets Groups Projects
Commit 863c59d3 authored by Jeremy Soller's avatar Jeremy Soller
Browse files

Increase buffer size when reading executable, update libstd

parent eeb1cd0a
No related branches found
No related tags found
No related merge requests found
......@@ -9,7 +9,7 @@ use syscall::{convert_to_result, Call, Error, Result};
use super::Scheme;
#[derive(Copy, Clone, Debug)]
#[derive(Copy, Clone, Debug, Default)]
#[repr(packed)]
pub struct Packet {
pub id: usize,
......
......@@ -178,6 +178,8 @@ pub fn clone(flags: usize, stack_base: usize) -> Result<usize> {
}
}
// If not cloning files, dup to get a new number from scheme
// This has to be done outside the context lock to prevent deadlocks
if flags & CLONE_FILES == 0 {
for (fd, mut file_option) in files.lock().iter_mut().enumerate() {
let new_file_option = if let Some(file) = *file_option {
......@@ -357,7 +359,7 @@ pub fn exec(path: &[u8], arg_ptrs: &[[usize; 2]]) -> Result<usize> {
//TODO: Only read elf header, not entire file. Then read required segments
let mut data = vec![];
loop {
let mut buf = [0; 4096];
let mut buf = [0; 16384];
let count = syscall::read(file, &mut buf)?;
if count > 0 {
data.extend_from_slice(&buf[..count]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment