lkml.org 
[lkml]   [2003]   [Nov]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: OT: why no file copy() libc/syscall ??

    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/

    \
     
     \ /
      Last update: 2005-03-22 13:58    [W:0.022 / U:3.032 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site