Trying to understand UNIX system calls on XV6
The array of syscalls is syscall.c makes use of the designated initialization syntax where you can specify at which index to assign the value.
static int (*syscalls[])(void) = { [SYS_fork] sys_fork,}
SYS_fork
, defined as 1, specifies the index where to assign sys_fork
. Thus the order of the elements doesn't matter using this syntax.