xref: /haiku/src/system/kernel/lib/kernel_errno.cpp (revision 4535495d80c86e19e2610e7444a4fcefe3e0f8e6)
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  */
5 
6 
7 #include "thread.h"
8 
9 #include <errno.h>
10 
11 
12 /*!
13 	Kernel space storage for "errno", located in the thread structure
14 	(user "errno" can't be changed from kernel internal POSIX calls)
15 */
16 int *
_errnop(void)17 _errnop(void)
18 {
19 	Thread *thread = thread_get_current_thread();
20 
21 	return &thread->kernel_errno;
22 }
23 
24