> I have become confused trying to understand 
> the kernel's linkage.
> 
> the kernel uses print() in many places, e.g. 
> /sys/src/9/port/xalloc.c:80
> 
> /sys/src/9/port/devcons.c:211 This calls vseprint(). 
> 
> /sys/src/libc/fmt/fmt.c:47 The fmt library installs %r
> (errfmt) by default.
> 
> /sys/src/libc/fmt/errfmt.c:10 references rerrstr().
> 
> /sys/src/libc/9sys/rerrstr.c:10 references errstr().
> 
> Errstr() is a system call and does not exist in the
> kernel (where it becomes syserrstr()).
> 
> How can this work? ...or does the kernel itself 
> perform system calls?

i believe /sys/src/libc/9syscall generates entry points.
there are text symbols in libc.a for the symbols you
mention.

however, using %r might be a problem.  the kernel
should likely have a stub

int
errfmt(Fmt *f)
{
        return fmtstrcpy(f, up->errstr);
}

- erik

Reply via email to