From owner-freebsd-questions@FreeBSD.ORG Sat Nov 26 08:21:03 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 55F2016A520 for ; Sat, 26 Nov 2005 08:21:03 +0000 (GMT) (envelope-from keramida@ceid.upatras.gr) Received: from aiolos.otenet.gr (aiolos.otenet.gr [195.170.0.93]) by mx1.FreeBSD.org (Postfix) with ESMTP id 715E343D4C for ; Sat, 26 Nov 2005 08:21:01 +0000 (GMT) (envelope-from keramida@ceid.upatras.gr) Received: from flame.pc (patr530-a118.otenet.gr [212.205.215.118]) by aiolos.otenet.gr (8.13.4/8.13.4/Debian-8) with ESMTP id jAQ8KuFP029582; Sat, 26 Nov 2005 10:20:57 +0200 Received: from flame.pc (flame [127.0.0.1]) by flame.pc (8.13.4/8.13.4) with ESMTP id jAQ8KPBs001043; Sat, 26 Nov 2005 10:20:25 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost) by flame.pc (8.13.4/8.13.4/Submit) id jAQ8KNII001042; Sat, 26 Nov 2005 10:20:23 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Date: Sat, 26 Nov 2005 10:20:23 +0200 From: Giorgos Keramidas To: David Kelly Message-ID: <20051126082022.GA962@flame.pc> References: <280A8F3A-C519-425A-8A70-AD9266B8D584@HiWAAY.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <280A8F3A-C519-425A-8A70-AD9266B8D584@HiWAAY.net> Cc: freebsd-questions@freebsd.org Subject: Re: How to find system call in kernel source code? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Nov 2005 08:21:03 -0000 On 2005-11-25 21:09, David Kelly wrote: > The sendfile(2) function is apparently a kernel system call. I've > "find /usr/src -type f -exec grep -il sendfile "{}" \;" and several > variations yet not found where the code which performs sendfile() is > located. Is system call 393. Guessing I'm just missing the dispatch > table. The "default" implementation of sendfile() is in the file: src/sys/kern/uipc_syscalls.c Look for '^sendfile' with grep(1). The arguments of sendfile() are copied in a struct sendfile_args{} and then passed to do_sendfile(). The definition of the sendfile_args struct is in src/sys/sys/sysproto.h and it looks a bit scary with all that padding and macro 'magic' going on around it. > This is also related to P/R bin/89100. At least for me, RELENG_6 > fails to send files greater than 4 GB after a few hours or days on > the disk. Freshly copied files work fine. No problem copying the file > with cp. And md5 confirms the contents have not changed. This sounds suspiciously like a 32-bit value overflowing somewhere :-/