syscall table patch
Hollis Blanchard
hollisb at us.ibm.com
Sat Nov 8 06:06:18 EST 2003
On Friday, Nov 7, 2003, at 12:48 US/Central, linas at austin.ibm.com wrote:
>
> First reason:
> Because I wanted to define a macro to initialize the 32-bit and
> 64-bit
> tables at the same time, and couldn't figure out how to do this at
> compile time.
[snip]
> and so one can't initialize 32 and 64 bit tables with one macro.
I don't see why that's important. They are different tables, after
all...
> Second reason:
> If one does a simple C array such as the following:
> (void (*)()) sys_call_table[NR_syscalls] = { ..., sys_execve, ... }
>
> Then its real easy to make off-by-one errors by accidentally
> misplacing an initializer.
[snip]
This may be a C99 thing, but:
#include <stdio.h>
void main(void) {
int array[] = { [12] = 1, };
printf("%i\n", array[0]);
printf("%i\n", array[12]);
}
--
Hollis Blanchard
IBM Linux Technology Center
** Sent via the linuxppc64-dev mail list. See http://lists.linuxppc.org/
More information about the Linuxppc64-dev
mailing list