Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 05-30-2002, 05:40 AM   #1
LQ Newbie
Registered: Jan 2001
Location: india
Posts: 9

Rep: Reputation: 0
Question any sys call to get ip address of NIC

Could someone tell me if there is any system call using which i can get the ip address of the machine.
i dont want to run through the shell like me friend has asked me to do by running the "ifconfig" command but get it by programming.
can anyone help me?

Old 05-30-2002, 02:50 PM   #2
Registered: Mar 2002
Location: Elyria, Ohio
Distribution: Debian, Nothing else required
Posts: 141

Rep: Reputation: 15
You might check into the system call gethostbyaddr(3). That should do what you want. -mk
Old 05-30-2002, 03:09 PM   #3
Registered: Aug 2000
Location: NY - USA
Distribution: Slackware
Posts: 109

Rep: Reputation: 15
I've never done this in C myself, but I do recall someone doing sonething like it with Python:

I know it's not *exactly* what you wanted, but it might steer you in the right direction.


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 On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
question about select sys call xatzipol Programming 1 10-30-2005 09:22 AM
kernel : how to add sys call through modules only? pinkeshzaveri Programming 1 09-14-2005 03:17 AM
Write sys call failing ppy Programming 1 11-05-2004 08:57 AM
Any sys call to list all users ? dileepkk Linux - General 5 07-06-2004 06:04 PM
Kill sys call eshwar_ind Programming 4 05-07-2004 11:41 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:35 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
Open Source Consulting | Domain Registration