* Also handle the __open_2() function, which is needed on x86_64.

* Renamed to patch, because these aren't syscalls but Glibc functions.

svn path=/nixpkgs/trunk/; revision=14742
This commit is contained in:
Eelco Dolstra 2009-03-27 21:49:46 +00:00
parent 96392cc45f
commit 3c381aa734
2 changed files with 34 additions and 10 deletions

View File

@ -17,9 +17,9 @@ stdenv.mkDerivation {
# the package.)
./empty-dirs.patch
# Implement the getxattr(), lgetxattr() and __open64_2()
# functions. Needed for doing builds on Ubuntu 8.10.
./syscalls.patch
# Implement the getxattr(), lgetxattr(), __open_2() and
# __open64_2() functions. Needed for doing builds on Ubuntu 8.10.
./missing-functions.patch
];
buildInputs = [gettext];

View File

@ -1,6 +1,6 @@
diff -rc checkinstall-orig/installwatch/installwatch.c checkinstall/installwatch/installwatch.c
*** checkinstall-orig/installwatch/installwatch.c 2009-03-12 13:40:24.000000000 +0100
--- checkinstall/installwatch/installwatch.c 2009-03-27 18:38:58.000000000 +0100
--- checkinstall/installwatch/installwatch.c 2009-03-27 22:42:19.000000000 +0100
***************
*** 110,115 ****
--- 110,117 ----
@ -118,19 +118,43 @@ diff -rc checkinstall-orig/installwatch/installwatch.c checkinstall/installwatch
int creat64(const char *pathname, __mode_t mode) {
***************
*** 3663,3668 ****
--- 3751,3767 ----
--- 3751,3791 ----
return result;
}
+ int __open_2(const char *pathname, int flags, ...) {
+ va_list ap;
+ mode_t mode;
+
+ #if DEBUG
+ debug(2,"__open_2(%s,%d,mode)\n",pathname,flags);
+ #endif
+
+ va_start(ap, flags);
+ mode = va_arg(ap, mode_t);
+ va_end(ap);
+
+ /* The open() function in Glibc 2.9 is an always-inline
+ function that may call __open_2(), so it's important that
+ we handle it. I don't know what __open_2() is supposed to
+ do, but redirecting it to open() seems to work fine. */
+
+ return open(pathname,flags,mode);
+ }
+
+ int __open64_2(const char *pathname, int flags, ...) {
+ va_list ap;
+ mode_t mode;
+
+ #if DEBUG
+ debug(2,"__open64_2(%s,%d,mode)\n",pathname,flags);
+ #endif
+ /* The open() function in Glibc 2.9 is an always-inline
+ function that may call __open64_2, so it's important that
+ we handle it. I don't know what __open64_2 is supposed to
+ do, but redirecting it to open64 seems to work fine. */
+ return open64(pathname,flags);
+
+ va_start(ap, flags);
+ mode = va_arg(ap, mode_t);
+ va_end(ap);
+
+ return open64(pathname,flags,mode);
+ }
+
struct dirent64 *readdir64(DIR *dir) {