about summary refs log tree commit diff
path: root/sysdeps/unix/Makefile
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2003-03-26 22:49:15 +0000
committerRoland McGrath <roland@gnu.org>2003-03-26 22:49:15 +0000
commitd8e94af60b56d86bdb59acc93d8396fb4e3ce770 (patch)
tree0be2090160f91073c7b61a45ebdcfdb8315fe826 /sysdeps/unix/Makefile
parentda058e4542e6aaaef9258f1c94b450f4b32063f0 (diff)
downloadglibc-d8e94af60b56d86bdb59acc93d8396fb4e3ce770.tar.gz
glibc-d8e94af60b56d86bdb59acc93d8396fb4e3ce770.tar.xz
glibc-d8e94af60b56d86bdb59acc93d8396fb4e3ce770.zip
2003-03-26 Roland McGrath <roland@redhat.com>
	* sysdeps/unix/make-syscalls.sh: When an undefined syscall has
	SOURCE=-, append its symbol names to make variable unix-stub-syscalls.
	* sysdeps/unix/Makefile [$(subdir) = misc] [unix-stub-syscalls]
	(sysdep_routines): Add stub-syscalls.
	($(objpfx)stub-syscalls.c): New target.
	(generated): Add stub-syscalls.c.
Diffstat (limited to 'sysdeps/unix/Makefile')
-rw-r--r--sysdeps/unix/Makefile30
1 files changed, 30 insertions, 0 deletions
diff --git a/sysdeps/unix/Makefile b/sysdeps/unix/Makefile
index 18de414341..f3600136f3 100644
--- a/sysdeps/unix/Makefile
+++ b/sysdeps/unix/Makefile
@@ -282,6 +282,36 @@ omit-deps += $(unix-syscalls)
 
 ifeq (misc,$(subdir))
 sysdep_routines += $(unix-extra-syscalls)
+
+ifdef unix-stub-syscalls
+# The system call entry points in this list are supposed to be additional
+# functions not overriding any other sysdeps/.../call.c implementation, but
+# their system call numbers are unavailable in the kernel headers we're
+# using.  Instead of a system call stub, these get a function that fails
+# with ENOSYS.  We just generate a single module defining one function and
+# making all these entry point names aliases for it.
+sysdep_routines += stub-syscalls
+$(objpfx)stub-syscalls.c: $(common-objpfx)sysd-syscalls \
+			  $(..)sysdeps/unix/Makefile
+	(echo '#include <errno.h>'; \
+	 echo 'long int _no_syscall (void)'; \
+	 echo '{ __set_errno (ENOSYS); return -1L; }'; \
+	 for call in $(unix-stub-syscalls); do \
+	   case $$call in \
+	   *@@*) ver=$${call##*@}; call=$${call%%*@}; \
+		 echo "strong_alias (_no_syscall, $${call}_$${ver})"; \
+		 echo "default_symbol_version \
+		         ($${call}_$${ver}, $$call, $$ver);" ;; \
+	   *@@*) ver=$${call##*@}; call=$${call%%*@}; \
+		 echo "strong_alias (_no_syscall, $${call}_$${ver})"; \
+		 echo "symbol_version ($${call}_$${ver}, $$call, $$ver);" ;; \
+	   *) echo "weak_alias (_no_syscall, $$call)"; \
+	      echo "weak_alias (_no_syscall, __GI_$$call)" ;; \
+	   esac; \
+	 done) > $@T
+	mv -f $@T $@
+generated += stub-syscalls.c
+endif
 endif
 
 export sysdirs