thr_self.c revision 75369
1238730Sdelphij/* 2238730Sdelphij * Copyright (c) 1995 John Birrell <jb@cimlogic.com.au>. 3238730Sdelphij * All rights reserved. 4238730Sdelphij * 5238730Sdelphij * Redistribution and use in source and binary forms, with or without 6238730Sdelphij * modification, are permitted provided that the following conditions 7238730Sdelphij * are met: 8238730Sdelphij * 1. Redistributions of source code must retain the above copyright 960786Sps * notice, this list of conditions and the following disclaimer. 1060786Sps * 2. Redistributions in binary form must reproduce the above copyright 1160786Sps * notice, this list of conditions and the following disclaimer in the 1260786Sps * documentation and/or other materials provided with the distribution. 1360786Sps * 3. All advertising materials mentioning features or use of this software 1460786Sps * must display the following acknowledgement: 1560786Sps * This product includes software developed by John Birrell. 1660786Sps * 4. Neither the name of the author nor the names of any co-contributors 1760786Sps * may be used to endorse or promote products derived from this software 1860786Sps * without specific prior written permission. 1960786Sps * 2060786Sps * THIS SOFTWARE IS PROVIDED BY JOHN BIRRELL AND CONTRIBUTORS ``AS IS'' AND 2160786Sps * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2260786Sps * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23173682Sdelphij * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 24173682Sdelphij * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25173682Sdelphij * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26173682Sdelphij * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27173682Sdelphij * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28173682Sdelphij * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2989019Sps * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 3089019Sps * SUCH DAMAGE. 3160786Sps * 3260786Sps * $FreeBSD: head/lib/libkse/thread/thr_self.c 75369 2001-04-10 04:19:21Z deischen $ 3360786Sps */ 3460786Sps#include <pthread.h> 3560786Sps#include "pthread_private.h" 3660786Sps 3760786Sps__weak_reference(_pthread_self, pthread_self); 3860786Sps 39191930Sdelphijpthread_t 40191930Sdelphij_pthread_self(void) 41191930Sdelphij{ 42191930Sdelphij /* Return the running thread pointer: */ 43191930Sdelphij return (_get_curthread()); 4489019Sps} 4560786Sps