mirror of
https://github.com/hermitcore/libhermit.git
synced 2025-03-09 00:00:03 +01:00
the system call write consider the parameter length
This commit is contained in:
parent
2ce695750a
commit
6926ccc644
1 changed files with 4 additions and 1 deletions
|
@ -34,12 +34,15 @@
|
|||
|
||||
static int sys_write(int fd, const char* buf, size_t len)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
//TODO: Currently, we ignore the file descriptor
|
||||
|
||||
if (BUILTIN_EXPECT(!buf, 0))
|
||||
return -1;
|
||||
|
||||
kputs(buf);
|
||||
for(i=0; i<len; i++)
|
||||
kputchar(buf[i]);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue