Sponsored Content
Full Discussion: External comands in C?
Top Forums Programming External comands in C? Post 33477 by S.P.Prasad on Tuesday 7th of January 2003 03:51:29 AM
Old 01-07-2003
I presume that you may have to work with the following Networking Services Library Functions like:
sethostent ( ) , gethostent ( ) and endhostent ( ) and some Sockets Library Functions like:
ntohs ( ) and inet_ntoa ( ) and
Standard C Library Functions like:
system ( )
There can be multiple ways to solve your requirement and much depends upon how you want to implement it.
See man pages for more explanations.

Last edited by S.P.Prasad; 01-07-2003 at 06:33 AM..
 

10 More Discussions You Might Find Interesting

1. Solaris

External USB

Is it possible to install Solaris 10 on an external USB drive? I'd like to dual boot Linux and Solaris 10. Thanks! (2 Replies)
Discussion started by: otterit
2 Replies

2. Shell Programming and Scripting

how to identify the type of shell using comands..

Dear friends, please tell me how to identify the type of the shell (whether cShell, kshell or anything else) please tell me the command. waiting for ur reply.... regards, swamymns (2 Replies)
Discussion started by: swamymns
2 Replies

3. UNIX for Advanced & Expert Users

For Loops Within Ftp Comands

I am having trouble getting files to ftp over when I run the file names through a loop. If I just do one file it works, but inside of a for loop it does not. Help! ################section 2 cd /home/salazar/chk_data chmod 777 * ftp -n 161.241.--.-- <<! user anonymous \n ascii for... (6 Replies)
Discussion started by: jsalz638
6 Replies

4. Cybersecurity

comands inside the script

hi, i want to put a set of commands inside a script and executing commands sequentially. there are 2 commands, the first command copies the program from my machine to another machine, execute it and get the result on my machine. the second command removes the program which was copied to the... (4 Replies)
Discussion started by: mercuryshipzz
4 Replies

5. Solaris

Solaris 10 network, process, database related comands

Hi everbody, Can anyone let me know the resources for list of network, process, database related commands of solaris10 possibly with little bit of explanation. Thanks in advance, Chandra Sekhar. (1 Reply)
Discussion started by: chandoo.java
1 Replies

6. Linux

External disk

Hi, I connected a external hard disk to my linux machine(Redhat 5) and shared the external hard disk by using NFS. The problem is hard disk becoming read-only file system after some time, could some one please tell me the reason for it. I created two partitions with ext3 filesystem in... (10 Replies)
Discussion started by: ktrimu
10 Replies

7. Shell Programming and Scripting

Script Help - Multi Comands

Hi guys I am trying to get a bunch of lines into a .sh script that will let me easily run a bunch of commands on its own without me having to be there... I have done this with other things but apparetnly it doesn't like to use yum.. I will post my script you will see what im trying to do.. ... (3 Replies)
Discussion started by: Bigstack
3 Replies

8. UNIX for Dummies Questions & Answers

External HDD

I need to get an external HDD for a SUN server running Solaris 10. The Western Digital that I have will not recognize and when I went looking for drivers WD only has them for MAC and Windows. Is there a External HDD that is known to work with Unix? (24 Replies)
Discussion started by: SIFT3R
24 Replies

9. UNIX for Dummies Questions & Answers

Execute multiple comands on one single line

hi, I have a litle problem i wish to excute this comand : ./test.sh -e txt /home -l a so what it says is that "-e" shows me all the extenions that are ".txt" in "home" this works but then i wish that "-l" will show all files begining in this case with the letter "a" . Both comands work... (5 Replies)
Discussion started by: samirboss
5 Replies

10. Shell Programming and Scripting

Use of the below ftp comands

plz let me know what the below ftp is doing it . ftp -m amazon-d . -i /test/load/y748_W*.stc (1 Reply)
Discussion started by: ramkumar15
1 Replies
endhostent(3XNET)				   X/Open Networking Services Library Functions 				 endhostent(3XNET)

NAME
endhostent, gethostbyaddr, gethostbyname, gethostent, sethostent - network host database functions SYNOPSIS
cc [ flag ... ] file ... -lxnet [ library ... ] #include <netdb.h> extern int h_errno; void endhostent(void) struct hostent *gethostbyaddr(const void *addr, socklen_t len, int type); struct hostent *gethostbyname(const char *name); struct hostent *gethostent(void) void sethostent(int stayopen); DESCRIPTION
The gethostent(), gethostbyaddr(), and gethostbyname() functions each return a pointer to a hostent structure, the members of which contain the fields of an entry in the network host database. The gethostent() function reads the next entry of the database, opening a connection to the database if necessary. The gethostbyaddr() function searches the database and finds an entry which matches the address family specified by the type argument and which matches the address pointed to by the addr argument, opening a connection to the database if necessary. The addr argument is a pointer to the binary-format (that is, not null-terminated) address in network byte order, whose length is specified by the len argument. The datatype of the address depends on the address family. For an address of type AF_INET, this is an in_addr structure, defined in <netinet/in.h>. For an address of type AF_INET6, there is an in6_addr structure defined in <netinet/in.h>. The gethostbyname() function searches the database and finds an entry which matches the host name specified by the name argument, opening a connection to the database if necessary. If name is an alias for a valid host name, the function returns information about the host name to which the alias refers, and name is included in the list of aliases returned. The sethostent() function opens a connection to the network host database, and sets the position of the next entry to the first entry. If the stayopen argument is non-zero, the connection to the host database will not be closed after each call to gethostent() (either directly, or indirectly through one of the other gethost*() functions). The endhostent() function closes the connection to the database. USAGE
The gethostent(), gethostbyaddr(), and gethostbyname() functions may return pointers to static data, which may be overwritten by subsequent calls to any of these functions. These functions are generally used with the Internet address family. RETURN VALUES
On successful completion, gethostbyaddr(), gethostbyname() and gethostent() return a pointer to a hostent structure if the requested entry was found, and a null pointer if the end of the database was reached or the requested entry was not found. Otherwise, a null pointer is returned. On unsuccessful completion, gethostbyaddr() and gethostbyname() functions set h_errno to indicate the error. ERRORS
No errors are defined for endhostent(), gethostent() and sethostent(). The gethostbyaddr() and gethostbyname() functions will fail in the following cases, setting h_errno to the value shown in the list below. Any changes to errno are unspecified. HOST_NOT_FOUND No such host is known. NO_DATA The server recognised the request and the name but no address is available. Another type of request to the name server for the domain might return an answer. NO_RECOVERY An unexpected server failure occurred which can not be recovered. TRY_AGAIN A temporary and possibly transient error occurred, such as a failure of a server to respond. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
endservent(3XNET), htonl(3XNET), inet_addr(3XNET), attributes(5), standards(5) SunOS 5.11 1 Nov 2003 endhostent(3XNET)
All times are GMT -4. The time now is 02:04 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy