Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S264280AbTKKJvT (ORCPT ); Tue, 11 Nov 2003 04:51:19 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S264282AbTKKJvT (ORCPT ); Tue, 11 Nov 2003 04:51:19 -0500 Received: from natsmtp01.rzone.de ([81.169.145.166]:37822 "EHLO natsmtp01.rzone.de") by vger.kernel.org with ESMTP id S264280AbTKKJvR (ORCPT ); Tue, 11 Nov 2003 04:51:17 -0500 Message-ID: <3FB0B10E.9060907@softhome.net> Date: Tue, 11 Nov 2003 10:51:10 +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: Florian Weimer CC: Linux Kernel Mailing List , Valdis.Kletnieks@vt.edu, Andreas Dilger 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: 1343 Lines: 35 Florian Weimer wrote: > Andreas Dilger wrote: > > >>>This is fast turning into a creeping horror of aggregation. I defy anybody >>>to create an API to cover all the options mentioned so far and *not* have it >>>look like the process_clone horror we so roundly derided a few weeks ago. >> >> int sys_copy(int fd_src, int fd_dst) > > > Doesn't work. You have to set the security attributes while you open > fd_dst. int new_fd = sys_copy( int src_fd ); /* cloned copy, out of any fs */ fchmod( new_fd, XXX_WHAT_EVER ); /* do the job. */ ... flink(new_fd, "/some/path/some/file/name"); /* commit to fs */ close(new_fd); /* bye-bye */ I beleive this can be more useful. Not only in naive tries to replace cp(1) with kernel ;-) -- 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/