vfs: check userland buffers before reading them.
[haiku.git] / src / system / kernel / lib / kernel_errno.cpp
blobd111c3e990cd9d1e1f5d8402166316a03a535b36
1 /*
2 * Copyright 2003-2007, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 */
7 #include "thread.h"
9 #include <errno.h>
12 /*!
13 Kernel space storage for "errno", located in the thread structure
14 (user "errno" can't be changed from kernel internal POSIX calls)
16 int *
17 _errnop(void)
19 Thread *thread = thread_get_current_thread();
21 return &thread->kernel_errno;