Programming/C Programming
해더파일을 통한 배열 입력
decdream
2008. 11. 4. 08:44
Linux 바닐라 커널에 다음과 같은 코드가 있다.
struct sysent {
int nargs;
int sys_flags;
int (*sys_func)();
const char *sys_name;
long native_scno; /* Match against SYS_* constants. */
};
const struct sysent *sysent;
static const struct sysent sysent0[] = {
#include "syscallent.h"
};
struct sysent {
int nargs;
int sys_flags;
int (*sys_func)();
const char *sys_name;
long native_scno; /* Match against SYS_* constants. */
};
const struct sysent *sysent;
static const struct sysent sysent0[] = {
#include "syscallent.h"
};
// "syscallent.h" { 0, 0, sys_restart_syscall, "restart_syscall"}, /* 0 */ { 1, TP, sys_exit, "exit" }, /* 1 */ { 0, TP, sys_fork, "fork" }, /* 2 */ { 3, 0, sys_read, "read" }, /* 3 */ { 3, 0, sys_write, "write" }, /* 4 */ { 3, TF, sys_open, "open" }, /* 5 */ { 1, 0, sys_close, "close" }, /* 6 */ ... |