From 5195a9a892cb0430b131357c3a5737ec1237cfbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Thu, 20 Jan 2005 20:12:10 +0000 Subject: [PATCH] Added __errno_location() when building under Linux - we might adopt this as standard, though (and keep errnop() for BeOS compatibility only). git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10914 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kernel/libroot/posix/errno.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/kernel/libroot/posix/errno.c b/src/kernel/libroot/posix/errno.c index b0435cc15d..3ab4e93168 100644 --- a/src/kernel/libroot/posix/errno.c +++ b/src/kernel/libroot/posix/errno.c @@ -1,6 +1,6 @@ /* -** Copyright 2003, Axel Dörfler, axeld@pinc-software.de. All rights reserved. -** Distributed under the terms of the OpenBeOS License. +** Copyright 2003-2005, Axel Dörfler, axeld@pinc-software.de. All rights reserved. +** Distributed under the terms of the MIT License. */ /* Provides user space storage for "errno", located in TLS @@ -18,3 +18,11 @@ _errnop(void) return (int *)tls_address(TLS_ERRNO_SLOT); } + +// This is part of the Linuxbase binary specification +// and is referenced by some code in libgcc.a. +// ToDo: maybe we even want to include this always +#ifdef __linux__ +extern int *(*__errno_location)(void) __attribute__ ((weak, alias("_errnop"))); +#endif +