X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=kitten%2Fkernel%2Flinux_syscalls%2Fwrite.c;fp=kitten%2Fkernel%2Flinux_syscalls%2Fwrite.c;h=0000000000000000000000000000000000000000;hb=80d6ccd14cca51eec611cc96cf1e39c7a9c98421;hp=b37bee50e8c7d4e93e25a9b34418842907e4606d;hpb=e5d7715c14a23e72d742d402d4e4cdf97ffab697;p=palacios.releases.git diff --git a/kitten/kernel/linux_syscalls/write.c b/kitten/kernel/linux_syscalls/write.c deleted file mode 100644 index b37bee5..0000000 --- a/kitten/kernel/linux_syscalls/write.c +++ /dev/null @@ -1,35 +0,0 @@ -#include -#include -#include - -ssize_t -sys_write(unsigned int fd, const char __user * buf, size_t count) -{ - char kbuf[512]; - size_t kcount = count; - - /* For now we only support stdout console output */ - if (fd != 1) - return -EBADF; - - /* Protect against overflowing the kernel buffer */ - if (kcount >= sizeof(kbuf)) - kcount = sizeof(kbuf) - 1; - - /* Copy the user-level string to a kernel buffer */ - if (copy_from_user(kbuf, buf, kcount)) - return -EFAULT; - kbuf[kcount] = '\0'; - - /* Write the string to the local console */ - printk(KERN_USERMSG - "(%s) %s%s", - current->name, - kbuf, - (kcount != count) ? " " : "" - ); - - /* Return number of characters actually printed */ - return kcount; -} -