Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 11-07-2009, 12:42 PM   #1
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?

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

Rep: Reputation: Disabled

For all intents and purposes, this *is* the interface:
#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


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 01:22 PM
connection between java socket and unix socket sathishkumar Programming 1 01-10-2006 03:21 PM
Please Help, Linux mysql nfs : Bind on unix socket: Function not implemented nmotte Linux - Networking 1 10-29-2005 07:58 AM
Unable to connect to UNIX socket /tmp/.esd/socket error while using grip dr_zayus69 Linux - Software 4 08-23-2005 07:28 PM
(C++) Unix/Linux Networking Socket tutorials ? Dark Carnival Programming 7 08-09-2004 05:43 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:21 PM.

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