HDTenEightyP/NetNews huggingface dataset:
From: muquit@mercury.ncat.edu
Subject: Re: Get hostname from IP address
Organization: North Carolina A&T State University
Date: Mon, 14 Dec 1992 04:20:53 GMT

And this one also can get IP address from hostname.
I just took some code out from 'ncftp'. The first part was
posted by someone else few days back. 
So, credit goes to the authors.

-------------------CUT--------------
/*  Get host name from IP address
 *  Get IP address from host name
 */

#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <netinet/in.h>
#include <arpa/inet.h>

main (argc, argv)
int argc;
char **argv;
{
   char *add;
   unsigned long addr_bin;
   unsigned long horder;
   struct hostent *host;
   char *name;
   int j;

   if (argc<2) { 
      fprintf(stderr,"Usage:\n%s Site Name\n%s IP Number\n",argv[0],argv[0]);
      exit();
   }
   add= argv[1];
  if ( (sscanf(argv[1],"%d.%d.%d.%d",&j,&j,&j,&j)) == 4){
fprintf(stderr,"\nTrying to get Host Name...\n\n");
if ((inet_addr (argv[1])) == 0xffffffff) {
(void) fprintf(stderr, "This IP adress MUST NOT be valid.. :-)\n\n");
exit(1);
			}
   addr_bin= inet_addr(add);
   host= gethostbyaddr((char*) &addr_bin, sizeof(addr_bin),AF_INET);
if (host == NULL) {
if (h_errno == HOST_NOT_FOUND) {
(void) printf("Sorry! Can't find any Host Name with IP Address \"%s\"\n\n", argv[1]);
   exit(1);
   }
   }
   name=host->h_name;
   printf("Host Name is : %s\nIP address   : %s\n\n",name,add);
exit(0);
}
/***************/
fprintf(stderr,"\nTrying to get IP Address...\n\n");
host=gethostbyname(argv[1]);
if (host == NULL) {
if (h_errno == HOST_NOT_FOUND) {
(void) printf("Sorry! Can't find any Host by the name \"%s\"\n\n", argv[1]);
exit(1);
}
}
if(*host->h_addr_list){
horder=ntohl(*(unsigned long *) *(char **) host->h_addr_list);
printf("IP Address is : %lu.%lu.%lu.%lu\n",
(horder >> 24),
(horder >> 16) & 0xff,
(horder >> 8 ) & 0xff,
horder & 0xff);
fprintf(stderr,"Host name is  : %s\n\n",add);
   }
   }
From: wietse@wzv.win.tue.nl (Wietse Venema)
Newsgroups: comp.unix.programmer
Subject: Re: shared library and setuid process
Date: 19 Dec 92 22:02:53 GMT
Organization: Eindhoven University of Technology, The Netherlands

mishra@controls.ccd.harris.com (Sanjoy Mishra) writes:

>Is there a machine independent way of linking a shared library to make
>a setuid process. LD_LIBRARY_PATH fails if the process is setuid and is
>owned by root.

Owner does not matter; the point is that LD_xxx variables are ignored
when as the effective uid differs from the real uid.

Running a set-uid program causes the effective uid of the process to be
set to the owner of the executable. The real uid remains unchanged.

You do not want LD_xxx variables to be honoured, because that makes
all programs run by your set-uid program vulnerable to trojan horses.

	Wietse
From: jgs@funsys.se (Jan Gifvars)
Newsgroups: comp.unix.programmer
Subject: SCC <-> RSC
Date: 11 Dec 92 10:00:11 GMT
Reply-To: jgs@funsys.se
Organization: Enator Functional Systems AB.

Is there anybody out there who know the difference between SCCS and RCCS ( or RCS,i'm not sure of the name, but enhancements to SCCS ) ?
I think my path is wrong Hhhmmmmm....

Jan Gifvars 
ENATOR Functional Systems
jgs@funsys.se
From: davidh@muppet.bt.co.uk (David Hobley)
Newsgroups: comp.unix.programmer
Subject: Re: Continued Reading of a Growing File
Date: 14 Dec 92 10:30:37 GMT
Reply-To: davidh@muppet.bt.co.uk
Organization: British Telecom Research Laboratories
NNTP-Posting-Host: ishtar.muppet.bt.co.uk

In C, I think you simply need to read until EOF,
sleep for 1 second (say) and then re-read.

Bit of a hack but it works.
---
        David Hobley    davidh@muppet.bt.co.uk
Through the darkness of futures past / The magician longs to see.
One chance out between two worlds    / Fire walk with me.
From: n8743196@henson.cc.wwu.edu (Jeff Wandling)
Newsgroups: comp.unix.programmer
Subject: SPARC assembly (under SunOS) trade books avail?
Summary: Looking for a text on how to program in SPARC assembly
Keywords: sparc assembly tutorial
Date: 13 Dec 92 17:19:18 GMT
Article-I.D.: henson.1992Dec13.171918.2501
Organization: Howling Dog


Hi,

  I'm trying to find a text-book or something that  will explain
how to program in SPARC assembly.  Something like the Ford & Topp
book on MC68000 assembly would be great.   I'm looking for a 
real text-book/PS document/etc.. on SPARC assembly with lots of 
code, not a watered down hand-waving text (as in AnswerBook's 
Sun4 Assembly Manual).

  If you know of such a book, paper, etc.. please  tell me how I
may obtain a copy.  Also,  does there exist a anonymous ftp site
that archives SPARC related documents?

  It is for a compiler project under SunOS 4.1.2, sun4 environment.

  Thanks very much,

-jeff

-- 
Jeff Wandling   <jeff@cs.wwu.edu> 
(the address of this post will be invalid soon, please use the
 address directly above ^^^^)
Newsgroups: comp.unix.programmer,comp.sources.wanted
From: hch@CCCA.NCTU.edu.tw (Huang Chih-Hsien)
Subject: Re: Get hostname from IP address
Organization: National Chiao Tung University
X-Newsreader: TIN [version 1.1 PL6]
Date: Tue, 15 Dec 1992 15:55:06 GMT

dejesus@archimedes.nwc.navy.mil (Francisco X DeJesus) writes:
>I'd like to find a utility I can call from the command-line with an
>internet IP address as an argument, and have it return to me the full
>hostname related to it. I've looked into the function gethostbyaddr()
>but haven't been able to work. I also remember reading about a name-
>resolver funtion nres_gethostbyaddr() (sp?), but can't find any
>references to it on my system. I'm running SunOS 4.1.2 on a Sparc.
>Will post a summary if there's interest. Thanks in advance...

If you are on a SUN, try this:

(EXAMPLE: lookup 140.111.3.21 for NCTUCCCA.edu.tw)
% nslookup 
> set type=ptr
> 21.3.111.140.in-addr.arpa.

---
Huang, Chih-Hsien
Campus Computer Communication Association Vice President
TWNEWS Moderator, NCTUCCCA.edu.tw Anonymous FTP Archives Maintainer
National Chiao Tung University, Hsinchu, Taiwan
hch@NCTUCCCA.edu.tw
Xref: sparky comp.unix.programmer:5717 comp.sources.wanted:5405 comp.lang.perl:7460
From: spaf@cs.purdue.edu (Gene Spafford)
Newsgroups: comp.unix.programmer,comp.sources.wanted,comp.lang.perl
Subject: Re: Get hostname from IP address
Date: 16 Dec 1992 13:36:04 -0500
Organization: Department of Computer Sciences, Purdue University
	<1992Dec11.152438.18365@fwi.uva.nl> <1992Dec13.122835.28103@hyphen.com>
	<1992Dec13.180845.28960@hyphen.com>
	<1gj9afINN47k@mimas.cc.deakin.OZ.AU>
	<1992Dec16.015357.10437@hyphen.com>
NNTP-Posting-Host: uther.cs.purdue.edu
In-reply-to: dwight@hyphen.com's message of Wed, 16 Dec 1992 01:53:57 GMT

It took me all of 10 minutes to build this Perl program a while ago.
It took me more time today to add comments for releasing it than it
did to write it!

It is about 40 plus lines of code, but that is because I choose to
write my programs to include error checking, print usage messages, and
be readable. :-)  

Something to take an IP number and turn it into a hostname can be done
on the command line like so:
perl -le 'print ((gethostbyaddr(pack("C4", split(/\./, shift)), 2))[0])' ip-#-arg
(this assumes that AF_INET == 2 on your machine).
This is not as general, nor is it as good form as what is below (I believe).


#!/usr/local/perl/perl
# 
#  "canon" program.  E. Spafford <spaf@cs.purdue.edu>
#

require "getopts.pl";
require "sys/socket.ph";

$usage = "usage: canon [-a] <name|#>\n";

&Getopts("ah") || die $usage;	# make sure we have proper options
$host = shift || die $usage;	# get a hostname/number

@a = ($host =~ m/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/);	# IP number?

if (@a) {
    ($A, $junk, $junk, $junk, @addrs) = 
	gethostbyaddr(pack('C4', @a), &AF_INET);
} else {
    ($A, $junk, $junk, $junk, @addrs) = gethostbyname($host);
}

$A || &oops($?);

if ($opt_a) {
    foreach $addr (@addrs) {
	print join('.', unpack(C4, $addr)) . "\n";
    }
} else {
    print "$A\n";
}


sub oops {
   local($herr, %errm) = @_;
   require "netdb.ph";

   %errm = (
	&HOST_NOT_FOUND, "Host $host not found (authoritive)",
	&TRY_AGAIN, "Temporary failure looking up $host -- try again later",
	&NO_RECOVERY, "Non-recoverable error looking up $host",
	&NO_DATA, "$host is a valid name but no data is available"
           );

   die "$0: " . (defined($errm{$herr}) ? $errm{$herr} : 
	"Unknown error ($herr)") . ".\n";
}

-- 
Gene Spafford
Software Engineering Research Center & Dept. of Computer Sciences
Purdue University, W. Lafayette IN 47907-1398
Internet:  spaf@cs.purdue.edu	phone:  (317) 494-7825
From: avalon@coombs.anu.edu.au (Darren Reed)
Newsgroups: comp.unix.programmer
Subject: Re: allocating memory pages
Date: 12 Dec 92 16:13:36 GMT
Organization: Australian National University
NNTP-Posting-Host: 150.203.76.2

M.Gream@uts.EDU.AU (Matthew Gream) writes:


>Im writing an application for SunOS that uses a large pool of
>buffers (128-256, each 4k) initiallised at the beginning of
>execution and filled/pushed/pulled/moved around during execution,
>I was wonder whether there would be any performance increase
>on aligning each buffer to a page (and indeed they would constitute
>one page each), if so, how is it done?

Try valloc(2).
How good this is will depend on whether Sun's libc will want to
add to that for its own malloc support (tree structure).
If you dont have to worry about portability, use sbrk(2) and write
your own memory allocation/management routines.

Whether you get any performance improvement will depend on how often
buffers are going to be used, etc.  If you allocate a lot at one stage
and dont use them again for quite some time you could be lucky and
have their pages swapped out without affecting anything else.  Again,
this will depend on what Sun's libc does when it uses a valloc or malloc
call...just get Sun's source and have a look......

darren
From: gaf@alpha.aosg.gsf.dec.com (Gerald Feldman)
Newsgroups: comp.unix.programmer
Subject: Re: What happen to my new code?
Date: 11 Dec 92 20:28:22 GMT
Reply-To: gaf@aosg.gsf.dec.com
Organization: Digital Equipment Corporation

In article <1992Dec11.195023.8486@news.acns.nwu.edu>, he@monk.acns.nwu.edu (Liang He) writes:
|> Hello Everyone,
|> 
|> 	I have a directory named "bin" under my home directory.
|> In which I put several utilies I wrote, and I encluded it in
|> search path.
|> 
|> 	I found the system can not find the new utilies which
|> I put there after I logged on. I need to log out and re-login
|> in order the system find them. Does anyone know why? Is there
|> any command I can execute so the system can re-build its "internal
|> database"?
|> 
|> 	Thanks in advance
|> 
|> Liang
|> 

-- 

rehash.
+-------------------------------------------------------------+
Jerry Feldman		   AOSG
Mailstop: GSF1-1/K13	   DTN:264-5863
Digital Equipment Corp.    EXT:(603)884-5863
5 Wentworth Drive          ip(DEC): gaf@aosg.gsf.dec.com
Hudson, NH 03051           enet: alpha::gaf
			   Internet(HOME):gaf@palantir.newton.ma.us
+-------------------------------------------------------------+
Newsgroups: comp.unix.programmer
From: etxabju@eua.ericsson.se (Anders Bjurman)
Subject: Program to determine link-order?
Reply-To: etxabju@eua.ericsson.se
Organization: Ellemtel Telecom Systems Labs, Stockholm, Sweden
Date: Tue, 15 Dec 1992 08:24:06 GMT

Is there any program to determine one (or several) correct order among
librarys and/or object files when linking? i.e. a program that reads all
symbols and find the combinations that don't generate any unersolved external.

A mission for perl perhaps?

Regards - Anders Bjurman
---
             __________________________________________________________
 `"""'     _/  RF Anders Bjurman,              Memo: eri.etx.etxabju   \_
  O O   __/    Ericsson Telecom AB             Anders.Bjurman@eua.se     \
   >  _/       S-125 25 Alvsjo, Sweden         +46 8 727 49 80          _/
   o   \_______________________________________________________________/


Newsgroups: comp.unix.programmer
From: rayc@panix.com (Ray Compton)
Subject: Re: Problems when broadcasting (Yet More....)
Date: Sat, 12 Dec 1992 01:57:23 GMT
Organization: League of American Wheelmen - the LAW

In <Bz3t52.Br2@gabriel.keele.ac.uk> u0g78@keele.ac.uk (Martin Steed) writes:

>Essentially I have 3 networks, each of which has several hosts on it.

>Network 1 is a small network of Sparc IPX's and SparcStations
>Network 2 is a network of a few SparcStation 2's and a Sequent Symmetry.
>Network 3 is a large network containing many different machines.

>One of the Sparc 2's on Network 2, is also on Network 1. The Sequent on
>Network 2 is also on Network 3.

>My dameon is running on a few machines on each network.

>My client program broadcasts out onto all 3 networks, gathering responses.

>If I start my client on Network 1, or Network 2 then it successfully gets
>the replies I would expect, with a few exceptions, no host on Network 3
>replies, and the Sequent on both Networks 2 and 3 does not respond.

>If I start my client on Network 3, then it works fine and I get responses
>back from all 3 Networks.

>Investigating further, it would appear that packets going from either
>Network 1 or Network 2, get no further than the sequent.

[stuff deleted]

I think your 3 network are using different flavors of broadcast addresses.
SUN's (BSD based) use 0 broadcasting (192.a.b.0) where 'other' machines 
that aren't BSD based will use 1 broadcast (192.a.b.255).  What is a
broadcast to one net is a nulling netmask to another.

I don't know what the Sequent is running, but try to force it to use 0
or 1 as broadcast's (via ifconfig?? maybe??).

Hope it helps,
/rayc
-- 
*---------------------------------------------------------------------*
* magic    o-->    more magic  | Ray Compton       | "A waste, is a   *
*                              | <rayc@panix.com>  |  terrible thing  *
*   Don't touch that dial !!   | <rayc@command.com>|  to mind" - NRC  *
Newsgroups: comp.unix.programmer
From: leisner@wrc.xerox.com ( Marty Leisner)
Subject: trace (printing full filenames)
Reply-To: leisner@eso.mc.xerox.com
Organization: Xerox
X-Newsreader: TIN [version 1.1 PL8]
Date: Tue, 15 Dec 1992 15:44:00 GMT

When I run trace, I get truncated file names if their long 
(for example:
access ("/files1/accounts/leisner/.Xautho".., 04) = 0

How do I get the full file names?

I'm running sunos 4.1.x on sparcs...


--
marty
leisner.henr801c@xerox.com  leisner@eso.mc.xerox.com
Member of the League for Programming Freedom
From: rrg@rtp.fibercom.com (Rhonda Gaines)
Newsgroups: comp.unix.programmer
Subject: VT220 mode needed on Sun
Date: 15 Dec 92 15:46:48 GMT
Organization: FiberCom, Inc., Roanoke, Virginia


I need to be able to log into our VAX 4000 (VMS) from my Sun ELC and use edt in
vt220 mode.  Currently, even though I set my terminal type to vt220,
using edt still puts me in some sort of line editor.  Any ideas?

 -thanks
  rhonda
-- 
Rhonda Gaines              INTERNET: gaines@fibercom.com
FiberCom, Inc.             UUCP: ...!uunet!fibercom!gaines   
P.O. Box 11966             PHONE: 703-342-6700 or 800-423-1183 x291
Roanoke, VA  24022-1966    FAX:   703-342-5961
From: rdorich@jade.tufts.edu (Rob)
Newsgroups: comp.unix.programmer
Subject: _herror, _strerror
Date: 14 Dec 92 00:19:40 GMT
Organization: Tufts University - Medford, MA

Dear netters,

	I am trying to link a bunch of files, but I get the following
undefined symbols...

ld: Undefined symbol 
   _herror 
   _strerror 

Can anyone help me out on this one?  I'll very much appreciate it!

Thanks,

	Roberto

PS:  The libraries I'm using already are:
       -ltermcap -lcurses -ltermlib

  
-- 


-------------------------------------------------------------------------------
Roberto Dorich		 |           /~~  \ /  ~~/~~ /~~/  /~~  /|  /    /~~
From: barmar@think.com (Barry Margolin)
Newsgroups: comp.unix.programmer
Subject: Re: Need Information On rexec()
Date: 11 Dec 1992 20:28:22 GMT
Organization: Thinking Machines Corporation, Cambridge MA, USA
NNTP-Posting-Host: telecaster.think.com

In article <1g65dhINNjqc@smurf.sti.com> westes@smurf.sti.com (Will Estes) writes:
>-	Why does rexec() fail to invoke .login?

Because it's just running a single command line, not starting up a full,
interactive login session.

>-	Is it common practice to just leave your environment variables
>	in .cshrc?

Yes.  What you can do is write:

if ( ! $? ENV_SET ) then
    setenv ...
    setenv ...
    ...
    setenv ENV_SET
endif

This way you won't re-execute all the environment variable settings for all
sub-shells.
-- 
Barry Margolin
System Manager, Thinking Machines Corp.

barmar@think.com          {uunet,harvard}!think!barmar
From: jgs@funsys.se (Jan Gifvars)
Newsgroups: comp.unix.programmer
Subject: RCS
Date: 14 Dec 92 11:35:48 GMT
Reply-To: jgs@funsys.se
Organization: Enator Functional Systems AB.

What's the difference between RCS and SCCS ?
If any....

Jan Gifvars
jgs@funsys.se
From: belo@opal.cs.tu-berlin.de (Bela M. Voigt)
Newsgroups: comp.unix.programmer
Subject: MultiPhone
Date: 16 Dec 1992 12:56:56 GMT
Organization: ZRZ/TU-Berlin
NNTP-Posting-Host: centaur.cs.tu-berlin.de
MIME-Version: 1.0
Content-Type: text/plain
Content-Transfer-Encoding: 8bit

Hi!
I'm just looking around in our system and there I find the sources for
phone.
Our phone has just one possibility
"phone user1@host1". After that you have to invite every user, like:
Pushing <Esc>, typing phone user2@host2
Pushing <Esc>, typing phone user3@host3
...

What I'd like would be:
phone user1@host1 user2@host2 user3@host3 ...

Do you think there's something like that...?

THANX in advance.

Bela.
-----
Bela Voigt [belo@cs.tu-berlin.de]
Owner of the Berlin Maniacs
Newsgroups: comp.unix.programmer,comp.sources.wanted
From: dwight@hyphen.com (Dwight Ernest)
Subject: Re: Get hostname from IP address
Organization: Hyphen, Inc., Wilmington, MA 01887 USA / +1 508 988-0880
Date: Sun, 13 Dec 1992 12:28:35 GMT

bosman@fwi.uva.nl (Cor Bosman) writes:

>dejesus@archimedes.nwc.navy.mil (Francisco X DeJesus) writes:

>>I'd like to find a utility I can call from the command-line with an
>>internet IP address as an argument, and have it return to me the full
>>hostname related to it. I've looked into the function gethostbyaddr()
>>but haven't been able to work. I also remember reading about a name-
>>resolver funtion nres_gethostbyaddr() (sp?), but can't find any
>>references to it on my system. I'm running SunOS 4.1.2 on a Sparc.

>>Will post a summary if there's interest. Thanks in advance...

>Hmm..a command-line program huh...why cant you use:

>NSLOOKUP(8C)          MAINTENANCE COMMANDS           NSLOOKUP(8C)

>NAME
>     nslookup - query domain name servers interactively

Because it's not general enough.  It assumes that BIND is available.
The best thing would be a wrapper around the gethostbyaddr() call.

Like this, perhaps:


/*
 *	gethostbyaddr
 *
 *	For shell scripts and the like.
 *
 *	Given a network IP address, returns the hostname, if it can.
 *
 */

#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <netinet/in.h>

void
main (argc, argv)
	int argc;
	char *argv[];
{
	struct hostent *he;
	struct in_addr addr;
	char *prog;
	extern char *basename();

	prog = basename (argv[0]);

	if (argc != 2)
	{
		fprintf (stderr, "usage: %s address\nreturns main hostname\n", prog);
		exit (1);
	}

	addr.s_addr = inet_addr (argv[1]);

	if ((he = gethostbyaddr (&addr, 4, AF_INET)) <0)
	{
		fprintf (stderr, "gethostbyaddr() failed\n");
		exit (1);
	}

	printf ("%s\n", he->h_name);
	exit (0);
}

(basename() is simple and relatively obvious, but let me know if you need it.)

-- 
--Dwight A. Ernest   R&D Manager (USA)     I speak only for myself.
  Hyphen, Inc./181 Ballardvale St./Wilmington, MA 01887/+1 508 988 0880 x125
  dwight@hyphen.com
From: eperez@hpprdeb.prd.hp.com (Edgar Perez)
Date: Thu, 17 Dec 1992 20:04:57 GMT
Subject: Re: W. Richard Stevens' (new?) UNIX programming book.
Organization: HP Puerto Rico Manufacturing Operation
Newsgroups: comp.unix.programmer

In comp.unix.programmer,  panvalka@opsin.cs.unc.edu (Anay Panvalkar) ask:

>Some time back, someone had posted about a new book on Advanced Unix 
>Progarmming by W. Richard Stevens. 

Book: Advanced Programming in the Unix Environment
W. Richard Stevens
ISBN: 0-201-56317-7
~$50.00
Excellent Book!

Newsgroups: comp.unix.programmer
From: Steinar.Haug@delab.sintef.no (Steinar Haug)
Subject: Re: SPARC assembly (under SunOS) trade books avail?
Organization: SINTEF DELAB, Trondheim, Norway.
Date: Mon, 14 Dec 1992 09:33:59 GMT

n8743196@henson.cc.wwu.edu (Jeff Wandling) writes:
>   I'm trying to find a text-book or something that  will explain
> how to program in SPARC assembly.  Something like the Ford & Topp
> book on MC68000 assembly would be great.   I'm looking for a 
> real text-book/PS document/etc.. on SPARC assembly with lots of 
> code, not a watered down hand-waving text (as in AnswerBook's 
> Sun4 Assembly Manual).

You definitely want to get the following:

	The SPARC Architecture Manual, Version 8
	Copyright SPARC International 1992
	Published by: Prentice Hall
	ISBN 0-13-825001-4

Steinar Haug, system/networks administrator
SINTEF DELAB, University of Trondheim, NORWAY
Email: Steinar.Haug@delab.sintef.no, 
	sthaug@idt.unit.no, steinar@tosca.er.sintef.no
From: vivek@bsu-cs.bsu.edu (Vivek Sawant | IND)
Newsgroups: comp.unix.programmer
Subject: Re: 1993 IEEE CS National Programming Contest Addendum 2
Date: 15 Dec 92 23:27:23 GMT
Organization: Dept. of CS Ball State University Muncie IN


  I have missed the original announcement and 
  addendum 1. Can someone email it to me please?

  Thanks.

  _viv

--------------------------------------------------------------------------
                           VIVEK SAWANT                   
Department of Computer Science.           Inet : vivek@bsu-cs.bsu.edu 
Ball State University, Muncie, IN 47306.  Bitnet : 00VMSAWANT@BSUVAX1.BITNET
--------------------------------------------------------------------------

Newsgroups: comp.unix.programmer
From: dsiebert@icaen.uiowa.edu (Doug Siebert)
Subject: Wanted:  An asynchronous gethostbyaddr()
Organization: Iowa Computer Aided Engineering Network, University of Iowa
Date: Thu, 17 Dec 1992 20:44:51 GMT


As the subject line says, I'd like an asychronous gethostbyaddr().  I've got
a program that receives a number of TCP socket connects, and currently I can't
use gethostbyaddr() in that program because it blocks (sometimes for quite a
while on sites in other continents)  I don't know much about the resolver(3)
calls, but they appear as though they block until a response is received just
like gethostbyaddr().

Does anyone have code that will do this?  All I want is a name to an address,
or to know there is no name for that address that can be found.  I need to
have a socket (either UDP or TCP, doesn't matter to me) in my program so that
I know when this information arrives and I can get the hostname information I
need out of it.  I do know that nameserver calls associate an ID of sorts with
each calls, so I can keep track of that and receive my information out of
order.

As a last resort, I could get some libc source and roll my own, but surely
*someone* *somewhere* has invented this particular wheel before?  (I hope!)
Thanks for any code/help/examples/leads anyone can provide.

-- 
/-----------------------------------------------------------------------------\
| Doug Siebert                             | "I don't have to take this abuse |
| Internet:  dsiebert@isca.uiowa.edu       |  from you - I've got hundreds of |
| NeXTMail:  dsiebert@chop.isca.uiowa.edu  |  people waiting in line to abuse |
|     ICBM:  41d 39m 55s N, 91d 30m 43s W  |  me!"  Bill Murray, Ghostbusters |
\-----------------------------------------------------------------------------/
Newsgroups: comp.unix.programmer,comp.sources.wanted