From 2b915953c9cb83f90b9a692bf68789e3baed18b4 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Tue, 20 Sep 2016 09:51:26 -0600 Subject: [PATCH] Increase buffer size when reading executable, update libstd --- kernel/scheme/user.rs | 2 +- kernel/syscall/process.rs | 4 +++- libstd | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/kernel/scheme/user.rs b/kernel/scheme/user.rs index c209ecf..7da21d4 100644 --- a/kernel/scheme/user.rs +++ b/kernel/scheme/user.rs @@ -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, diff --git a/kernel/syscall/process.rs b/kernel/syscall/process.rs index 44175d7..b6be85f 100644 --- a/kernel/syscall/process.rs +++ b/kernel/syscall/process.rs @@ -178,6 +178,8 @@ pub fn clone(flags: usize, stack_base: usize) -> Result { } } + // 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 { //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]); diff --git a/libstd b/libstd index 3d771c7..ae80aff 160000 --- a/libstd +++ b/libstd @@ -1 +1 @@ -Subproject commit 3d771c76c4cbd82ad699c59d3bfb645556d90f39 +Subproject commit ae80aff4d39b2d3a83f7d32bc95739e4e1169184