about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/sh
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2014-10-24 12:57:59 +0000
committerJoseph Myers <joseph@codesourcery.com>2014-10-24 12:59:23 +0000
commit48eb7a94e292efcbbd74902322252a99cbf74fb9 (patch)
tree3efe75a9d5fcd3b08b776aa6292f26c8fb6708e4 /sysdeps/unix/sysv/linux/sh
parenteb04247d5d0aafbf40e8da078ef57759ba4c8097 (diff)
downloadglibc-48eb7a94e292efcbbd74902322252a99cbf74fb9.tar.gz
glibc-48eb7a94e292efcbbd74902322252a99cbf74fb9.tar.xz
glibc-48eb7a94e292efcbbd74902322252a99cbf74fb9.zip
Move some chown / lchown / fchown definitions to syscalls.list (bug 14138).
Continuing the move of syscall definitions to syscalls.list, where the
removal of support for old kernel versions has made this possible,
this patch moves various definitions of chown, lchown and fchown.

In most cases the need for special syscalls.list entries (rather than
existing generic ones) is because these architectures use chown32,
lchown32 and fchown32 as syscall names.  Some architectures also have
symbol versioning compatibility for older versions of chown having
been equivalent to lchown.

The aliases specified for s390-32 had the effect of exporting
__chown@@GLIBC_2.1 (but not __chown@GLIBC_2.0) despite it not being
listed in Versions files.  (I'm not sure why versioned_symbol but not
compat_symbol were effective like that to create such __chown exports
in the absence of Versions entries.)  The natural way to preserve that
versioned export of __chown seems to be to add it in a Versions file,
so I did so.  (Maybe actually it should be a compat symbol,
__chown@GLIBC_2.1, unless there's a good reason for that export, but
this patch doesn't change anything there.)

Tested for x86.

	[BZ #14138]
	* sysdeps/unix/sysv/linux/i386/chown.c: Remove file.
	* sysdeps/unix/sysv/linux/i386/fchown.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/lchown.c: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/chown.c: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/fchown.c: Remove file.
	* sysdeps/unix/sysv/linux/s390/s390-32/lchown.c: Likewise.
	* sysdeps/unix/sysv/linux/sh/chown.c: Likewise.
	* sysdeps/unix/sysv/linux/sh/fchown.c: Likewise.
	* sysdeps/unix/sysv/linux/sh/lchown.c: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/chown.c: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/fchown.c: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/lchown.c: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/Versions (GLIBC_2.1): Add
	__chown.
	* sysdeps/unix/sysv/linux/i386/syscalls.list (chown): Add syscall.
	(lchown): Likewise.
	(fchown): Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/syscalls.list (chown):
	Likewise.
	(lchown): Likewise.
	(fchown): Likewise.
	* sysdeps/unix/sysv/linux/sh/syscalls.list (chown): Likewise.
	(lchown): Likewise.
	(fchown): Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list (chown):
	Likewise.
	(lchown): Likewise.
	(fchown): Likewise.
Diffstat (limited to 'sysdeps/unix/sysv/linux/sh')
-rw-r--r--sysdeps/unix/sysv/linux/sh/chown.c34
-rw-r--r--sysdeps/unix/sysv/linux/sh/fchown.c1
-rw-r--r--sysdeps/unix/sysv/linux/sh/lchown.c1
-rw-r--r--sysdeps/unix/sysv/linux/sh/syscalls.list4
4 files changed, 4 insertions, 36 deletions
diff --git a/sysdeps/unix/sysv/linux/sh/chown.c b/sysdeps/unix/sysv/linux/sh/chown.c
deleted file mode 100644
index 27be894a5b..0000000000
--- a/sysdeps/unix/sysv/linux/sh/chown.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Copyright (C) 1998-2014 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 Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 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
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <errno.h>
-#include <unistd.h>
-
-#include <sysdep.h>
-#include <sys/syscall.h>
-
-#include <linux/posix_types.h>
-
-/* Consider moving to syscalls.list.  */
-
-int
-__chown (const char *file, uid_t owner, gid_t group)
-{
-  return INLINE_SYSCALL (chown32, 3, file, owner, group);
-}
-libc_hidden_def (__chown)
-weak_alias (__chown, chown)
diff --git a/sysdeps/unix/sysv/linux/sh/fchown.c b/sysdeps/unix/sysv/linux/sh/fchown.c
deleted file mode 100644
index 3a69ecc9e7..0000000000
--- a/sysdeps/unix/sysv/linux/sh/fchown.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/fchown.c>
diff --git a/sysdeps/unix/sysv/linux/sh/lchown.c b/sysdeps/unix/sysv/linux/sh/lchown.c
deleted file mode 100644
index c89de99ba2..0000000000
--- a/sysdeps/unix/sysv/linux/sh/lchown.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/lchown.c>
diff --git a/sysdeps/unix/sysv/linux/sh/syscalls.list b/sysdeps/unix/sysv/linux/sh/syscalls.list
index faffe377e1..899d4e7afe 100644
--- a/sysdeps/unix/sysv/linux/sh/syscalls.list
+++ b/sysdeps/unix/sysv/linux/sh/syscalls.list
@@ -1,5 +1,9 @@
 # File name	Caller	Syscall name	# args	Strong name	Weak names
 
+chown		-	chown32		i:sii	__chown		chown
+lchown		-	lchown32	i:sii	__lchown	lchown
+fchown		-	fchown32	i:iii	__fchown	fchown
+
 waitpid		-	waitpid		Ci:ipi	__waitpid	waitpid	__libc_waitpid
 
 prlimit64	EXTRA	prlimit64	i:iipp	prlimit64