Re: [PATCH] How to write a portable "run_on" program?

From: Rusty Russell (rusty@rustcorp.com.au)
Date: Thu May 08 2003 - 02:00:24 EST


In message <Pine.LNX.4.44.0305072221120.16772-100000@home.transmeta.com> you write:
> In other words, the proper way to do set_cpu() is
>
> int set_cpu(int cpu)
> {
> fd_set cpuset;
>
> FD_ZERO(&cpuset);
> FD_SET(cpu, cpuset);
> return sched_setaffinity(getpid(), sizeof(cpuset), &cpuset);
> }
>
> which is a HELL OF A LOT more readable than the crap you're spouting
> (either your "before" _or_ your "after" crap).

Congratulations: you're the only programmer to get this right. It's
not your code I'm worried about 8(

Meanwhile, everyone is doing "unsigned long" because it "works on
x86".

Rusty.

--
  Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
-
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/



This archive was generated by hypermail 2b29 : Thu May 15 2003 - 22:00:26 EST