求助,着急
想把一个程序移到内核中,原来是应用程序在程序里加入了一些头文件如下:
#include <linux/config.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/signal.h>
#include <linux/init.h>
#include <linux/wait.h>
#include <linux/smp_lock.h>
#include <asm/unistd.h>
可是,
如果假如了-D__KERNEL__,编译的时候就出现很多错误。
怎么办呀?
着急啊.哪位高手帮帮忙呀.
错误如下:
In file included from /usr/include/linux/fs.h:295,
from /usr/include/linux/capability.h:17,
from /usr/include/linux/binfmts.h:5,
from /usr/include/linux/sched.h:10,
from httpmain.c:18:
/usr/include/linux/ext3_fs_i.h:75: field `truncate_sem' has incomplete type
In file included from /usr/include/linux/fs.h:296,
from /usr/include/linux/capability.h:17,
from /usr/include/linux/binfmts.h:5,
from /usr/include/linux/sched.h:10,
from httpmain.c:18:
/usr/include/linux/hpfs_fs_i.h:19: field `i_sem' has incomplete type
In file included from /usr/include/linux/fs.h:303,
from /usr/include/linux/capability.h:17,
from /usr/include/linux/binfmts.h:5,
from /usr/include/linux/sched.h:10,
from httpmain.c:18:
/usr/include/linux/affs_fs_i.h:27: field `i_link_lock' has incomplete type
/usr/include/linux/affs_fs_i.h:28: field `i_ext_lock' has incomplete type
In file included from /usr/include/linux/fs.h:308,
from /usr/include/linux/capability.h:17,
from /usr/include/linux/binfmts.h:5,
from /usr/include/linux/sched.h:10,
from httpmain.c:18:
/usr/include/linux/shmem_fs.h:24: field `sem' has incomplete type
In file included from /usr/include/linux/fs.h:316,
from /usr/include/linux/capability.h:17,
from /usr/include/linux/binfmts.h:5,
from /usr/include/linux/sched.h:10,
from httpmain.c:18:
/usr/include/linux/ncp_fs_i.h:22: field `open_sem' has incomplete type
In file included from /usr/include/linux/fs.h:319,
from /usr/include/linux/capability.h:17,
from /usr/include/linux/binfmts.h:5,
from /usr/include/linux/sched.h:10,
from httpmain.c:18:
/usr/include/linux/jffs2_fs_i.h:26: field `sem' has incomplete type
In file included from /usr/include/linux/capability.h:17,
from /usr/include/linux/binfmts.h:5,
from /usr/include/linux/sched.h:10,
from httpmain.c:18:
/usr/include/linux/fs.h:417: field `sem' has incomplete type
/usr/include/linux/fs.h:427: field `bd_sem' has incomplete type
/usr/include/linux/fs.h:456: field `i_sem' has incomplete type
/usr/include/linux/fs.h:457: field `i_zombie' has incomplete type
In file included from /usr/include/linux/capability.h:17,
from /usr/include/linux/binfmts.h:5,
from /usr/include/linux/sched.h:10,
from httpmain.c:18:
/usr/include/linux/fs.h:707: field `dqio_sem' has incomplete type
/usr/include/linux/fs.h:708: field `dqoff_sem' has incomplete type
In file included from /usr/include/linux/fs.h:725,
from /usr/include/linux/capability.h:17,
from /usr/include/linux/binfmts.h:5,
from /usr/include/linux/sched.h:10,
from httpmain.c:18:
/usr/include/linux/msdos_fs_sb.h:44: field `fat_lock' has incomplete type
In file included from /usr/include/linux/fs.h:729,
from /usr/include/linux/capability.h:17,
from /usr/include/linux/binfmts.h:5,
from /usr/include/linux/sched.h:10,
from httpmain.c:18:
/usr/include/linux/affs_fs_sb.h:28: field `s_bmlock' has incomplete type
In file included from /usr/include/linux/fs.h:733,
from /usr/include/linux/capability.h:17,
from /usr/include/linux/binfmts.h:5,
from /usr/include/linux/sched.h:10,
from httpmain.c:18:
/usr/include/linux/smb_fs_sb.h:37: field `sem' has incomplete type
In file included from /usr/include/linux/fs.h:740,
from /usr/include/linux/capability.h:17,
from /usr/include/linux/binfmts.h:5,
from /usr/include/linux/sched.h:10,
from httpmain.c:18:
/usr/include/linux/ncp_fs_sb.h:46: field `sem' has incomplete type
In file included from /usr/include/linux/fs.h:743,
from /usr/include/linux/capability.h:17,
from /usr/include/linux/binfmts.h:5,
from /usr/include/linux/sched.h:10,
from httpmain.c:18:
/usr/include/linux/jffs2_fs_sb.h:30: field `gc_thread_start' has incomplete type
/usr/include/linux/jffs2_fs_sb.h:35: field `alloc_sem' has incomplete type
In file included from /usr/include/linux/capability.h:17,
from /usr/include/linux/binfmts.h:5,
from /usr/include/linux/sched.h:10,
from httpmain.c:18:
/usr/include/linux/fs.h:763: field `s_umount' has incomplete type
/usr/include/linux/fs.h:764: field `s_lock' has incomplete type
/usr/include/linux/fs.h:808: field `s_vfs_rename_sem' has incomplete type
/usr/include/linux/fs.h:817: field `s_nfsd_free_path_sem' has incomplete type
In file included from /usr/include/linux/sched.h:25,
from httpmain.c:18:
/usr/include/linux/tty.h:141: field `pty_sem' has incomplete type
/usr/include/linux/tty.h:307: field `atomic_read' has incomplete type
/usr/include/linux/tty.h:308: field `atomic_write' has incomplete type
In file included from /usr/include/linux/signal.h:4,
from /usr/include/linux/sched.h:27,
from httpmain.c:18:
/usr/include/asm/signal.h:107: parse error before `sigset_t'
/usr/include/asm/signal.h:107: warning: no semicolon at end of struct or union
/usr/include/asm/signal.h:110: parse error before `}'
In file included from /usr/include/linux/sched.h:27,
from httpmain.c:18:
/usr/include/linux/signal.h:19: parse error before `sigset_t'
/usr/include/linux/signal.h:19: warning: no semicolon at end of struct or union
In file included from /usr/include/linux/sched.h:27,
from httpmain.c:18:
/usr/include/linux/signal.h:31: parse error before `*'
/usr/include/linux/signal.h: In function `sigaddset':
/usr/include/linux/signal.h:33: `_sig' undeclared (first use in this function)
/usr/include/linux/signal.h:33: (Each undeclared identifier is reported only once
/usr/include/linux/signal.h:33: for each function it appears in.)
/usr/include/linux/signal.h:34: `_NSIG_WORDS' undeclared (first use in this function)
/usr/include/linux/signal.h:35: `set' undeclared (first use in this function)
/usr/include/linux/signal.h:37: `_NSIG_BPW' undeclared (first use in this function)
/usr/include/linux/signal.h: At top level:
/usr/include/linux/signal.h:40: parse error before `*'
/usr/include/linux/signal.h: In function `sigdelset':
/usr/include/linux/signal.h:42: `_sig' undeclared (first use in this function)
/usr/include/linux/signal.h:43: `_NSIG_WORDS' undeclared (first use in this function)
/usr/include/linux/signal.h:44: `set' undeclared (first use in this function)
/usr/include/linux/signal.h:46: `_NSIG_BPW' undeclared (first use in this function)
/usr/include/linux/signal.h: At top level:
/usr/include/linux/signal.h:49: parse error before `*'
/usr/include/linux/signal.h: In function `sigismember':
/usr/include/linux/signal.h:51: `_sig' undeclared (first use in this function)
/usr/include/linux/signal.h:52: `_NSIG_WORDS' undeclared (first use in this function)
/usr/include/linux/signal.h:53: `set' undeclared (first use in this function)
/usr/include/linux/signal.h:55: `_NSIG_BPW' undeclared (first use in this function)
In file included from /usr/include/linux/sched.h:27,
from httpmain.c:18:
/usr/include/linux/signal.h: At top level:
/usr/include/linux/signal.h:108: parse error before `*'
/usr/include/linux/signal.h: In function `sigorsets':
/usr/include/linux/signal.h:108: `_NSIG_WORDS' undeclared (first use in this function)
/usr/include/linux/signal.h:108: `a' undeclared (first use in this function)
/usr/include/linux/signal.h:108: `b' undeclared (first use in this function)
/usr/include/linux/signal.h:108: `r' undeclared (first use in this function)
/usr/include/linux/signal.h:108: warning: unreachable code at beginning of switch statement
/usr/include/linux/signal.h: At top level:
/usr/include/linux/signal.h:111: parse error before `*'
/usr/include/linux/signal.h: In function `sigandsets':
/usr/include/linux/signal.h:111: `_NSIG_WORDS' undeclared (first use in this function)
/usr/include/linux/signal.h:111: `a' undeclared (first use in this function)
/usr/include/linux/signal.h:111: `b' undeclared (first use in this function)
/usr/include/linux/signal.h:111: `r' undeclared (first use in this function)
/usr/include/linux/signal.h:111: warning: unreachable code at beginning of switch statement
/usr/include/linux/signal.h: At top level:
/usr/include/linux/signal.h:114: parse error before `*'
/usr/include/linux/signal.h: In function `signandsets':
/usr/include/linux/signal.h:114: `_NSIG_WORDS' undeclared (first use in this function)
/usr/include/linux/signal.h:114: `a' undeclared (first use in this function)
/usr/include/linux/signal.h:114: `b' undeclared (first use in this function)
/usr/include/linux/signal.h:114: `r' undeclared (first use in this function)
/usr/include/linux/signal.h:114: warning: unreachable code at beginning of switch statement
/usr/include/linux/signal.h: At top level:
/usr/include/linux/signal.h:140: parse error before `*'
/usr/include/linux/signal.h: In function `signotset':
/usr/include/linux/signal.h:140: `_NSIG_WORDS' undeclared (first use in this function)
/usr/include/linux/signal.h:140: `set' undeclared (first use in this function)
/usr/include/linux/signal.h: At top level:
/usr/include/linux/signal.h:145: parse error before `*'
/usr/include/linux/signal.h: In function `sigemptyset':
/usr/include/linux/signal.h:147: `_NSIG_WORDS' undeclared (first use in this function)
/usr/include/linux/signal.h:148: default label not within a switch statement
/usr/include/linux/signal.h:149: `set' undeclared (first use in this function)
/usr/include/linux/signal.h:149: `sigset_t' undeclared (first use in this function)
/usr/include/linux/signal.h:150: break statement not within loop or switch
/usr/include/linux/signal.h:151: case label not within a switch statement
/usr/include/linux/signal.h:152: case label not within a switch statement
/usr/include/linux/signal.h:153: break statement not within loop or switch
/usr/include/linux/signal.h: At top level:
/usr/include/linux/signal.h:157: parse error before `*'
/usr/include/linux/signal.h: In function `sigfillset':
/usr/include/linux/signal.h:159: `_NSIG_WORDS' undeclared (first use in this function)
/usr/include/linux/signal.h:160: default label not within a switch statement
/usr/include/linux/signal.h:161: `set' undeclared (first use in this function)
/usr/include/linux/signal.h:161: `sigset_t' undeclared (first use in this function)
/usr/include/linux/signal.h:162: break statement not within loop or switch
/usr/include/linux/signal.h:163: case label not within a switch statement
/usr/include/linux/signal.h:164: case label not within a switch statement
/usr/include/linux/signal.h:165: break statement not within loop or switch
/usr/include/linux/signal.h: At top level:
/usr/include/linux/signal.h:169: parse error before `*'
/usr/include/linux/signal.h:173: parse error before `*'
/usr/include/linux/signal.h: In function `sigaddsetmask':
/usr/include/linux/signal.h:175: `set' undeclared (first use in this function)
/usr/include/linux/signal.h:175: `mask' undeclared (first use in this function)
/usr/include/linux/signal.h: At top level:
/usr/include/linux/signal.h:178: parse error before `*'
/usr/include/linux/signal.h: In function `sigdelsetmask':
/usr/include/linux/signal.h:180: `set' undeclared (first use in this function)
/usr/include/linux/signal.h:180: `mask' undeclared (first use in this function)
/usr/include/linux/signal.h: At top level:
/usr/include/linux/signal.h:183: parse error before `*'
/usr/include/linux/signal.h: In function `sigtestsetmask':
/usr/include/linux/signal.h:185: `set' undeclared (first use in this function)
/usr/include/linux/signal.h:185: `mask' undeclared (first use in this function)
/usr/include/linux/signal.h: At top level:
/usr/include/linux/signal.h:188: parse error before `*'
/usr/include/linux/signal.h: In function `siginitset':
/usr/include/linux/signal.h:190: `set' undeclared (first use in this function)
/usr/include/linux/signal.h:190: `mask' undeclared (first use in this function)
/usr/include/linux/signal.h:191: `_NSIG_WORDS' undeclared (first use in this function)
/usr/include/linux/signal.h:192: default label not within a switch statement
/usr/include/linux/signal.h:194: break statement not within loop or switch
/usr/include/linux/signal.h:195: case label not within a switch statement
/usr/include/linux/signal.h:196: case label not within a switch statement
/usr/include/linux/signal.h: At top level:
/usr/include/linux/signal.h:200: parse error before `*'
/usr/include/linux/signal.h: In function `siginitsetinv':
/usr/include/linux/signal.h:202: `set' undeclared (first use in this function)
/usr/include/linux/signal.h:202: `mask' undeclared (first use in this function)
/usr/include/linux/signal.h:203: `_NSIG_WORDS' undeclared (first use in this function)
/usr/include/linux/signal.h:204: default label not within a switch statement
/usr/include/linux/signal.h:206: break statement not within loop or switch
/usr/include/linux/signal.h:207: case label not within a switch statement
/usr/include/linux/signal.h:208: case label not within a switch statement
/usr/include/linux/signal.h: In function `init_sigpending':
/usr/include/linux/signal.h:216: dereferencing pointer to incomplete type
/usr/include/linux/signal.h:217: dereferencing pointer to incomplete type
/usr/include/linux/signal.h:218: dereferencing pointer to incomplete type
/usr/include/linux/signal.h:218: dereferencing pointer to incomplete type
In file included from httpmain.c:18:
/usr/include/linux/sched.h: At top level:
/usr/include/linux/sched.h:216: parse error before `pgd_t'
/usr/include/linux/sched.h:216: warning: no semicolon at end of struct or union
/usr/include/linux/sched.h:236: parse error before `:'
/usr/include/linux/sched.h:240: parse error before `}'
/usr/include/linux/sched.h:258: `_NSIG' undeclared here (not in a function)
/usr/include/linux/sched.h:398: parse error before `sigset_t'
/usr/include/linux/sched.h:398: warning: no semicolon at end of struct or union
/usr/include/linux/sched.h:405: parse error before `*'
/usr/include/linux/sched.h:405: warning: data definition has no type or storage class
/usr/include/linux/sched.h:420: parse error before `}'
/usr/include/linux/sched.h:522: field `task' has incomplete type
/usr/include/linux/sched.h: In function `hash_pid':
/usr/include/linux/sched.h:539: dereferencing pointer to incomplete type
/usr/include/linux/sched.h:539: dereferencing pointer to incomplete type
/usr/include/linux/sched.h:541: dereferencing pointer to incomplete type
/usr/include/linux/sched.h:542: dereferencing pointer to incomplete type
/usr/include/linux/sched.h:542: dereferencing pointer to incomplete type
/usr/include/linux/sched.h:544: dereferencing pointer to incomplete type
/usr/include/linux/sched.h: In function `unhash_pid':
/usr/include/linux/sched.h:549: dereferencing pointer to incomplete type
/usr/include/linux/sched.h:550: dereferencing pointer to incomplete type
/usr/include/linux/sched.h:550: dereferencing pointer to incomplete type
/usr/include/linux/sched.h:551: dereferencing pointer to incomplete type
/usr/include/linux/sched.h:551: dereferencing pointer to incomplete type
/usr/include/linux/sched.h: In function `find_task_by_pid':
/usr/include/linux/sched.h:558: dereferencing pointer to incomplete type
/usr/include/linux/sched.h:558: dereferencing pointer to incomplete type
In file included from httpmain.c:18:
/usr/include/linux/sched.h: At top level:
/usr/include/linux/sched.h:613: parse error before `*'
/usr/include/linux/sched.h:615: parse error before `sigset_t'
/usr/include/linux/sched.h: In function `signal_pending':
/usr/include/linux/sched.h:634: dereferencing pointer to incomplete type
/usr/include/linux/sched.h: At top level:
/usr/include/linux/sched.h:641: parse error before `*'
/usr/include/linux/sched.h: In function `has_pending_signals':
/usr/include/linux/sched.h:646: `_NSIG_WORDS' undeclared (first use in this function)
/usr/include/linux/sched.h:647: default label not within a switch statement
/usr/include/linux/sched.h:649: `signal' undeclared (first use in this function)
/usr/include/linux/sched.h:649: `blocked' undeclared (first use in this function)
/usr/include/linux/sched.h:650: break statement not within loop or switch
/usr/include/linux/sched.h:652: case label not within a switch statement
/usr/include/linux/sched.h:656: break statement not within loop or switch
/usr/include/linux/sched.h:658: case label not within a switch statement
/usr/include/linux/sched.h:660: break statement not within loop or switch
/usr/include/linux/sched.h:662: case label not within a switch statement
/usr/include/linux/sched.h: In function `recalc_sigpending':
/usr/include/linux/sched.h:673: dereferencing pointer to incomplete type
/usr/include/linux/sched.h:673: dereferencing pointer to incomplete type
/usr/include/linux/sched.h:673: dereferencing pointer to incomplete type
/usr/include/linux/sched.h: In function `on_sig_stack':
/usr/include/linux/sched.h:680: dereferencing pointer to incomplete type
/usr/include/linux/sched.h:680: dereferencing pointer to incomplete type
/usr/include/linux/sched.h: In function `sas_ss_flags':
/usr/include/linux/sched.h:685: dereferencing pointer to incomplete type
/usr/include/linux/sched.h: In function `suser':
/usr/include/linux/sched.h:710: dereferencing pointer to incomplete type
/usr/include/linux/sched.h:711: dereferencing pointer to incomplete type
/usr/include/linux/sched.h: In function `fsuser':
/usr/include/linux/sched.h:719: dereferencing pointer to incomplete type
/usr/include/linux/sched.h:720: dereferencing pointer to incomplete type
/usr/include/linux/sched.h: In function `capable':
/usr/include/linux/sched.h:735: dereferencing pointer to incomplete type
/usr/include/linux/sched.h:740: dereferencing pointer to incomplete type
/usr/include/linux/sched.h: In function `mmdrop':
/usr/include/linux/sched.h:758: dereferencing pointer to incomplete type
/usr/include/linux/sched.h: In function `unhash_process':
/usr/include/linux/sched.h:890: dereferencing pointer to incomplete type
/usr/include/linux/sched.h:890: dereferencing pointer to incomplete type
/usr/include/linux/sched.h:890: dereferencing pointer to incomplete type
/usr/include/linux/sched.h:890: dereferencing pointer to incomplete type
/usr/include/linux/sched.h:890: dereferencing pointer to incomplete type
/usr/include/linux/sched.h:890: dereferencing pointer to incomplete type
/usr/include/linux/sched.h:890: dereferencing pointer to incomplete type
/usr/include/linux/sched.h:890: dereferencing pointer to incomplete type
/usr/include/linux/sched.h:890: dereferencing pointer to incomplete type
/usr/include/linux/sched.h:890: dereferencing pointer to incomplete type
/usr/include/linux/sched.h:890: dereferencing pointer to incomplete type
/usr/include/linux/sched.h:890: dereferencing pointer to incomplete type
/usr/include/linux/sched.h:891: dereferencing pointer to incomplete type
/usr/include/linux/sched.h: In function `task_lock':
/usr/include/linux/sched.h:898: dereferencing pointer to incomplete type
/usr/include/linux/sched.h: In function `d_path':
/usr/include/linux/sched.h:913: dereferencing pointer to incomplete type
/usr/include/linux/sched.h:914: dereferencing pointer to incomplete type
/usr/include/linux/sched.h:915: dereferencing pointer to incomplete type
httpmain.c: In function `Domain':
httpmain.c:57: storage size of `serv_addr' isn't known
httpmain.c:70: `INADDR_ANY' undeclared (first use in this function)
httpmain.c:84: storage size of `client_addr' isn't known
httpmain.c:85: storage size of `me' isn't known
httpmain.c:102: sizeof applied to an incomplete type
httpmain.c:250: storage size of `sin2' isn't known
httpmain.c:258: `IPPROTO_TCP' undeclared (first use in this function)
httpmain.c: At top level:
/usr/include/linux/sched.h:220: storage size of `mmap_sem' isn't known
/usr/include/linux/sched.h:399: storage size of `pending' isn't known
make: *** Error 1
页:
[1]