Why is read slower than getc?For example, this:for (;;) {        chr++;        amr=read(file1, &wc1, 1);        amr2=read(file2, &wc2, 1);        if (wc1 == wc2) {            if (wc1 == '\n')                line++;            if (amr == 0) {                if (eflg)                    return (1);                return (0);            }            continue;        }is slower than that:for (;;) {    chr++;    c1 = getc(file1);    c2 = getc(file2);    if (c1 == c2) {        if (c1 == '\n')            line++;        if (c1 == EOF) {            if (eflg)                return (1);            return (0);        }        continue;    }getc uses the read system call, so why is it slower?
Why read() is slower than getc()?
linux;c