From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3647 invoked by alias); 7 Jun 2002 09:54:43 -0000 Mailing-List: contact libc-hacker-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sources.redhat.com Received: (qmail 3599 invoked from network); 7 Jun 2002 09:54:37 -0000 Received: from unknown (HELO sunsite.mff.cuni.cz) (195.113.19.66) by sources.redhat.com with SMTP; 7 Jun 2002 09:54:37 -0000 Received: (from jakub@localhost) by sunsite.mff.cuni.cz (8.11.6/8.11.6) id g579sXF13758; Fri, 7 Jun 2002 11:54:33 +0200 Date: Fri, 07 Jun 2002 02:54:00 -0000 From: Jakub Jelinek To: Ulrich Drepper Cc: Glibc hackers Subject: [PATCH] One more sendfile & sendfile64 fix Message-ID: <20020607115433.L20867@sunsite.ms.mff.cuni.cz> Reply-To: Jakub Jelinek Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i X-SW-Source: 2002-06/txt/msg00007.txt.bz2 Hi! glibc would still not build with the last patch I've sent, so in addition to that one something like this is needed. The problem is that when linux/syscalls.list declares EXTRA sendfile and sendfile64 and linux/alpha/syscalls.list declares EXTRA sendfile with sendfile64 alias, glibc configury decides to build io/sendfile.o*, io/sendfile64.o* and misc/sendfile.o*, where io/sendfile64.o is sysdeps/generic/sendfile64.c, one of the sendfile.o* is the alpha syscall with sendfile64 alias and the other is the linux syscall without sendfile64 alias. The following patch adds sendfile and sendfile64 to the Makefile, so even glibcs build with kernel headers not having sendfile will still export stub sendfile and makes sure only one of each is built into glibc (whether it is stub or not). 2002-06-06 Jakub Jelinek * sysdeps/generic/sendfile.c: New. * sysdeps/unix/sysv/linux/alpha/sendfile64.c: New. * sysdeps/unix/sysv/linux/ia64/sendfile64.c: New. * sysdeps/unix/sysv/linux/sparc/sparc64/sendfile64.c: New. * sysdeps/unix/sysv/linux/x86_64/sendfile64.c: New. * sysdeps/unix/sysv/linux/syscalls.list (sendfile): Remove EXTRA. (sendfile64): Likewise. * sysdeps/unix/sysv/linux/alpha/syscalls.list (sendfile): Likewise. * sysdeps/unix/sysv/linux/ia64/syscalls.list (sendfile): Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list (sendfile): Likewise. * sysdeps/unix/sysv/linux/x86_64/syscalls.list (sendfile): Likewise. * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Add sendfile and sendfile64 in io subdir. --- libc/sysdeps/generic/sendfile.c.jj Thu Jun 6 23:25:26 2002 +++ libc/sysdeps/generic/sendfile.c Thu Jun 6 23:26:30 2002 @@ -0,0 +1,33 @@ +/* sendfile -- copy data directly from one file descriptor to another + Copyright (C) 2002 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, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include +#include + +/* Send COUNT bytes from file associated with IN_FD starting at OFFSET to + descriptor OUT_FD. */ +ssize_t +sendfile (int out_fd, int in_fd, off_t *offset, size_t count) +{ + __set_errno (ENOSYS); + return -1; +} +stub_warning (sendfile) + +#include --- libc/sysdeps/unix/sysv/linux/alpha/sendfile64.c.jj Thu Jun 6 23:34:31 2002 +++ libc/sysdeps/unix/sysv/linux/alpha/sendfile64.c Thu Jun 6 23:34:23 2002 @@ -0,0 +1 @@ +/* sendfile64 is alias of sendfile syscall. */ --- libc/sysdeps/unix/sysv/linux/alpha/syscalls.list.jj Wed Jun 5 10:35:28 2002 +++ libc/sysdeps/unix/sysv/linux/alpha/syscalls.list Thu Jun 6 23:28:39 2002 @@ -29,7 +29,7 @@ setrlimit - setrlimit 2 __setrlimit setr ftruncate - ftruncate 2 __ftruncate ftruncate __ftruncate64 ftruncate64 truncate - truncate 2 truncate truncate64 readahead EXTRA readahead 3 __readahead readahead -sendfile EXTRA sendfile i:iipi sendfile sendfile64 +sendfile - sendfile i:iipi sendfile sendfile64 # these are actually common with the x86: sys_ustat ustat ustat 2 __syscall_ustat --- libc/sysdeps/unix/sysv/linux/ia64/syscalls.list.jj Wed Jun 5 10:35:29 2002 +++ libc/sysdeps/unix/sysv/linux/ia64/syscalls.list Thu Jun 6 23:32:09 2002 @@ -16,7 +16,7 @@ truncate - truncate 2 truncate truncate6 getrlimit - getrlimit 2 __getrlimit getrlimit getrlimit64 setrlimit - setrlimit 2 __setrlimit setrlimit setrlimit64 readahead EXTRA readahead 3 __readahead readahead -sendfile EXTRA sendfile i:iipi sendfile sendfile64 +sendfile - sendfile i:iipi sendfile sendfile64 # semaphore and shm system calls msgctl - msgctl i:iip __msgctl msgctl --- libc/sysdeps/unix/sysv/linux/ia64/sendfile64.c.jj Thu Jun 6 23:34:31 2002 +++ libc/sysdeps/unix/sysv/linux/ia64/sendfile64.c Thu Jun 6 23:34:23 2002 @@ -0,0 +1 @@ +/* sendfile64 is alias of sendfile syscall. */ --- libc/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list.jj Wed Jun 5 10:27:57 2002 +++ libc/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list Thu Jun 6 23:32:51 2002 @@ -12,7 +12,7 @@ ftruncate - ftruncate 2 __ftruncate ftru truncate - truncate 2 truncate truncate64 mmap - mmap 6 __mmap mmap __mmap64 mmap64 readahead EXTRA readahead 3 __readahead readahead -sendfile EXTRA sendfile i:iipi sendfile sendfile64 +sendfile - sendfile i:iipi sendfile sendfile64 # Override select.S in parent directory: select - select 5 __select select --- libc/sysdeps/unix/sysv/linux/sparc/sparc64/sendfile64.c.jj Thu Jun 6 23:34:31 2002 +++ libc/sysdeps/unix/sysv/linux/sparc/sparc64/sendfile64.c Thu Jun 6 23:34:23 2002 @@ -0,0 +1 @@ +/* sendfile64 is alias of sendfile syscall. */ --- libc/sysdeps/unix/sysv/linux/x86_64/syscalls.list.jj Wed Jun 5 10:35:35 2002 +++ libc/sysdeps/unix/sysv/linux/x86_64/syscalls.list Thu Jun 6 23:33:11 2002 @@ -15,7 +15,7 @@ setrlimit - setrlimit i:ip __setrlimit s ftruncate - ftruncate i:ii __ftruncate ftruncate ftruncate64 __ftruncate64 truncate - truncate i:si truncate truncate64 readahead EXTRA readahead i:iipi __readahead readahead -sendfile EXTRA sendfile i:iip sendfile sendfile64 +sendfile - sendfile i:iip sendfile sendfile64 # semaphore and shm system calls msgctl - msgctl i:iip __msgctl msgctl --- libc/sysdeps/unix/sysv/linux/x86_64/sendfile64.c.jj Thu Jun 6 23:34:31 2002 +++ libc/sysdeps/unix/sysv/linux/x86_64/sendfile64.c Thu Jun 6 23:34:23 2002 @@ -0,0 +1 @@ +/* sendfile64 is alias of sendfile syscall. */ --- libc/sysdeps/unix/sysv/linux/Makefile.jj Wed Jun 5 10:27:53 2002 +++ libc/sysdeps/unix/sysv/linux/Makefile Thu Jun 6 23:27:51 2002 @@ -104,6 +104,10 @@ ifeq ($(subdir),dirent) sysdep_routines += getdirentries getdirentries64 endif +ifeq ($(subdir),io) +sysdep_routines += sendfile sendfile64 +endif + ifeq ($(subdir),nis) CFLAGS-ypclnt.c = -DUSE_BINDINGDIR=1 endif Jakub