This is the mail archive of the libc-hacker@sources.redhat.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] One more sendfile & sendfile64 fix


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  <jakub@redhat.com>

	* 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 <sys/sendfile.h>
+#include <errno.h>
+
+/* 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 <stub-tag.h>
--- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]