Re: socket programming in kernel space

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




mem_segment_t old_fs=get_fs();
set_fs(get_ds());
/*****Add your Code here******/
    //to create a socket use sys_socket or sock_create look at
function sys_socket in linux/net/socket.c
//similary you could use functions sock_sendmsg/sock_recvmsg to send
/recv messages
/*****************************/
set_fs(old_fs);


Why do I have to use "set_fs(get_ds())" in order to use the available system calls? Can't I just be able to use them straight way? 

Is there any performance penalty for using system call this way?
Thanks!


Fei


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux