Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 2 Mar 2008 12:01:30 +0100
From:      Roman Divacky <rdivacky@freebsd.org>
To:        emulation@freebsd.org
Cc:        jeff@freebsd.org
Subject:   [PATCH] linux get affinity syscall
Message-ID:  <20080302110130.GA30563@freebsd.org>

next in thread | raw e-mail | index | archive | help

--6c2NcOVqGQ03X4Wi
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

hi..

jeff commited his cpu set and I tried to map that to linuxulator
version of linux_sched_getaffinity(), the current (untested) code
looks like this:

/*
 * Get affinity of a process
 */
int
linux_sched_getaffinity(struct thread *td,
    struct linux_sched_getaffinity_args *args)
{
        int error;
        struct cpuset_getaffinity_args cga;

        if (args->len < sizeof(cpumask_t))
                return (EINVAL);

        cga.level = CPU_LEVEL_WHICH;
        cga.which = CPU_WHICH_PID;
        cga.id = args->pid;
        cga.cpusetsize = sizeof(cpumask_t) * NBBY;
        cga.mask = (long *) args->user_mask_ptr;

        if ((error = cpuset_getaffinity(td, &cga)) == 0)
                td->td_retval[0] = sizeof(cpumask_t);

        return (error);
}


can someone comment on this? thnx

roman

--6c2NcOVqGQ03X4Wi
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.4 (FreeBSD)

iD8DBQFHyokKLVEj6D3CBEwRAgzPAJ0YNBsh8oOcURZxirhObID7kr+btwCfd+nJ
xR36GH7c758tNK3XdDRWGzs=
=FGob
-----END PGP SIGNATURE-----

--6c2NcOVqGQ03X4Wi--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080302110130.GA30563>