hi,all
In my program, memory (by using kmalloc) is allocated to form a chain table in
kernel(RTLinux v3.1):
code in kernel:
int allocate_mem(unsigned int fifo)
{
......
p0=(struct Head_Struct *)kmalloc(HEAD_LEN_SIZE);
......
}
int init_module(void)
{
.....
rtf_create_handler(PLC_DATA_FIFO, &allocate_mem);
.....
}
code in userspace:
write(fd1,p,HEAD_LEN_SIZE);
it works well if the chain table is short, But if the chain table is longer ,there is
an error: segmentation fault.
why?
chen
http://goto.sohu.com/goto.php3?code=zarva-sh89-0610mailendt
�콫��������˹��Ҳ��˭�С������������콱!!!!
http://sms.sohu.com/worldcup/smsworldcup.php
��ȡ���籭ȫ����Ѷ�������ֻ�����BB��6666!!
http://mysms.sohu.com
�����Ѻ�����ͬ�ˣ���Դ������!!!!
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
--
For more information on Real-Time Linux see:
http://www.rtlinux.org/