Fix build

This commit is contained in:
Paul Nasrat 2006-08-01 14:28:23 +00:00
parent d4317bf78c
commit fc74ad0248
2 changed files with 36 additions and 1 deletions

View File

@ -0,0 +1,30 @@
--- librtas-1.2.4/librtas_src/syscall_calls.c.no_syscall 2006-08-01 10:08:03.000000000 -0400
+++ librtas-1.2.4/librtas_src/syscall_calls.c 2006-08-01 10:09:22.000000000 -0400
@@ -93,7 +93,15 @@
.interface_exists = sc_interface_exists,
};
+/* The original librtas used the _syscall1 interface to get to the rtas
+ * system call. On recent versions of Linux though the _syscall1
+ * interface was removed from unistd.h so we have moved to using the
+ * syscall() interface instead. The use of _syscall1 is left as the
+ * default to avoid breaking the library on older systems.
+ */
+#ifdef _syscall1
_syscall1(int, rtas, void *, args);
+#endif
#define CALL_AGAIN 1
@@ -201,7 +209,11 @@
va_end(ap);
display_rtas_buf(&args, 0);
+#ifdef _syscall1
rc = rtas(&args);
+#else
+ rc = syscall(__NR_rtas, &args);
+#endif
if (rc != 0) {
dbg1("RTAS syscall failure, errno=%d\n", errno);
return RTAS_IO_ASSERT;

View File

@ -1,11 +1,12 @@
Summary: Libraries to provide access to RTAS calls and RTAS events.
Name: librtas
Version: 1.2.4
Release: 1.2.2
Release: 2
URL: http://librtas.ozlabs.org
License: IBM Common Public License (CPL) v1.0
Group: System Environment/Libraries
Source: librtas-src-1.2.4.tar.gz
Patch0: librtas-1.2.4-no_syscall1.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
ExclusiveArch: ppc ppc64
@ -32,6 +33,7 @@ necessary for developing programs using libdaemon.
%prep
%setup
%patch0 -p1 -b .no_syscall
%build
make CFLAGS="$RPM_OPT_FLAGS -fPIC -DPIC"
@ -62,6 +64,9 @@ rm -rf $RPM_BUILD_ROOT
/usr/include/*
%changelog
* Tue Aug 01 2006 Paul Nasrat <pnasrat@redhat.com> - 1.2.4-2
- Backport syscall fix from upstream
* Wed Jul 12 2006 Jesse Keating <jkeating@redhat.com> - 1.2.4-1.2.2
- rebuild