HDTenEightyP/NetNews huggingface dataset:
From: lobsang@unixland.natick.ma.us (Michael Levin)
Subject: getdomainname() returns 0 and "noname"!
Organization: Unixland Public Access Unix & Think_Tank BBS
Distribution: usa
Date: Mon, 17 Aug 1992 20:05:53 GMT


     On a certain Sun workstation, doing a getdomainname() call
returns 0, and sets the name argument to be "noname". Now, suppose
this machine is called "X". Doing "finger X.noname" gives a "unknown
host" error, while "finger X" is ok. So, what is the proper way to use
getdomainname() to obtain the proper full host name? Since the return
status is 0 (and not -1), should I simply test the result for the
string "noname" and not use it if it matches? Or is something set up
incorrectly on this workstation?

Mike Levin
-- 
Maine Network Backup
From: crash@ckctpa.UUCP (Frank "Crash" Edwards)
Subject: Re: docs for SVR4 form(3x), menu(3x), and panel(3x)
Date: Thu, 20 Aug 1992 01:29:50 GMT
Reply-To: crash%ckctpa@tct.com (Frank "Crash" Edwards)
Organization: Edwards & Edwards Consulting

jpb@unislc.uucp (John Bonn) writes:
>The Prentice Hall book:
>UNIX System V Release 4 Programmes's Guide: Character Users
>Interface (FNLI and ETI)
>ISBN:0-13-947045-X

Yes, this is the book that has been recommended by several people
(thanks to all of you -- you know who you are).

However, a call to Prentice Hall uncovers an interesting point:  the
book is out-of-print; the SVR4 version will not be available until
September (any bets on _when_ in September? :-) and since the old one
is out-of-print it is not available from the 3 or 4 distributors I've
called.

To top it all off, the new version is Suggested List of $40.00 -- the
old one was $44.00!

>It can also be order from Prentice Hall @ (201)767-5937
>
>JP

Yep, that's the number.  Although the commercial order number will
give you ISBN and availability information, and it's toll-free!
800/922-0567 (but that's from memory, so you better call
800/555-1212 for information).
-- 
Frank "Crash" Edwards            King Marine Electronics, Inc.
Home: 813/786-3675               Work: 813/530-3411
Newsgroups: comp.unix.programmer
From: pim@cti-software.nl (Pim Zandbergen)
Subject: How to associate curses with /dev/tty
Organization: CTI Software BV, The Hague, The Netherlands
Date: Fri, 21 Aug 92 08:17:11 GMT

I want to be able to do something like
	command1 | curses_program | command2

This would require curses to associate stdwin with
/dev/tty rather than stdin and stdout.

How do I do this ?

Thanks.
-- 
Pim Zandbergen                      domain : pim@cti-software.nl
CTI Software BV                     uucp   : uunet!mcsun!sun4nl!ctisbv!pim
Laan Copes van Cattenburch 70       phone  : +31 70 3542302
2585 GD The Hague, The Netherlands  fax    : +31 70 3512837
Xref: sparky comp.unix.programmer:4369 comp.unix.misc:3283
From: shj@login.dkuug.dk (Stig Jacobsen)
Newsgroups: comp.unix.programmer,comp.unix.misc
Subject: Re: Process & Signal Question
Date: 19 Aug 92 16:06:16 GMT
Followup-To: comp.unix.programmer
Organization: Asis Electronic Intl., Copenhagen, Denmark

obi@gumby.ocs.com (Kuryan "Obi" Thomas) writes:

>A vague memory tells me that on System V machines, demand-paged
>executables which are in use (being executed) can't be overwritten. 
..
>I believe the errno you get if you try to
>open such an executable image for writing is ETXTBSY (Text File busy).

True. Well, mostly. This may be a bug in the NFS implementation
we're using, but if the binary is opened via NFS, you can unlink
the file locally on the machine where the file resides. Odd.

ETXTBSY is the reason why a lot of Makefiles looks like,

target: $(OBJS)
        -mv target Otarget
	ld ...

   
Very good for consuming diskspace quickly..
--
Stig Jacobsen
shj@login.dkuug.dk
From: pjh@mccc.edu (Pete Holsberg)
Newsgroups: comp.unix.programmer
Subject: Re: Newuser program for a University
Date: 19 Aug 92 00:45:37 GMT
Organization: The College On The Other Side Of Route One

In article <1992Aug17.174805.1274@uwm.edu> bruno@cerberus.csd.uwm.edu writes:
=From article <1992Aug17.174112.124@uwm.edu>, by murthy@ee.uwm.edu (Murthy Nyayapati):
=> I have been assigned 
=> to write a "newuser" program for these machines.  All the necessary security
=> checks should be done.  A "valid" student should be able to sit at a terminal
=> and "give" himself/herself an account.  We get a tape of all the list to students
=> who are registered.
=
=Well if you would check with the people next door, you would find that CSD
=has been running a newuser program for several years.
=Give Dave Rasmussen a call at x5133.

Perhaps one of you would share Dave Rasmussen's "newuser" program with
the rest of us???
From: jmw1@ra.msstate.edu (John Westerburg)
Newsgroups: comp.unix.programmer
Subject: detecting death of specific child
Date: 13 Aug 92 01:30:05 GMT
Organization: Mississippi State University


   Can anyone tell me how to detect the death of a PARTICULAR child?
I'm writing my own shell.  I can send processes off into the background
fine.  I've got a bg and a fg command that both work ok.  But I need to know
when a background process is done so I can remove it's entry from a list.
  I hope I've articulated my problem well enough....so if anyone can help
I would appreciate it.
Newsgroups: comp.unix.programmer
Subject: SIGNALS
From: kwang@zeus.calpoly.edu (Kevin Wang aka The Scarecrow)
Date: Wed, 19 Aug 1992 00:14:55 GMT
Organization: The Outland Riders

How does one handle multiple signals that happen (almost)
simultaneously?  Currently, the parent process forks off multiple
times, and each of the children then dies after it's done.  Now, if all
3-5 children finish almost immediately, the signal handler doesn't
finish before the next signal comes in.  At the very minimum, I need to
wait() for the child process so that I can get its exit value.
Currently the handler looks like:

void ChildHandler(void)
{
	Handle_the_signal();
	signal(SIGCHLD, SIG_IGN);  /* the only way I know to 'clear' the signal */
	signal(SIGCHLD, ChildHandler);
	return;
}

help?  inside Handle_the_signal() it has a bit of searching to do, so it's
taking longer than I'd like it to, but I can't find any other way around it.

   - Kevin Wang
...And now, for your local station identification, on the hour, every hour...
kwang@hermes.calpoly.edu or kwang@gauss.elee.calpoly.edu
---
                          MURPHY'S LAWS OF COMBAT
   4. There is always a way.
From: markp@adsi.homecare.com (Mark Parr)
Newsgroups: comp.unix.programmer
Subject: Re: real-time character input
Date: 19 Aug 92 13:46:20 GMT
Organization: Application Data Systems, Inc.

In article <1992Aug13.112134.1@hamp.hampshire.edu> jmolinari@hamp.hampshire.edu writes:
>	I'm writing a C program that requires real-time character input (i.e.,
>character-by-character, as opposed to line-by-line).  Let's say, for the sake
>of argument, that I want to be able to move a cursor on the screen using the
>cursor keys.  How can I do this?  I'm already familiar with vt100 escape codes,
>so you can skip that part.  Parting from that, I asked around and I got a
>rather vague answer:  "That is system specific."  How true is this?  If you
>decide to take the task of explaining this to me, please pretend I know
>nothing, which isn't too far from the truth... :-)
>
>                     jmolinari@hamp.hampshire.edu


Have you looked into using Curses?  It'll let you accept input character by 
character.  Is not device dependent -- assumming you have a Terminfo file
for the terminal that you are using (which is also required by 'vi' anyway).

Give it a try......

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 | |-------------|  Application Data Systems     |  Phone: (601) 393-2046  | |
 | |  Mark Parr  |  1930-B 1st Commercial Dr. N  |    Fax: (601) 393-6605  | |
 | |-------------|  Southaven, MS 38671          | markp@adsi.homecare.com | |
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Xref: sparky comp.unix.programmer:4301 comp.unix.internals:1691 comp.sys.hp:9299
From: jim@cs.strath.ac.uk (Jim Reid)
Newsgroups: comp.unix.programmer,comp.unix.internals,comp.sys.hp
Subject: Re: inode to filename
Date: 14 Aug 92 11:29:54 GMT
	<1992Aug11.164753.13726@ssd.ukpoit.co.uk>
	<1992Aug12.144032.6417@bwdls61.bnr.ca>
	<1992Aug12.181707.23506@gateway.novell.com>
	<1992Aug13.135735.6607@bwdls61.bnr.ca>
Organization: Computer Science Dept., Strathclyde Univ., Glasgow, Scotland.
In-reply-to: mleech@bnr.ca's message of 13 Aug 92 13:57:35 GMT

In article <1992Aug13.135735.6607@bwdls61.bnr.ca> mleech@bnr.ca (Marcus Leech) writes:

   Granted there isn't always a 1 to 1 relationship between a files internal
     "handle", and its name.  In the real world, programs refer to files by
     name, and in the real world, system managers frequently need this
     information either to debug some system process, or because they want to
     take a disk offline, and they need to know which processes have *which*
     files open on the disk.  You can avoid having to do the reverse mapping
     simply by storing the name information in such a way as to be generally
     useful, and not cost very much.

Hmmm. On some machine there could be thousands of active files. Having
the kernel maintain a list of those filenames might cost more than you
think. [If it's a choice between assigning 100K of kernel memory to
I/O buffers or process page tables or a list of active filenames, I
wouldn't choose the list of filenames.]

What would such a scheme do in the case of a process which unlinks an
open file?

		Jim
Xref: sparky comp.unix.programmer:4289 comp.unix.misc:3224
From: herberj@prism.CS.ORST.EDU (John Wesley Herberg)
Newsgroups: comp.unix.programmer,comp.unix.misc
Subject: Process & Signal Question
Date: 14 Aug 92 01:34:50 GMT
Article-I.D.: CS.1992Aug14.013450.9864
Organization: Oregon State University, Computer Science Dept.


1 - Is there an effecient way for one process to know if another is running 
when the only thing you know about it is its name.  The way I'm doing it now
is grabbing info for all the processes by using pstat(an HP-UX call) &
searching through that info for a matching process name.  Is there some type 
of call I could do on the executable to see if it is in use.  I noticed
make doesn't allow you to update a file when its being used - how does it know?

2 - In Marc Rochkind's "Advanced Unix Programming", he says it's not a good
idea to use the SIGUSR1/2 signals for user defined signals.  Why?  All I want 
to do is notify another process of an event & I don't want the overhead of a
msg, shared mem, etc.  Seems to me this would be the most effecient way.  Is
there something else I should know about using signals?

BTW, I am working on HP-UX.

Any help much appreciated,
-- 
-----------------------------------------------------------------------
John W. Herberg	     		      Internet: herberj@prism.cs.orst.edu
From: wayne@jahangir.UUCP (wayne)
Newsgroups: comp.unix.programmer
Subject: Socket breaking in mid transmission.
Keywords: TCP/IP sockets
Date: 12 Aug 92 16:47:20 GMT
Organization: MDC, NYC


     I have a sun sparc/2 communicating wi mac's via
tcp/ip. I am using blocking reading and writing.


    The problem being... The mac tends to crash in the 
middle of a transmission. When this happens the sun 
takes a *long* time to recognize that the connection is 
broken. I suspect it's the mac's fault. Not closing it's
device drivers when it goes south. 


     Does anybody know a solution to this without resorting 
to non-blocking I/O?  Maybe I could play some games with signals?



     - Wayne  wayne@mktdata.com
From: bsullivn@sc.sni.ie (Bryan O'Sullivan)
Newsgroups: comp.unix.programmer
Subject: Re: A Programming Problem!
Date: 13 Aug 92 12:58:16 GMT
Article-I.D.: sc.156
Reply-To: bryan@sc.sni.ie
Organization: Siemens-Nixdorf Software Development Centre, Dublin
X-Newsreader: Tin 1.1 PL3



rohl@vax.oxford.ac.uk writes:
: I am writing a program in C under UNIX and need to find out the name of
: the directory from which a program was run.  This is because the program
: needs to open a text file in its directory which contains help.  I
: don't think that I can find this in ANSI C and I'm not very familiar
: with UNIX systems calls.

As has been discussed elsewhere of late, this is not possible.  It is
quite likely that any methods you try will give an incorrect answer.

	-- Bryan

-- 
Bryan O'Sullivan                                             +353-1-767551 x225
Siemens-Nixdorf Informationssysteme AG                          bryan@sc.sni.ie
Software Development Centre                    "Theory like mist on eyeglasses.
Dublin                                          Obscure facts." -- Charlie Chan
Newsgroups: comp.unix.programmer,comp.lang.c,comp.arch
From: gsh7w@fermi.clas.Virginia.EDU (Greg Hennessy)
Subject: Re: What would you like in a debugger?
Organization: University of Virginia
Date: Sat, 22 Aug 1992 20:57:49 GMT

In article <158@sc.sni.ie> bryan@sc.sni.ie writes:
#In my mind, running out of CPU quota when tracing a variable within dbx
#does not constitute efficiency. 

In my mind, CPU quotas do not constitute efficiency.

--
-Greg Hennessy, University of Virginia
 USPS Mail:     Astronomy Department, Charlottesville, VA 22903-2475 USA
 Internet:      gsh7w@virginia.edu  
 UUCP:		...!uunet!virginia!gsh7w
Newsgroups: comp.unix.programmer
From: bruno@cerberus.csd.uwm.edu (Bruno Wolff III)
Subject: Re: Newuser program for a University
Originator: bruno@cerberus.csd.uwm.edu
Reply-To: bruno@cerberus.csd.uwm.edu
Organization: University of Wisconsin - Milwaukee
Date: Mon, 17 Aug 1992 17:48:05 GMT

From article <1992Aug17.174112.124@uwm.edu>, by murthy@ee.uwm.edu (Murthy Nyayapati):
> Hi!
> 
> I am currently managing two machines which run Unix (HP-UX and DEC/Ultrix).
> 
> Being a university,  we have to constantly add accounts and before giving
> the 
> accounts we should be able to check for their validity.  I have been assigned 
> to write a "newuser" program for these machines.  All the necessary security
> checks should be done.  A "valid" student should be able to sit at a terminal
> and "give" himself/herself an account.  We get a tape of all the list to students
> who are registered.
> 
> Before I start working on this, I just wanted to find out if there is any
> free/shareware software available.  Basically, I am looking for this program
> from any university/institution where it is currently being used.  I can
> "tailor-fit" the program to suit our needs.
> 
> Any input from anyone in this regrad is appreciated.
> 
> Thanks a lot in anticipation.
> 
> Murthy Nyayapati
> Systems Administrator
> University of Wisconsin-Milwaukee
> murthy@ee.uwm.edu

Well if you would check with the people next door, you would find that CSD
has been running a newuser program for several years.
Give Dave Rasmussen a call at x5133.
Newsgroups: comp.unix.programmer
From: beowulf@titan.ucc.umass.edu (Peter Munson)
Subject: Re: How can a program know where it was invoked?
Organization: University of Massachusetts, Amherst
Date: Thu, 13 Aug 1992 18:25:09 GMT

In article <bmckeon.713727455@unix1.tcd.ie> bmckeon@unix1.tcd.ie (Brendan McKeon) writes:
>In <1992Aug9.025101.8559@ccsun7.csie.nctu.edu.tw> cp78085@csie.nctu.edu.tw (Tan Koan-Sin) writes:
>
>>Hello,
>>	I would like to know how does a program knows where it was invoked?
>>	For example, 
>
>>		foo file1
>
>>	can foo detect where its binary execution file is?
>
>>	Thanks.
>
>>--
>>Chin-Peng Choo
>
>Hi,
>
>One way which works for me is to combine argv[0] ( the name of the file )
>and the current working directory. A special case is made if argv[0] starts
>with a '/'.
>

  Tacking the name of the executable onto the directory from which it
was _invoked_ will give you garbage unless you happen to be sitting in
the same directory as the executable.
  The correct answer is 'no'.
P.

-- 
Peter Munson                University Computing Services
Systems Programmer          University of Massachusetts
beowulf@titan.ucc.umass.edu 
--All opinions expressed are neither mine nor my employer's--
Newsgroups: comp.unix.programmer,comp.unix.internals
From: websterm@uproar.enet.dec.com (Mike Webster)
Subject: STREAMS module to catch CTS up down.
Reply-To: Mike.Webster@ime.mts.dec.com
Organization: Digital Equipment Corporation
Date: Fri, 14 Aug 1992 09:42:02 GMT



 Here's a straight forward query ;-)

 Using Interactive SVR4 on a 386. I would like my software to
 respond to a CTS toggle on an asynchronous RS232 port. i.e. 
 when the remote device raises and lowers CTS I send a message.

 Can a push able STREAMS module do this and how ?
 ( the response has to be fast ).

 Any ideas/help grately appreciated.

 Mike Webster London UK.
Newsgroups: comp.unix.programmer,comp.lang.c,comp.arch,comp.programming
From: bosullvn@unix1.tcd.ie (Bryan O'Sullivan)
Subject: Re: What would you like in a debugger?
Keywords: debugging
Organization: Department of Computer Science, Trinity College, Dublin, Ireland
Date: Sat, 15 Aug 1992 14:21:05 GMT

In <1188@gsg.UUCP> lew@gsg.UUCP (Paul Lew) writes:

>The most annoying problem of debuggers is everyone is different.  What we
>need is a standard interface or 'common debugger protocol (CDP)' if you
>will be defined and adopted by all the upperlayer debuggers.  If this
>becomes a reality, then I can stay in my favorite codecenter and cross
>debug a PC program with runaway pointers.  The PC debugging may finally
>become interesting...  (I choose codeview and codecenter without any
>specific purpose but illustrating an idea)

There are several more important problems that need to be solved
first.  I'll be happy to define some way for debuggers to talk to
each other across machines once I find one or two that do what I
want on a single machine.  To be absolutely frank, the current
state of debugging "technology" is little short of abysmal.  I
don't use any debugger at the present time on UNIX systems because
I haven't found a single good one.  I don't care whether the debugger
displays linked lists nicely in an X environment.  This (without
fail) means that the programmers have concentrated on the GUI to
the detriment of the basic functionality of the debugger.

Seeing as nobody else has written a debugger that I'm happy with,
I'm designing one myself.  To be frank, I was somewhat disappointed
with many of the responses to my original question; people seem to
be more worried about the number of widgets they can twiddle than
whether their debuggers help them trace problems efficiently.

	-- Bryan

--
Bryan O'Sullivan                                                 +353-1-767551
Advanced Development Group                               bosullvn@unix1.tcd.ie
Department of Computer Science            "No matter how cynical you are, it's
University of Dublin                       hard to keep up." -- Woody Allen
From: barmar@think.com (Barry Margolin)
Newsgroups: comp.unix.programmer
Subject: Re: getdomainname() returns 0 and "noname"!
Date: 18 Aug 1992 04:56:18 GMT
Organization: Thinking Machines Corporation, Cambridge MA, USA
Distribution: usa
NNTP-Posting-Host: gandalf.think.com

In article <1992Aug17.200553.24243@unixland.natick.ma.us> lobsang@unixland.natick.ma.us (Michael Levin) writes:
>     On a certain Sun workstation, doing a getdomainname() call
>returns 0, and sets the name argument to be "noname". 

This probably means that the workstation isn't using NIS.

>						       Now, suppose
>this machine is called "X". Doing "finger X.noname" gives a "unknown
>host" error, while "finger X" is ok. 

getdomainname() is for getting the NIS domain, not the DNS domain.  There's
no reason to concatenate the hostname and the NIS domain.
-- 
Barry Margolin
System Manager, Thinking Machines Corp.

barmar@think.com          {uunet,harvard}!think!barmar
From: jeff@cbis.ece.drexel.edu (Jeff White)
Newsgroups: comp.unix.programmer
Subject: Looking for socket multiplexing examples
Date: 19 Aug 92 17:49:35 GMT
Organization: Drexel University, ECE Department, Philadelphia, PA

(Posted for a colleague):

   I am trying to write a server program which establishes multiple 
connections, and services requests sent over various sockets by doing a
select.  I need examples (or one comprehensive example) of socket
multiplexing using select in the internet domain.
  Please reply via email, as I'm not a regular reader.  Thanks.

						Jeff White
						jeff@cbis.ece.drexel.edu
From: abmg@cathedral.cerc.wvu.wvnet.edu (Aliasghar Babadi)
Newsgroups: comp.unix.programmer
Subject: Kill program
Keywords: kill
Date: 19 Aug 92 20:53:39 GMT

Hi,
	Is there a C function to kill a program by giving the name of
the program. For example 

	int kill( char * prog_name)

I'll appreciate any help. Thanks.
Newsgroups: comp.unix.programmer,comp.unix.misc
From: Ross Ridge <ross@zooid.guild.org>
Subject: Re: Process & Signal Question
Organization: ZOOiD BBS
Date: Sun, 16 Aug 1992 22:30:01 GMT

herberj@prism.CS.ORST.EDU (John Wesley Herberg) writes:
>1 - Is there an effecient way for one process to know if another is running 
>when the only thing you know about it is its name.  The way I'm doing it now
>is grabbing info for all the processes by using pstat(an HP-UX call) &
>searching through that info for a matching process name.  Is there some type 
>of call I could do on the executable to see if it is in use.  I noticed
>make doesn't allow you to update a file when its being used - how does it know?
 
bill@bailey.UUCP (Bill Glidden 882-8369) writes:
>Make knows the executable is in use because when you fopen or open a file for
>create and it is in use, the operating system returns an error condition to
>the calling program. Of course, I don't recommend this for your situation.

If you have write permission for the executable this should work:

	int fd;

	fd = open("foo", O_WRONLY);
	if (fd == -1) 
		if (errno == ETXTBSY) 
			printf("foo is running.\n");
		else 
			perror("foo");
	else {
		close(fd);
		printf("foo isn't running.\n");
	}


>>2 - In Marc Rochkind's "Advanced Unix Programming", he says it's not a good
>>idea to use the SIGUSR1/2 signals for user defined signals.  Why?  All I want 
>>to do is notify another process of an event & I don't want the overhead of a
>>msg, shared mem, etc.  Seems to me this would be the most effecient way.  Is
>>there something else I should know about using signals?

>As an event trigger, though, I think that a signal works just fine if you
>are willing to code the overhead of catching and resetting it.  Also, how
>often will you be signalling the other process?  If it is more than once,
>remember to reset the signal catching function for SIGUSR1 immediately upon
>entering the signal catching function.

It's possible to receive a second signal after you signal catching
function starts but before function has a chance to reset the signal
thus killing the process.  You should use functions like sigset or
their BSD equivilent to avoid this.  Also note it's possible to lose
signals if one arrives while another (of the same type) is pending.

							Ross Ridge

-- 
Ross Ridge - The Great HTMU					     l/	 //
								    [OO][oo]
ross@zooid.guild.org						    /()\/()/
uunet.ca!zooid!ross						     db	 //
From: buzz@fsrg.bear.com (Buzz Moschetti)
Newsgroups: comp.unix.programmer
Subject: Re: Sudo
Date: 21 Aug 92 01:49:47 GMT
Reply-To: buzz@fsrg.bear.com
Distribution: usa
Organization: Bear, Stearns & Co. Inc.
In-reply-to: samari@watnxt2.ucr.edu's message of 20 Aug 92 19:53:27 GMT

Curiously enough, sudo just came up in alt.security.  Here's some more info:

Subject: Re: sudo & op?
To: buzz@fsrg.bear.com
Date: Thu, 20 Aug 92 7:38:15 PDT
X-Mailer: ELM [version 2.3 PL11]
Status: OR

Both are PD packages, sudo is from the Unix System Administration Handbook
by Nemeth Snyder and Seebass, and op is from Tom Christianson at Convex.
We use sudo mostly because it is simpler (op supports full regular expressions).

sudo is availible by anon ftp from:

Host boulder.colorado.edu

    Location: /pub/sa-book
      DIRECTORY drwxr-xr-x        512  Aug  5 15:19  sudo

And op is likely availible from convex.com somewhere (a quick archie search
found mostly perl test references! I have an old copy of op if you can't find
it elsewheres.) 

Peter Van Epp / Operations and Technical Support 
Simon Fraser University, Burnaby, B.C. Canada