Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S263277AbTKJMIp (ORCPT ); Mon, 10 Nov 2003 07:08:45 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S263319AbTKJMIp (ORCPT ); Mon, 10 Nov 2003 07:08:45 -0500 Received: from natsmtp01.rzone.de ([81.169.145.166]:12016 "EHLO natsmtp01.rzone.de") by vger.kernel.org with ESMTP id S263277AbTKJMIn (ORCPT ); Mon, 10 Nov 2003 07:08:43 -0500 Message-ID: <3FAF7FC8.8050503@softhome.net> Date: Mon, 10 Nov 2003 13:08:40 +0100 From: "Ihar 'Philips' Filipau" Organization: Home Sweet Home User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20030927 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Davide Rossetti CC: Linux Kernel Mailing List Subject: Re: OT: why no file copy() libc/syscall ?? References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1310 Lines: 42 sendfile(2) - ? Davide Rossetti wrote: > it may be orribly RTFM... but writing a simple framework I realized > there is no libc/POSIX/whoknows > copy(const char* dest_file_name, const char* src_file_name) > > What is the technical reason??? > > I understand that there may be little space for kernel side > optimizations in this area but anyway I'm surprised I have to write > > < the bits to clone the metadata of src_file_name on opening > dest_file_name > > const int BUFSIZE = 1<<12; > char buffer[BUFSIZE]; > int nrb; > while((nrb = read(infd, buffer, BUFSIZE) != -1) { > ret = write(outfd, buffer, nrb); > if(ret != nrb) {...} > } > > instead of something similar to: > sys_fscopy(...) > > regards > -- Ihar 'Philips' Filipau / with best regards from Saarbruecken. -- _ _ _ "... and for $64000 question, could you get yourself |_|*|_| vaguely familiar with the notion of on-topic posting?" |_|_|*| -- Al Viro @ LKML |*|*|*| - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/