summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/linux/common')
-rw-r--r--libc/sysdeps/linux/common/Makefile.in2
-rw-r--r--libc/sysdeps/linux/common/bits/mathcalls.h18
-rw-r--r--libc/sysdeps/linux/common/eventfd_read.c27
-rw-r--r--libc/sysdeps/linux/common/eventfd_write.c28
-rw-r--r--libc/sysdeps/linux/common/sys/eventfd.h4
5 files changed, 75 insertions, 4 deletions
diff --git a/libc/sysdeps/linux/common/Makefile.in b/libc/sysdeps/linux/common/Makefile.in
index a175ab64c..9d41771e2 100644
--- a/libc/sysdeps/linux/common/Makefile.in
+++ b/libc/sysdeps/linux/common/Makefile.in
@@ -25,6 +25,8 @@ CSRC-$(UCLIBC_LINUX_SPECIFIC) += \
capset.c \
dup3.c \
eventfd.c \
+ eventfd_read.c \
+ eventfd_write.c \
inotify.c \
ioperm.c \
iopl.c \
diff --git a/libc/sysdeps/linux/common/bits/mathcalls.h b/libc/sysdeps/linux/common/bits/mathcalls.h
index 84b793c96..427027355 100644
--- a/libc/sysdeps/linux/common/bits/mathcalls.h
+++ b/libc/sysdeps/linux/common/bits/mathcalls.h
@@ -271,7 +271,9 @@ __END_NAMESPACE_C99
#ifdef __USE_ISOC99
__BEGIN_NAMESPACE_C99
/* True gamma function. */
+# ifndef _Mdouble_is_float_
__MATHCALLI (tgamma,, (_Mdouble_))
+# endif
__END_NAMESPACE_C99
#endif
@@ -299,7 +301,9 @@ __MATHCALLI (rint,, (_Mdouble_ __x))
/* Return X + epsilon if X < Y, X - epsilon if X > Y. */
__MATHCALLX (nextafter,, (_Mdouble_ __x, _Mdouble_ __y), (__const__))
# if defined __USE_ISOC99 && !defined __LDBL_COMPAT
+# ifndef _Mdouble_is_float_
__MATHCALLX (nexttoward,, (_Mdouble_ __x, long double __y), (__const__))
+# endif
# endif
/* Return the remainder of integer divison X / Y with infinite precision. */
@@ -316,11 +320,15 @@ __MATHDECLI (int,ilogb,, (_Mdouble_ __x))
#ifdef __USE_ISOC99
/* Return X times (2 to the Nth power). */
+# ifndef _Mdouble_is_float_
__MATHCALLI (scalbln,, (_Mdouble_ __x, long int __n))
+# endif
/* Round X to integral value in floating-point format using current
rounding direction, but do not raise inexact exception. */
+# ifndef _Mdouble_is_float_
__MATHCALLI (nearbyint,, (_Mdouble_ __x))
+# endif
/* Round X to nearest integral value, rounding halfway cases away from
zero. */
@@ -333,7 +341,9 @@ __MATHCALLX (trunc,, (_Mdouble_ __x), (__const__))
/* Compute remainder of X and Y and put in *QUO a value with sign of x/y
and magnitude congruent `mod 2^n' to the magnitude of the integral
quotient x/y, with n >= 3. */
+# ifndef _Mdouble_is_float_
__MATHCALLI (remquo,, (_Mdouble_ __x, _Mdouble_ __y, int *__quo))
+# endif
/* Conversion functions. */
@@ -350,13 +360,19 @@ __MATHDECLI (long long int,llround,, (_Mdouble_ __x))
/* Return positive difference between X and Y. */
+# ifndef _Mdouble_is_float_
__MATHCALLI (fdim,, (_Mdouble_ __x, _Mdouble_ __y))
+# endif
/* Return maximum numeric value from X and Y. */
+# ifndef _Mdouble_is_float_
__MATHCALLI (fmax,, (_Mdouble_ __x, _Mdouble_ __y))
+# endif
/* Return minimum numeric value from X and Y. */
+# ifndef _Mdouble_is_float_
__MATHCALLI (fmin,, (_Mdouble_ __x, _Mdouble_ __y))
+# endif
/* Classify given number. */
@@ -367,7 +383,9 @@ __MATHDECL_PRIV (int, signbit,, (_Mdouble_ __value), (__const__))
/* Multiply-add function computed as a ternary operation. */
+# ifndef _Mdouble_is_float_
__MATHCALLI (fma,, (_Mdouble_ __x, _Mdouble_ __y, _Mdouble_ __z))
+# endif
#endif /* Use ISO C99. */
#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
diff --git a/libc/sysdeps/linux/common/eventfd_read.c b/libc/sysdeps/linux/common/eventfd_read.c
new file mode 100644
index 000000000..75f2aaa11
--- /dev/null
+++ b/libc/sysdeps/linux/common/eventfd_read.c
@@ -0,0 +1,27 @@
+/* Copyright (C) 2007-2014 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <errno.h>
+#include <unistd.h>
+#include <sys/eventfd.h>
+
+
+int
+eventfd_read (int fd, eventfd_t *value)
+{
+ return read (fd, value, sizeof (eventfd_t)) != sizeof (eventfd_t) ? -1 : 0;
+}
diff --git a/libc/sysdeps/linux/common/eventfd_write.c b/libc/sysdeps/linux/common/eventfd_write.c
new file mode 100644
index 000000000..e1509cf5c
--- /dev/null
+++ b/libc/sysdeps/linux/common/eventfd_write.c
@@ -0,0 +1,28 @@
+/* Copyright (C) 2007-2014 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <errno.h>
+#include <unistd.h>
+#include <sys/eventfd.h>
+
+
+int
+eventfd_write (int fd, eventfd_t value)
+{
+ return write (fd, &value,
+ sizeof (eventfd_t)) != sizeof (eventfd_t) ? -1 : 0;
+}
diff --git a/libc/sysdeps/linux/common/sys/eventfd.h b/libc/sysdeps/linux/common/sys/eventfd.h
index 1bf785f32..91b265b2c 100644
--- a/libc/sysdeps/linux/common/sys/eventfd.h
+++ b/libc/sysdeps/linux/common/sys/eventfd.h
@@ -33,16 +33,12 @@ __BEGIN_DECLS
value to COUNT. */
extern int eventfd (int __count, int __flags) __THROW;
-#if 0 /* not (yet) implemented in uClibc */
-
/* Read event counter and possibly wait for events. */
extern int eventfd_read (int __fd, eventfd_t *__value);
/* Increment event counter. */
extern int eventfd_write (int __fd, eventfd_t __value);
-#endif
-
__END_DECLS
#endif /* sys/eventfd.h */