On Mon, Jun 20, 2022 at 12:28 PM Richard Henderson <
richard.hender...@linaro.org> wrote:

> On 6/20/22 10:42, Warner Losh wrote:
> > +static abi_long do_bsd_readlink(CPUArchState *env, abi_long arg1,
> > +        abi_long arg2, abi_long arg3)
> > +{
> > +    abi_long ret;
> > +    void *p1, *p2;
> > +
> > +    LOCK_PATH(p1, arg1);
> > +    p2 = lock_user(VERIFY_WRITE, arg2, arg3, 0);
> > +    if (p2 == NULL) {
> > +        UNLOCK_PATH(p1, arg1);
> > +        return -TARGET_EFAULT;
> > +    }
> > +#ifdef __FreeBSD__
> > +    if (strcmp(p1, "/proc/curproc/file") == 0) {
> > +        CPUState *cpu = env_cpu(env);
> > +        TaskState *ts = (TaskState *)cpu->opaque;
> > +        strncpy(p2, ts->bprm->fullpath, arg3);
> > +        ret = MIN((abi_long)strlen(ts->bprm->fullpath), arg3);
> > +    } else
> > +#endif
>
> Unfortunate ifdef.  Do we really need it while the other bsds are
> presumably still
> non-functional?  I see that HOST_DEFAULT_BSD_TYPE isn't hooked up either...
>

I can remove the ifdef for now and add it to the TODO file as something to
check
when we try to support NetBSD/OpenBSD again.

Warner

Reply via email to