Increase buffer size when reading executable, update libstd

This commit is contained in:
Jeremy Soller 2016-09-20 09:51:26 -06:00
parent d329f7c7d2
commit 2b915953c9
3 changed files with 5 additions and 3 deletions

View file

@ -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,

View file

@ -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]);

2
libstd

@ -1 +1 @@
Subproject commit 3d771c76c4cbd82ad699c59d3bfb645556d90f39
Subproject commit ae80aff4d39b2d3a83f7d32bc95739e4e1169184