HDTenEightyP/NetNews huggingface dataset:
From: ksc@cbnewsk.cb.att.com (kenneth.s.cobler)
Subject: Re: How to restart a process after the machine is up.
Organization: AT&T
Distribution: na
Date: Mon, 17 Aug 1992 19:59:17 GMT

In article <Bt3yF9.JFI@usenet.ucs.indiana.edu> jhu@bronze.ucs.indiana.edu (Jun Hu) writes:
>Hi, Could someone help me with following question?
>
 [ deleted ]

>the machine will be down once every month, I would like to have my 
>process terminated some way (save the core image of the process? ) 
>before the machine is down and restarted manually from the point it 
>stops after the machine is up, so the previous computing time is 
>not wasted.
>

A way to handle such a situation is to have your program write out
all important data structures and values to a file then terminate
itself upon receiving a signal (like SIGUSR1).  This allows your
shutdown script to send a kill -16 to the PID of your program and
it can gracefully exit with the current values of the various datum.
During boot, your program can check for the file and quickly load
all the values saved in the file.

Kenneth Cobler		ksc@cbnewsk.att.com or ken@ihlpm.att.com
AT&T Bell Laboratories	attmail!cbnewsk!ksc or attmail!ihlpm!ken
2000 N. Naperville Rd.
Naperville, IL  60566
From: rohl@vax.oxford.ac.uk
Newsgroups: comp.unix.programmer
Subject: A Programming Problem!
Date: 12 Aug 92 11:31:52 GMT
Organization: Oxford University VAX 6620

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.
  Thanks for any help
     Andrew Rohl
Newsgroups: comp.unix.programmer,comp.lang.c,comp.arch,comp.programming
From: Ross Ridge <ross@zooid.guild.org>
Subject: Re: What would you like in a debugger?
Organization: ZOOiD BBS
Date: Sun, 16 Aug 1992 16:50:55 GMT
Keywords: debugging

bosullvn@unix1.tcd.ie (Bryan O'Sullivan) writes:
>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.

Perhaps people are already using their debuggers to trace problems
efficiently.  Nah... since you can't do that, how could any one else?

							Ross Ridge

-- 
Ross Ridge - The Great HTMU					     l/	 //
								    [OO][oo]
ross@zooid.guild.org						    /()\/()/
uunet.ca!zooid!ross						     db	 //
Xref: sparky comp.unix.programmer:4308 comp.unix.internals:1692
From: osycs@giac1.oscs.montana.edu (Craig Spannring)
Newsgroups: comp.unix.programmer
Subject: Re: Real Time timing problem
Keywords: real timen
Date: 14 Aug 92 23:55:07 GMT
Organization: Geographic Information & Analysis Center Montana State University

In article <1042@ncratl.AtlantaGA.NCR.COM> mwilson@ncratl.AtlantaGA.NCR.COM (Mark Wilson) writes:
>I am looking for help in solving a perfomance problem with UNIX V.4.

Here is some code that should help solve your problem

>----- cut here ------<

main()
{
	for(;;) 
	{
		printf("Unix SVR4 is not a real time operating system!\n\007");
	}
}

>----- cut here ------<

Carefully watch the output from this program until you have found a solution.

-- 
====================================================================
 Six of one, 110 (base 2) of       | Craig Spannring
 another.                          | osycs@giac1.oscs.montana.edu
 ----------------------------------+--------------------------------
Newsgroups: comp.unix.programmer
From: gram@aim1.aztec.co.za (Graham Wheeler)
Subject: termio confusion
Organization: Aztec Information Management
Date: Wed, 12 Aug 1992 09:23:01 GMT

Hi all

I just need someone to confirm (or refute) my understanding of just what
constitutes input and output in termio. I need this as I want to implement 
termio ioctls in a Triple-X PAD device driver.

Here is how I understand it:

                            Normal Serial
                            Device Driver
			--------------------
			|                  |
		<-------|--- INPUT --------|-------- Standard Input
        Program         |                  |
                --------|--- OUTPUT -------|-------> Standard Output
                        |                  |
                        --------------------

Now, when it comes to the PAD (let's say we have a cu connection),
I think it is like this:

                              _____________
                   /----\    /             \
Standard Input --->|    |--->|-- OUTPUT ---|---------> X.25 Tx
                   | CU |    |             |
Standard Output <--|    |----|--- INPUT ---|<--------- X.25 Rx
                   \____/    \_____________/


In both cases, INPUT is the stream in which input termio processing is done,
while OUTPUT is the stream in which output termio processing is done.
What is not shown in the second diagram is the serial device driver sitting
between standard input and output, and the cu process, which in turn looks
like the top figure. In other words:

* characters read from the keyboard have /dev/tty's INPUT termio processing
	applied, are then passed to cu, which writes them to the PAD, which
	applies its OUTPUT termio processing, before sending them over the
	network as X.25 data packets.

* data packets received over the X.25 connection are converted into a character
	stream, which has the PAD's INPUT termio processing applied, before
	being passed to cu, which writes them to standard output, which results
	in /dev/tty's OUTPUT termio processing being applied before they are
	finally output.

Is this correct?

-- 
Graham Wheeler                     | "That which is weak conquers the strong,
Software Systems Engineer/Student  | that which is soft conquers the hard."
Aztec Information Management/UCT   | 		Lao Tzu - Tao Te Ching Ch. 78
gram@aim1.aztec.co.za / gram@cs.uct.ac.za
From: osycs@giac1.oscs.montana.edu (Craig Spannring)
Newsgroups: comp.unix.programmer
Subject: Where is Posix?
Keywords: n
Date: 14 Aug 92 19:59:39 GMT
Distribution: usa
Organization: Geographic Information & Analysis Center Montana State University

Where can a person get a copy of the Posix standards?

-- 
====================================================================
 Six of one, 110 (base 2) of       | Craig Spannring
 another.                          | osycs@giac1.oscs.montana.edu
 ----------------------------------+--------------------------------
Newsgroups: comp.unix.programmer
From: alan@dragon.acadiau.ca (Alan W. McKay)
Subject: Re: awk question
Organization: Acadia University
Date: Mon, 17 Aug 1992 14:37:06 GMT

chaiklin@cunixf.cc.columbia.edu (Seth Chaiklin) writes:

>Where should I post an awk question?  I am trying to
>understand how to work with a 2-dimensional matrix, and
>can't seem to find the appropriate newsgroup.
>Thanks,

Either here, in comp.unix.shell or comp.unix.questions should be fine.
-- 
--
Alan W. McKay		| (902)542-2201.158	| Wolfville, N.S. Canada
alan@acadiau.ca		| Acadia University	| SUB Box 6008, B0P 1Z1
----------------------------------------- My Canada includes Quebec -----
From: spencer@stroke.Princeton.EDU (S. Spencer Sun)
Newsgroups: comp.unix.programmer
Subject: Re: How can a program know where it was invoked?
Date: 15 Aug 92 02:20:32 GMT
Reply-To: spencer@phoenix.princeton.edu (S. Spencer Sun)
Organization: Live Organ Transplants

In article <1992Aug14.183521.1704@sco.com>, brianm@sco.com (Brian Moffet) writes:
>Not necessarily.  Under the Unix OS, you can do an attempt at figuring
>out where the binary is:
>
>1: check to see if the argv[0] is an absolute/relative path name.
>2: check to see if your psargs have any good information (may not be doable)
>3: get the environment variable PATH and go through it in order
>    checking to see whether the program in question exists in that directory.
>4: Check to see if there is your program name in the current directory.
>
>If you find that the file you found was actually a symbolic link,
>you have to trace that link to see if it ends with a valid executable.
>
>If all of these fail, you have a program which someone changed the name on
>via execl() or something similar.  In this case, you're not going to have
>much luck.

Just to clarify, I don't think this is really what Mr. Moffet meant, but
IMHO the way his article is written implies that the very last paragraph
quoted above is true only if checks 1-4 fail and this is not true.
Suppose I execl something with argv[0] = "/bin/zsh" even though what I'm
really running is "~spencer/zsh-beta/zsh"?  Condition 1 is satisifed,
condition 3 could be satisfied, condition 4 could be satisfied if I'm in
any directory with a copy of zsh in it, and maybe condition 3 could be
satisfied if I knew what psargs was.  They could all be symbolic links,
too, but they'd all still be wrong.

OK, any situation where this fails is likely to be extremely artificial,
but then again, (1) I could say I'm looking at it from a theoretical
standpoint (read: I'm just being argumentative); and (2) making a
symbolic link named '-i' to a setuid shell script is pretty artificial
too.

>My question would be, "why would you want to know where the program is in the
>first place?"  Most cases of having some startup script can be solved by
>placing the startup script (or whatever) someplace sane, not where the
>directory is...

I agree with this though.  I would imagine that in general there is some
other way of achieving the desired effect.  (Which isn't to say
necessarily that there SHOULDN'T be a reliable way for an executable to
find out exactly where it resides, but.)

----------- The opinions expressed in this article are solely mine. -----------
<Insert lame attempt at disclaimer humor>
sss/PU'94 Dept of CS (spencer@phoenix.princeton.edu)/JvNCnet (spencer@jvnc.net)
"'Rue the day'?  Who talks like that?"
Newsgroups: comp.unix.programmer
From: jmolinari@hamp.hampshire.edu
Subject: real-time character input
Organization: Hampshire College
Date: Thu, 13 Aug 1992 15:21:34 GMT

	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
From: got@asl1.sta.sub.org (Gerhard Otte)
Newsgroups: comp.unix.programmer
Subject: cscape and 8-bit
Keywords: cscape 8bit
Date: 20 Aug 92 19:23:07 GMT
Organization: ASL Regensburg,Germany

Hi Folks,

i'm using cscape 3.2 (source license) on an sco unix v 3.2.2 machine
with sco dev sys 3.2.2 and i know the underlying curses is not true
8bit capable (line drawing via acsc etc.). But ...
is there a way to make cscape accept german 8bit special chars without
character mapping via mapchan.

Thanks in advance,
Gerhard
-- 
       ____  _____   _    Gerhard Otte 
      /    | | ___| | |   phone: ++49 941 75081 
    /  /_| | |_|__  | |   fax:   ++49 941 75084 
  /  /___| |  __| | | |__ got@asl1.sta.sub.org
Newsgroups: comp.unix.programmer
From: adams@pdv2.fmr.maschinenbau.th-darmstadt.de (Adams)
Subject: Re: Real Time timing problem
Date: Fri, 14 Aug 1992 23:33:52 GMT
Organization: TH-Darmstadt


Your problem is a hard realtime problem, as processing a check must
be _finished_ within 37 ms. 

	FORGET about SysVR[34] for real time applications. 
	Get LynxOS, QNX for 386, or think  about other 
	hardware and software.

best adams
Newsgroups: comp.unix.programmer
From: paws@spam.cray.com (Daniel Baehr)
Subject: Help with if structures in makefile
Organization: Cray Research, Inc.
Date: 21 Aug 92 14:02:44 CDT


  As the subject says I need help with if structures in a makefile.
 Below is the snippet if code I am wondering about.

if [ \$host == "HERE" ]; then \
   VARIABLE=pathname ; \
else VARIABLE=differentpathname ; \ 
fi

   When I type make I get a Badley formed macro assignment against the 
 second line.  What am I doing wrong?  This is running on a SUN 4.1.1.



    Thanks..

    Daniel Baehr

--
+------------------------------------------------------------------------+
| Daniel Baehr Work: paws@spam.cray.com  Home: daniel_baehr@bearsden.UUCP|
| These OPINIONS are mine and mine alone.                                |
+------------------------------------------------------------------------+
Xref: sparky comp.unix.programmer:4401 comp.lang.c:12634 comp.arch:9010
From: bsullivn@sc.sni.ie (Bryan O'Sullivan)
Newsgroups: comp.unix.programmer,comp.lang.c,comp.arch
Subject: Re: What would you like in a debugger?
Date: 17 Aug 92 09:32:34 GMT
Article-I.D.: sc.158
Reply-To: bryan@sc.sni.ie
Organization: Siemens-Nixdorf Software Development Centre, Dublin
X-Newsreader: Tin 1.1 PL3



ross@zooid.guild.org (Ross Ridge) writes:

:Perhaps people are already using their debuggers to trace problems
:efficiently.  Nah... since you can't do that, how could any one else?

In my mind, running out of CPU quota when tracing a variable within dbx
does not constitute efficiency.  Maybe we are operating on different
interpretations of the word.

	-- 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.unix.,wizards
From: jhu@bronze.ucs.indiana.edu (Jun Hu)
Subject: How to restart a process after the machine is up.
Organization: Indiana University
Date: Mon, 17 Aug 1992 03:16:21 GMT

Hi, Could someone help me with following question?

    I have a program which needs big amounts of CPU time. It
has been running on the unix-based machine for a while. Because 
the machine will be down once every month, I would like to have my 
process terminated some way (save the core image of the process? ) 
before the machine is down and restarted manually from the point it 
stops after the machine is up, so the previous computing time is 
not wasted.

    Is it possible to achieve this?

    Thanks for your attention.


Jun Hu
-- 
  ___                                _    ,
 (   >                              ' )  /
  __/______. .     ____              /--/     . .
 / /      (_/_____/ / <________     /  (_____(_/_____
<_/

-- 
  ___                                _    ,
 (   >                              ' )  /
  __/______. .     ____              /--/     . .
 / /      (_/_____/ / <________     /  (_____(_/_____
Newsgroups: comp.unix.programmer
From: jpb@unislc.uucp (John Bonn)
Subject: Re: docs for SVR4 form(3x), menu(3x), and panel(3x)
X-Newsreader: Tin 1.1 PL5
Organization: Unisys Corporation SLC
Date: Tue, 18 Aug 1992 20:52:37 GMT


The Prentice Hall book:
UNIX System V Release 4 Programmes's Guide: Character Users
Interface (FNLI and ETI)
ISBN:0-13-947045-X

Covers what your looking for.
It is probably available in local bookstores.
It can also be order from Prentice Hall @ (201)767-5937

JP
From: bsullivn@sc.sni.ie (Bryan O'Sullivan)
Newsgroups: comp.unix.programmer
Subject: Re: How to restart a process after the machine is up.
Date: 18 Aug 92 09:46:33 GMT
Article-I.D.: sc.164
Reply-To: bryan@sc.sni.ie
Organization: Siemens-Nixdorf Software Development Centre, Dublin
X-Newsreader: Tin 1.1 PL3



sullivan@cs.rose-hulman.edu (Fred Sullivan) writes:

: A trick which may or may not be applicable.  If the current state of the 
: process is easily saved (say by writing to a file) you can write a signal
: handler for an unused signal (e.g. SIGUSR1), which dumps the state.

: When the program starts up, have it read its starting state from the file.

: When you want to shut down the machine, just send the process a signal.  I
: once used this technique to keep a program running for several months.

Possibly a better approach: when a UNIX system is being brought down to
single-user mode to be powered down, the script that handles this (on
SVR4 at least) sends a SIGTERM to all user processes and gives them
around 5 seconds of grace to save state or clean thingss up before
sending them a non-maskable SIGKILL.  You might do better to write a
SIGTERM handler for your application; it avoids the need for
special-casing.

	-- 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
Xref: sparky comp.unix.programmer:4326 comp.unix.internals:1698 comp.sys.hp:9321
From: bt@irfu.se (Bo Thide')
Newsgroups: comp.unix.programmer,comp.unix.internals,comp.sys.hp
Subject: Re: inode to filename
Date: 16 Aug 92 13:12:04 GMT
Organization: Swedish Institute of Space Physics, Uppsala, Sweden

In article <1992Aug15.205816.16861@actrix.gen.nz> paul@actrix.gen.nz (Paul Gillingwater) writes:
>I don't have an HP-UX system handy, but both Coherent and ISC Sys V.3 have a
>command called ncheck(1m), which will tell you the names of files in a file
>system based on its inode number.


The ncheck(1m) is there in HP-UX too!

Bp
-- 
   ^   Bo Thide'--------------------------------------------------------------
  |I|        Swedish Institute of Space Physics, S-755 91 Uppsala, Sweden
  |R|      Phone: (+46) 18-303671.  Fax: (+46) 18-403100.  IP: 130.238.30.23
 /|F|\          INTERNET: bt@irfu.se      UUCP: ...!mcvax!sunic!irfu!bt  
 ~~U~~ ----------------------------------------------------------------sm5dfw-
Newsgroups: comp.unix.programmer,comp.security.misc,comp.unix.admin
From: uaa1006@dircon.co.uk (Peter Miles)
Subject: How secure is chroot?
Date: Sat, 15 Aug 1992 09:38:48 GMT


I'm developing a system which uses the chroot(S) call to limit 
the area a user can access on a UNIX system.

I have a program which is SUID root, which runs chroot and then
sets the UID of the process to that of the user, and spawns 
/bin/sh (which is present under the chroot path).

My question is....how secure is this? Are there any areas I 
should look out for to ensure that no one can access other parts 
of the system?

General comments and observations about the chroot facility 
would also be of interest.

I should add that under the chroot area, I've created a /dev
directory, containing entries for /dev/null, /dev/tty, /dev/socksys 
(for outgoing ftp/telnet).

Please email any replies, and I'll post a summary to the net.

Thanks for any help!
                        -- Pete
-- 
Pete Miles			uaa1006@dircon.co.uk
				...uknet!dircon!uaa1006
Newsgroups: comp.unix.programmer
From: schwaigr@news.weeg.uiowa.edu (Jim Schwaiger)
Subject: Yielding a Timeslice
Organization: University of Iowa, Iowa City, IA, USA
Date: Wed, 19 Aug 1992 18:48:37 GMT

Is there a standard (or commonly accepted) way for a program to yield
its timeslice?  I have a program which checks on a condition in shared
memory and would like to sleep (for less than 1 second) if that condition
is not met, rather than waiting in the "hot" loop.

Jim Schwaiger
From: melennec@stna.dgac.fr (Ronan Melennec STNA 7C p8240 BD22)
Newsgroups: comp.unix.programmer
Subject: Re: How to obtain the session id of a process
Date: 13 Aug 92 08:03:43 GMT
Organization: STNA 95 rue Henri Rochefort 91025 Evry Cedex 33(1)60.79.80.00

In article <152@sc.sni.ie>, bsullivn@sc.sni.ie (Bryan O'Sullivan) writes:
> 
> 
> rml8030@usl.edu (Lavergne Rhena M) writes:
> 
> :>Under SunOS 4.1, a process can issue a setsid() system call to disassociate
> :>itself from its controlling terminal and become a session leader.
> :Try "echo $$", it works on most shells, it will display the current
> :shell's process id.
> 
> [...]
> As far as I know, SunOS should include the getsid(2)
> system call -- SVR4 certainly does, and it would be more than a little
> bizarre if Sun left it out.

It depends on the SunOS version. SunOS 5.0 (aka Solaris 2.0) has
getsid(2), SunOS 4.1.1 doesn't have it.

-- 
Ronan Melennec              | Service Technique de la Navigation Aerienne
+33 1 60 79 82 40           | Departement 7
melennec@stna7.stna.dgac.fr | 95, rue Henri Rochefort, 91025 EVRY CEDEX, FRANCE
Xref: sparky comp.unix.programmer:4323 comp.unix.misc:3240
From: guy@Auspex.COM (Guy Harris)
Newsgroups: comp.unix.programmer,comp.unix.misc
Subject: Re: Process & Signal Question
Date: 15 Aug 92 18:06:07 GMT
Followup-To: comp.unix.programmer
Organization: Auspex Systems, Santa Clara

>You could also try opening the executable file in exclusive mode.

"Exclusive mode"?  Is that an HP-UXism?

NOTE: O_EXCL is *NOT* "exclusive mode", when used to open an ordinary
file, unless the system under which it's being used is a Mutant UNIX
From Hell.  It's "exclusive create" mode, which merely says that if the
file already exists, the open should fail.

An "exclusive mode" bit for "open()" might be a good idea.  An
"exclusive mode" bit for "open()" with the name O_EXCL would probably be
a Bad Idea.
From: huxtable@kuhub.cc.ukans.edu (Kathryn Huxtable)
Newsgroups: comp.unix.programmer
Subject: Need help finding processes in a session
Date: 19 Aug 92 16:08:39 CDT
Organization: University of Kansas Academic Computing Services

Hi all,

I am writing a program that needs to check the processes of
a session to determine whether or not a particular program
is already running.  It seems to me that ps knows how to do
find the child processes of a session.  How does it do it?
Is there ps source available somewhere or is there a
subroutine I'm just not finding?

I'm running on AIX but we'd like it if it would run on other
variants as well, especially Ultrix.

Thanks in advance,

-Kathryn

-- 
Kathryn Huxtable              \   "Women who laugh too much, and the women
huxtable@kuhub.cc.ukans.edu   /\   who love them." --- Jamie Anderson
From: cmhui@cucs18.cs.cuhk.hk (Hui Chau Man)
Newsgroups: comp.unix.programmer
Subject: C++ compiler for VME147, UNIX System V/68
Date: 19 Aug 92 02:57:09 GMT
Organization: Faculty of Engineering, The Chinese U. of Hong Kong

Dear Netters,

I am now using a VME147. The O/S UNIX Sysetm V/68 by Motorola. I would
like to know if there are any C++ compilers which can run on this
machine.

Thanks in advance.


C.M. Hui
Dept. of Computer Science
The Chinese University of Hongkong
Shatin, N.T.
Hongkong

Internet: cmhui@cucs18.cs.cuhk.hk
FAX: (852) 6035024
Newsgroups: comp.unix.programmer