![]() | |||||||||||||
Messages in this thread |
> This sounds more complicated than what we are proposing. > > This would make the process care about the number of system calls > implemented by the kernel, which is something that doesn't even come > up in the normal case with the current interface. You only care about > it if you get a -EINVAL and want to figure out exactly why. > > From a practical point of view, you would want code that looks like > this: Yes. [1] > n = nsyscalls(); > mask = malloc((n + 7)/8); > if(mask == NULL) > return; > > /* Zero mask, set bits, call ptrace */ > > free(mask); > [2] > rather than code like this: > > int mask[(BIGGEST_SYSCALL_I_CARE_ABOUT + 7) / 8]; > > /* Zero mask, set bits, call ptrace */ > That doesn't seem like an improvement to me. > > The second case would be more complicated if it wanted to figure out > what the problem was if ptrace returned -EINVAL. However, some users That is actually my point. If you're checking for errors you will end up first doing [2] and later on doing something like [1] anyway... > > In addition your proposal would already introduce a rather complicated > > interface to figure out how many syscalls the kernel has. I'm sure this > > will be (mis)used sooner or later. > > How? And, if so, why is that a problem? From the proposal: <snip> > Semantics: > > in both cases, the mask is first zero-extended to the right (for syscalls not > known to userspace), bits for syscall not known to the kernel are checked and > the call fails if any of them is 1, and in the failure case E2BIG or > EOVERFLOW is returned (I want to avoid EINVAL and ENOSYS to avoid confusion) > and the part of the mask known to the kernel is 0-ed. <snip> So you just need to pass a large enough bitmask with all ones and the kernel will put zeroes in the bitmask up to the bit number NR_sycalls - 1. Counting the zeroes should work... - 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/ | ||||||||||||
| Last update: 2006-05-02 07:00 [from the cache] ©2003-2008 | |||||||||||||