LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-07-2009, 01:42 PM   #1
niranjan.patil007
LQ Newbie
 
Registered: Nov 2009
Posts: 1

Rep: Reputation: 0
socket interface in Unix/Linux


I am doing a program using sockets under Unix./Linux in user space.
I include file sys/socket.h

Also i have seen socket implementation in Linux Kernel Source tree under net/sock.h

My question is :- Does sys/scocket.h makes use of net/sock.h as a kernel level implementation, by this way does it act as a posix interface between user programm and actual kernel level implementation of scockets?

Thanks
Niranjan
 
Old 11-07-2009, 04:10 PM   #2
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
No.

For all intents and purposes, this *is* the interface:
http://beej.us/guide/bgnet/output/ht...l#simpleclient
Code:
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <netdb.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <sys/socket.h>

#include <arpa/inet.h>
This does NOT (repeat - does NOT) translate directly to the underlying kernel implementation. In practice, there are great similarities, and relatively little overhead. But from your perspective (the perspective of the application programming, running in user space), the socket library and the underlying implementation are COMPLETELY SEPARATE AND INDEPENDENT.

Make sense?

'Hope that helps .. PSM
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't connect to UNIX socket /var/run/clamav/clamd.socket ganick Linux - Server 8 08-01-2008 02:22 PM
connection between java socket and unix socket sathishkumar Programming 1 01-10-2006 04:21 PM
Please Help, Linux mysql nfs : Bind on unix socket: Function not implemented nmotte Linux - Networking 1 10-29-2005 08:58 AM
Unable to connect to UNIX socket /tmp/.esd/socket error while using grip dr_zayus69 Linux - Software 4 08-23-2005 08:28 PM
(C++) Unix/Linux Networking Socket tutorials ? Dark Carnival Programming 7 08-09-2004 06:43 PM


All times are GMT -5. The time now is 07:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration