From patchwork Mon Sep 29 23:16:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 3032 Received: (qmail 22162 invoked by alias); 29 Sep 2014 23:16:42 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 22153 invoked by uid 89); 29 Sep 2014 23:16:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Date: Mon, 29 Sep 2014 23:16:32 +0000 From: "Joseph S. Myers" To: Subject: Move some *at definitions to syscalls.list (bug 14138) Message-ID: MIME-Version: 1.0 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 definitions of various *at functions in sysdeps/unix/sysv/linux/. These particular moves are straightforward: there are no #includes of these source files, no special architecture-specific versions, no special symbol version handling and no aliases. Each source file can be replaced by a single line in sysdeps/unix/sysv/linux/syscalls.list. Tested for x86_64. (This patch is independent of my other pending patches for such moves, and .) 2014-09-29 Joseph Myers [BZ #14138] * sysdeps/unix/sysv/linux/syscalls.list (fchownat): New syscall. (linkat): Likewise. (mkdirat): Likewise. (readlinkat): Likewise. (renameat): Likewise. (symlinkat): Likewise. (unlinkat): Likewise. * sysdeps/unix/sysv/linux/fchownat.c: Remove file. * sysdeps/unix/sysv/linux/linkat.c: Likewise. * sysdeps/unix/sysv/linux/mkdirat.c: Likewise. * sysdeps/unix/sysv/linux/readlinkat.c: Likewise. * sysdeps/unix/sysv/linux/renameat.c: Likewise. * sysdeps/unix/sysv/linux/symlinkat.c: Likewise. * sysdeps/unix/sysv/linux/unlinkat.c: Likewise. diff --git a/sysdeps/unix/sysv/linux/fchownat.c b/sysdeps/unix/sysv/linux/fchownat.c deleted file mode 100644 index fae1256..0000000 --- a/sysdeps/unix/sysv/linux/fchownat.c +++ /dev/null @@ -1,41 +0,0 @@ -/* Copyright (C) 2005-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 - . */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -/* Consider moving to syscalls.list. */ - -/* Change the owner and group of FILE. */ -int -fchownat (fd, file, owner, group, flag) - int fd; - const char *file; - uid_t owner; - gid_t group; - int flag; -{ - return INLINE_SYSCALL (fchownat, 5, fd, file, owner, group, flag); -} diff --git a/sysdeps/unix/sysv/linux/linkat.c b/sysdeps/unix/sysv/linux/linkat.c deleted file mode 100644 index e150486..0000000 --- a/sysdeps/unix/sysv/linux/linkat.c +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright (C) 2005-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 - . */ - -#include -#include -#include -#include -#include -#include - - -/* Consider moving to syscalls.list. */ - -/* Make a link to FROM named TO but relative paths in TO and FROM are - interpreted relative to FROMFD and TOFD respectively. */ -int -linkat (fromfd, from, tofd, to, flags) - int fromfd; - const char *from; - int tofd; - const char *to; - int flags; -{ - return INLINE_SYSCALL (linkat, 5, fromfd, from, tofd, to, flags); -} diff --git a/sysdeps/unix/sysv/linux/mkdirat.c b/sysdeps/unix/sysv/linux/mkdirat.c deleted file mode 100644 index 9de1058..0000000 --- a/sysdeps/unix/sysv/linux/mkdirat.c +++ /dev/null @@ -1,38 +0,0 @@ -/* Copyright (C) 2005-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 - . */ - -#include -#include -#include -#include -#include -#include -#include - - -/* Consider moving to syscalls.list. */ - -/* Create a new directory with permission bits MODE. But interpret - relative PATH names relative to the directory associated with FD. */ -int -mkdirat (fd, file, mode) - int fd; - const char *file; - mode_t mode; -{ - return INLINE_SYSCALL (mkdirat, 3, fd, file, mode); -} diff --git a/sysdeps/unix/sysv/linux/readlinkat.c b/sysdeps/unix/sysv/linux/readlinkat.c deleted file mode 100644 index 8755fc8..0000000 --- a/sysdeps/unix/sysv/linux/readlinkat.c +++ /dev/null @@ -1,41 +0,0 @@ -/* Copyright (C) 2005-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 - . */ - -#include -#include -#include -#include -#include -#include -#include -#include - - -/* Consider moving to syscalls.list. */ - -/* Read the contents of the symbolic link PATH relative to FD into no - more than LEN bytes of BUF. */ -ssize_t -readlinkat (fd, path, buf, len) - int fd; - const char *path; - char *buf; - size_t len; -{ - return INLINE_SYSCALL (readlinkat, 4, fd, path, buf, len); -} -libc_hidden_def (readlinkat) diff --git a/sysdeps/unix/sysv/linux/renameat.c b/sysdeps/unix/sysv/linux/renameat.c deleted file mode 100644 index 6f2e148..0000000 --- a/sysdeps/unix/sysv/linux/renameat.c +++ /dev/null @@ -1,36 +0,0 @@ -/* Copyright (C) 2005-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 - . */ - -#include -#include -#include -#include -#include - - -/* Consider moving to syscalls.list. */ - -/* Rename the file OLD relative to OLDFD to NEW relative to NEWFD. */ -int -renameat (oldfd, old, newfd, new) - int oldfd; - const char *old; - int newfd; - const char *new; -{ - return INLINE_SYSCALL (renameat, 4, oldfd, old, newfd, new); -} diff --git a/sysdeps/unix/sysv/linux/symlinkat.c b/sysdeps/unix/sysv/linux/symlinkat.c deleted file mode 100644 index 1166525..0000000 --- a/sysdeps/unix/sysv/linux/symlinkat.c +++ /dev/null @@ -1,38 +0,0 @@ -/* Copyright (C) 2005-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 - . */ - -#include -#include -#include -#include -#include -#include -#include -#include - - -/* Consider moving to syscalls.list. */ - -/* Make a symbolic link to FROM named TO relative to TOFD. */ -int -symlinkat (from, tofd, to) - const char *from; - int tofd; - const char *to; -{ - return INLINE_SYSCALL (symlinkat, 3, from, tofd, to); -} diff --git a/sysdeps/unix/sysv/linux/syscalls.list b/sysdeps/unix/sysv/linux/syscalls.list index d639d63..5e3968a 100644 --- a/sysdeps/unix/sysv/linux/syscalls.list +++ b/sysdeps/unix/sysv/linux/syscalls.list @@ -84,6 +84,14 @@ wait4 - wait4 i:iWiP __wait4 wait4 chown - chown i:sii __libc_chown __chown chown +fchownat - fchownat i:isiii fchownat +linkat - linkat i:isisi linkat +mkdirat - mkdirat i:isi mkdirat +readlinkat - readlinkat i:issi readlinkat +renameat - renameat i:isis renameat +symlinkat - symlinkat i:sis symlinkat +unlinkat - unlinkat i:isi unlinkat + setxattr - setxattr i:sspii setxattr lsetxattr - lsetxattr i:sspii lsetxattr fsetxattr - fsetxattr i:ispii fsetxattr diff --git a/sysdeps/unix/sysv/linux/unlinkat.c b/sysdeps/unix/sysv/linux/unlinkat.c deleted file mode 100644 index 2d5bd74..0000000 --- a/sysdeps/unix/sysv/linux/unlinkat.c +++ /dev/null @@ -1,39 +0,0 @@ -/* unlinkat -- Remove a link by relative name. - Copyright (C) 2005-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 - . */ - -#include -#include -#include -#include -#include -#include -#include -#include - - -/* Consider moving to syscalls.list. */ - -/* Remove the link named NAME. */ -int -unlinkat (fd, file, flag) - int fd; - const char *file; - int flag; -{ - return INLINE_SYSCALL (unlinkat, 3, fd, file, flag); -}