aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/stub
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/stub')
-rw-r--r--sysdeps/stub/atomicity.h53
-rw-r--r--sysdeps/stub/ftruncate.c1
-rw-r--r--sysdeps/stub/getdents.c1
-rw-r--r--sysdeps/stub/init-posix.c2
-rw-r--r--sysdeps/stub/profil.c3
-rw-r--r--sysdeps/stub/reboot.c1
-rw-r--r--sysdeps/stub/swapon.c1
-rw-r--r--sysdeps/stub/syscall.c1
-rw-r--r--sysdeps/stub/ualarm.c1
-rw-r--r--sysdeps/stub/usleep.c1
10 files changed, 63 insertions, 2 deletions
diff --git a/sysdeps/stub/atomicity.h b/sysdeps/stub/atomicity.h
new file mode 100644
index 0000000..3916eeb
--- /dev/null
+++ b/sysdeps/stub/atomicity.h
@@ -0,0 +1,53 @@
+/* Low-level functions for atomitc operations. ix86 version, x >= 4.
+ Copyright (C) 1997 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 Library General Public License as
+ published by the Free Software Foundation; either version 2 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef _ATOMICITY_H
+#define _ATOMICITY_H 1
+
+#include <inttypes.h>
+
+
+static inline int
+__attribute__ ((unused))
+exchange_and_add (uint32_t *mem, int val)
+{
+ int result = *mem;
+ *mem += val;
+ return result;
+}
+
+static inline void
+__attribute__ ((unused))
+atomic_add (uint32_t *mem, int val)
+{
+ *mem += val;
+}
+
+static inline int
+__attribute__ ((unused))
+compare_and_swap (long int *p, long int oldval, long int newval)
+{
+ if (*p != oldval)
+ return 0;
+
+ *p = newval;
+ return 1;
+}
+
+#endif /* atomicity.h */
diff --git a/sysdeps/stub/ftruncate.c b/sysdeps/stub/ftruncate.c
index b70bbc1..c84ed4a 100644
--- a/sysdeps/stub/ftruncate.c
+++ b/sysdeps/stub/ftruncate.c
@@ -18,6 +18,7 @@
#include <sys/types.h>
#include <errno.h>
+#include <unistd.h>
/* Truncate the file FD refers to to LENGTH bytes. */
int
diff --git a/sysdeps/stub/getdents.c b/sysdeps/stub/getdents.c
index a773347..652eda2 100644
--- a/sysdeps/stub/getdents.c
+++ b/sysdeps/stub/getdents.c
@@ -19,6 +19,7 @@
#include <stddef.h>
#include <errno.h>
#include <sys/types.h>
+#include <dirent.h>
ssize_t
__getdirentries (fd, buf, nbytes, basep)
diff --git a/sysdeps/stub/init-posix.c b/sysdeps/stub/init-posix.c
index 0d632d6..8e37bb6 100644
--- a/sysdeps/stub/init-posix.c
+++ b/sysdeps/stub/init-posix.c
@@ -19,7 +19,7 @@
#ifndef HAVE_GNU_LD
void
-__init_posix ()
+__init_posix (void)
{
return;
}
diff --git a/sysdeps/stub/profil.c b/sysdeps/stub/profil.c
index a0ae332..9613108 100644
--- a/sysdeps/stub/profil.c
+++ b/sysdeps/stub/profil.c
@@ -28,7 +28,7 @@
disable profiling. Returns zero on success, -1 on error. */
int
-profil (u_short *sample_buffer, size_t size, size_t offset, u_int scale)
+__profil (u_short *sample_buffer, size_t size, size_t offset, u_int scale)
{
if (scale == 0)
/* Disable profiling. */
@@ -37,4 +37,5 @@ profil (u_short *sample_buffer, size_t size, size_t offset, u_int scale)
__set_errno (ENOSYS);
return -1;
}
+weak_alias (__profil, profil)
stub_warning (profil)
diff --git a/sysdeps/stub/reboot.c b/sysdeps/stub/reboot.c
index ae4465d..8139aee 100644
--- a/sysdeps/stub/reboot.c
+++ b/sysdeps/stub/reboot.c
@@ -18,6 +18,7 @@
#include <errno.h>
#include <unistd.h>
+#include <sys/reboot.h>
/* Reboot the system. */
int
diff --git a/sysdeps/stub/swapon.c b/sysdeps/stub/swapon.c
index d580a9a..cbaa1c2 100644
--- a/sysdeps/stub/swapon.c
+++ b/sysdeps/stub/swapon.c
@@ -18,6 +18,7 @@
#include <errno.h>
#include <unistd.h>
+#include <sys/swap.h>
/* Make the block special device PATH available to the system for swapping.
This call is restricted to the super-user. */
diff --git a/sysdeps/stub/syscall.c b/sysdeps/stub/syscall.c
index 183ffc2..4903b40 100644
--- a/sysdeps/stub/syscall.c
+++ b/sysdeps/stub/syscall.c
@@ -18,6 +18,7 @@
#include <sysdep.h>
#include <errno.h>
+#include <unistd.h>
/* Do system call CALLNO, passing it the remaining arguments.
This only makes sense in certain operating systems. */
diff --git a/sysdeps/stub/ualarm.c b/sysdeps/stub/ualarm.c
index d8e0b0a..5972e24 100644
--- a/sysdeps/stub/ualarm.c
+++ b/sysdeps/stub/ualarm.c
@@ -17,6 +17,7 @@
Boston, MA 02111-1307, USA. */
#include <errno.h>
+#include <unistd.h>
/* Set an alarm to go off (generating a SIGALRM signal) in VALUE microseconds.
If INTERVAL is nonzero, when the alarm goes off, the timer is reset to go
diff --git a/sysdeps/stub/usleep.c b/sysdeps/stub/usleep.c
index 412461b..7ee41b6 100644
--- a/sysdeps/stub/usleep.c
+++ b/sysdeps/stub/usleep.c
@@ -17,6 +17,7 @@
Boston, MA 02111-1307, USA. */
#include <errno.h>
+#include <unistd.h>
/* Sleep USECONDS microseconds, or until a previously set timer goes off. */
unsigned int