[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: kernel-patch package - test version



>>>>> "GG" == Guenter Geiger <guenter.geiger@psp-vie.be.philips.com> writes:

    >> export PATCH_THE_KERNEL=YES

  Yep, that did it nicely. One succesfully compiled kernel, which
finally allowed me to test all these patches that I've been mailing
around. Unsurpisingly, I discovered that they didn't work. However,
I've appended the one that does. Really :)

  A libc built with this can be installed freely - it won't put
anything into a worse state than it already is. Sample .debs available 
from http://www.eris.rcpt.to/

  Could people please test this?

m.

diff -Nru glibc-2.0.7u-orig/sysdeps/unix/sysv/linux/alpha/lchown.c glibc-2.0.7u/sysdeps/unix/sysv/linux/alpha/lchown.c
--- glibc-2.0.7u-orig/sysdeps/unix/sysv/linux/alpha/lchown.c	Thu Jan  1 08:00:00 1970
+++ glibc-2.0.7u/sysdeps/unix/sysv/linux/alpha/lchown.c	Tue Oct  6 17:34:30 1998
@@ -0,0 +1,58 @@
+/* Copyright (C) 1998 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.  */
+
+#include <errno.h>
+#include <unistd.h>
+#include <sys/syscall.h>
+#include <sys/types.h>
+
+/*
+  [ from ../x86/chown.c: ]
+  In Linux 2.1.x the chown functions have been changed.  A new function lchown
+  was introduced.  The new chown now follows symlinks - the old chown and the
+  new lchown do not follow symlinks.
+
+  Let's try autodetecting. 980909 dichro-libc@rcpt.to
+*/
+
+#ifndef __NR_lchown
+#define __NR_lchown 208
+#endif
+
+int
+__lchown (const char *file, uid_t owner, gid_t group)
+{
+	static int state = 0;
+	int ret;
+
+	switch(state) {
+		case 0:
+			ret = syscall(__NR_lchown, file, owner, group);
+			if((ret != -1) || (errno != ENOSYS)) {
+				state = 2;
+				return ret;
+			}
+			state = 1;
+		case 1:
+			return __chown(file, owner, group);
+		case 2:
+			return syscall(__NR_lchown, file, owner, group);
+	}
+}
+
+weak_alias (__lchown, lchown)


Reply to: