vfs: check userland buffers before reading them.
[haiku.git] / src / system / libroot / os / arch / x86_64 / thread.cpp
blobe4da9a8f41e4076fb11efa88caac5bcdbf93b86a
1 /*
2 * Copyright 2012, Alex Smith, alex@alex-smith.me.uk.
3 * Distributed under the terms of the MIT License.
4 */
7 #include <OS.h>
8 #include "syscalls.h"
11 thread_id
12 find_thread(const char* name)
14 if (!name) {
15 thread_id thread;
16 static_assert(sizeof(thread_id) <= sizeof(uint32_t),
17 "thread_id is larger than uint32_t");
18 __asm__ __volatile__ ("movl %%fs:8, %0" : "=r" (thread));
19 return thread;
22 return _kern_find_thread(name);