Re: [patch[ Simple Topology API

From: Albert D. Cahalan (acahalan@cs.uml.edu)
Date: Sat Jul 13 2002 - 12:13:55 EST


Alexander Viro writes:

> It's hard to enjoy the use of prctl(). Especially for things like
> "give me the number of the first CPU in node <n>" - it ain't no
> process controll, no matter how you stretch it.

Yeah... eeew.

> <soapbox> That's yet another demonstration of the evil of multiplexing
> syscalls. They hide the broken APIs and make them easy to introduce.
> And broken APIs get introduced - through each of these. prctl(), fcntl(),
> ioctl() - you name it. Please, don't do that. </soapbox>

This wouldn't happen if it wasn't so damn hard to add a syscall.
If you make people go though all the arch maintainers just to
add a simple arch-independent syscall, they'll just bolt their
code into some dark hidden corner of the kernel. That's life.
Make syscalls easy to write, and this won't happen.

Can you guess what would happen if you got rid of prctl(),
fcntl(), and ioctl()? We'd get apps with code like this:

// write address of one of these to /proc/orifice
typedef struct evil {
  int version; // struct version
  struct evil *next; // next in list
  struct evil *prev; // prev in list
  char opcode; // indicates what we will do
  int (*fn)(void *); // callback function (if not NULL)
  void *addr; // an address in kernel memory
  short flags; // 0x0001 call fn w/ ints off, 0x0002 w/ BKL
  double timeout; // in microfortnights (uses APIC's NMI)
} evil;

-
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 : Mon Jul 15 2002 - 22:00:26 EST