From: Jakub Jelinek <jakub@redhat.com>
To: Ulrich Drepper <drepper@redhat.com>
Cc: Glibc hackers <libc-hacker@sources.redhat.com>
Subject: [PATCH] One more sendfile & sendfile64 fix
Date: Fri, 07 Jun 2002 02:54:00 -0000 [thread overview]
Message-ID: <20020607115433.L20867@sunsite.ms.mff.cuni.cz> (raw)
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
reply other threads:[~2002-06-07 9:54 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20020607115433.L20867@sunsite.ms.mff.cuni.cz \
--to=jakub@redhat.com \
--cc=drepper@redhat.com \
--cc=libc-hacker@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).