Make pipes blocking
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "src/kernel/keyboard.h"
|
||||
#include "src/kernel/idt.h"
|
||||
#include "src/kernel/process.h"
|
||||
#include "src/kernel/stream.h"
|
||||
#include "src/kernel/util.h"
|
||||
#include "src/lib/memory.h"
|
||||
@@ -56,8 +57,10 @@ static uint64_t stream_write(__attribute__((unused)) const stream_t *self, __att
|
||||
}
|
||||
|
||||
static uint64_t stream_read(__attribute__((unused)) const stream_t *self, uint64_t max, char *to) {
|
||||
if (max == 0 || buffer_length == 0) {
|
||||
return 0;
|
||||
while (!buffer_length) {
|
||||
__asm__ volatile("sti");
|
||||
process_next();
|
||||
__asm__ volatile("cli");
|
||||
}
|
||||
|
||||
uint64_t size = buffer_length > max ? max : buffer_length;
|
||||
|
||||
Reference in New Issue
Block a user