HDTenEightyP/NetNews huggingface dataset:
From: romig@cse.unl.edu (Phil Romig)
Subject: System Stats
Organization: University of Nebraska - Lincoln
Date: Mon, 5 Oct 1992 03:27:41 GMT


I'm looking for methods to determine 1) CPU type, 2) total physical memory
and 3) cpu load statistics under BSD 4.3.  I'd rather not use kvm_nlist(),
but if that's the only way could you point me to a better reference
than the man page (it's a little vague).

thanks for you help
-PHIL-

romig@cse.unl.edu
University Of Nebraska, Lincoln
Lincoln, Nebraska
Newsgroups: comp.unix.programmer
From: chupchup@ferkel.ucsb.edu (Robert Earl)
Subject: Re: "&" sign and DEC C compiler
Organization: (EVIL!)
Date: Tue, 6 Oct 1992 01:45:15 GMT

lu@m2c.org (Thomas Lu) writes:

|      I have a C program: It compiled fine under SunOS Release 4.1.1 with
|      Sun C compiler.  But it failed to compile under Ultrix 4.1/4.2 with
|      DEC C compiler.

|      VandaScript.c:
|      ccom: Error: VandaScript.c, line 469: unacceptable operand of &
|      for(gen = lsStart(argList); 
| 	(lsNext(gen, (lsGeneric *) &((lsGeneric) newArg),(lsHandle *) 0) == 0)
| 	|| ((void) lsFinish(gen), 0); )

casts are not lvalues so they do not have addresses.  the original
code is wrong.  try something like this:

(lsNext(gen, *(lsGeneric *) &newArg, (lsHandle *) 0) == 0)

|      Clearly, DEC C compiler does not like the "&" sign, but the Sun C
|      compiler take it.  Any help is appreciate !  Thank you !

that Sun C compiler is probably based on pcc and it's not
ANSI-standard.  the DEC C compiler probably isn't either, but it's
closer.
-- 
robert earl          |
rearl@ucsd.edu       | "I got a bottle of tequila, baby, who needs friends?"
rearl@piggy.ucsb.edu |   --Johnette Napolitano, Concrete Blonde
From: yoram@frcs.Alt.ZA (Yoram Tal)
Newsgroups: comp.unix.programmer
Subject: sockets programming
Summary: sockets
Keywords: sockets
Date: 29 Sep 92 09:39:22 GMT
Article-I.D.: frcs.1992Sep29.093922.28879
Organization: M*N*E*T Pay TV


Hi !!!
I need to do some sockets programming and am new to this subject. Can
anyone give some insight/code that performs login/logoff and data
manipulation programs in C ??? The set up I have is a Sun sparcstation
2 talking to a data general machine. Both are running TCP/IP .  



any help would be useful.... thanks in advance. 


yoram 

 
yoram tal 
standard disclaimer applies            
yoram@frcs.alt.za   phone: (home) +27 11 783-2433  (Johannesburg,South Africa) 
-------------------------------------------------------------------------------
From: mike@hpwin052.uksr.hp.com (Mike Croom)
Newsgroups: comp.unix.programmer
Subject: Re: how to set parent's environment variables from shell script?
Date: 5 Oct 92 12:52:19 GMT
Organization: HP PSO - London, England

ENVAR=`command` is the usual method
OR 
eval `command` where stdout of command is a set of assignments

-------------------------------------------------------------------------------
| Mike Croom                       mike@hpwin052.uksr.hp.com                  -
| Financial Services PSO                                                      -
| London UK                        --------------------------------------------
Newsgroups: comp.unix.programmer
From: pt@geovision.gvc.com (Paul Tomblin)
Subject: Chaining signal handlers
Reply-To: pt@geovision.gvc.com
Organization: Not officially GeoVision Systems Inc., Ottawa, Ontario
Date: Sat, 26 Sep 1992 15:52:06 GMT

I have a problem:  My program wants to catch various signals so that we can
do various clean up.  I set up my signal handlers early, so that they are
ready to clean up before there is anything to clean up.  Unfortunately, when
we connect to Ingres, it goes and tromps on all my signal handlers,
installing its own.  What I want to know is if it is possible to call the
Ingres connect (IIsq_Connect()), then restore my signal handlers, but have
my signal handlers call Ingres's signal handlers?

If so, how to I call them?

This is my first guess:
int (*old_sig)();
{ ...stuff...
  ...connect to ingres...
  old_sig = signal(SIGTERM, my_sig_handler);
}

int my_sig_handler()
{
   ....my clean up...
   old_sig();
}

Is this legal and valid?

-- 
Paul Tomblin, pt@geovision.gvc.com
(This is not an official opinion/statement of GeoVision Systems Inc.)
"Ok dear, want me to call the bike shop and see if they'll sponsor your
mid-life crisis?" "Yeah.  Ask them if they'll upgrade my shifters, too"
From: C.R.Ritson@newcastle.ac.uk (C.R. Ritson)
Newsgroups: comp.unix.programmer
Subject: Re: Next working day. Was: Easter and Day-Of-Week
Date: 1 Oct 92 08:44:17 GMT
Organization: University of Newcastle upon Tyne, UK, NE1 7RU

sfleming@cs.hw.ac.uk (Stewart T Fleming) writes:

>How about algorithms for evaluating "the next working day." ?
>That's an organizational-, regional-, national-, religion-,
>personal-dependent (at least) concept.

The only attempt I have seen was in a commercial banking package
and was based on a 7 day week, and a country code, which could be
looked up to say that days 0 and 6 are holidays, or that day 5 was
a holiday etc. It was assumed that national governments set the
definition of a working day. All other holidays were table based.

That only leaves you with a problem deciding what is a country.

Chris Ritson <C.R.Ritson@newcastle.ac.uk>
EMAIL: C.R.Ritson@newcastle.ac.uk       Chris Ritson,
PHONE: +44 91 222 8175                  Department of Computing Science
FAX  : +44 91 222 8232                  University of Newcastle upon Tyne,
TELEX: uk+53654-UNINEW_G                UK, NE1 7RU
From: barmar@think.com (Barry Margolin)
Newsgroups: comp.unix.programmer
Subject: Re: what is a socket file?
Date: 1 Oct 1992 07:45:29 GMT
Organization: Thinking Machines Corporation, Cambridge MA, USA
NNTP-Posting-Host: gandalf.think.com

In article <9209301641.AA16925@annapurna.wbst147.xerox.com> leisner.henr801c@xerox.com writes:
>Socket files have the = magic charecter in ls appended to it.
...
>What is this, how do I make one and what do I use it for?

These are Unix domain sockets, used for interprocess communication within a
Unix system.  They can be used for many of the same things that named pipes
are used for.  Their main advantage is that they can also be used by
applications that normally use network sockets.

You create them with bind(2) in a server process, by specifying the AF_UNIX
domain in the socket address.  Once created this way, they can be used just
like a network socket.

An example of this is in the Unix X server.  It binds a network socket that
waits on TCP port 6000, and it also binds a Unix socket in /tmp.  Network X
clients connect to the TCP port, but local clients can connect to the Unix
socket.  This normally provides a more efficient communication path, since
the overhead of TCP processing is avoided (yes, it would be possible for
the network software to recognize when it's looping back and bypass this
overhead, but it isn't normally done).

Unix domain sockets also have some extra features that take advantage of
the fact that both endpoints are on the same system.  In particular, one of
the processes can send an open file descriptor to the other.

See W. Richard Stevens's "Unix Network Programming" for full details.

-- 
Barry Margolin
System Manager, Thinking Machines Corp.

barmar@think.com          {uunet,harvard}!think!barmar
From: sfleming@cs.hw.ac.uk (Stewart T Fleming)
Newsgroups: comp.unix.programmer
Subject: Re: Easter was: Re: Algorithm for Day-Of-Week NEEDED
Date: 30 Sep 92 14:28:01 GMT
Reply-To: sfleming@cs.hw.ac.uk
Organization: Dept. Of Computing and Electrical Engineering, Heriot-Watt University, Edinburgh


The day of the week is straightforward.  Easter less so.
How about algorithms for evaluating "the next working day." ?

That's an organizational-, regional-, national-, religion-,
personal-dependent (at least) concept.

Anyone know good ways of evaluating such phrases ?
STF
--
sfleming@cs.hw.ac.uk                        ...uknet!cs.hw.ac.uk!sfleming
"I go out walking after midnight, searching for you..."
  -Patsy Cline
Newsgroups: comp.unix.programmer,comp.protocols.tcp-ip
From: len@mel.dit.csiro.au (Len Makin)
Subject: Re: Help needed writing a simple Imakefile
Organization: CSIRO DIT (Melb.)
Date: Tue, 29 Sep 92 05:50:02 GMT


In article <1992Sep27.021625.1366@tc.cornell.edu>, mdw@theory.TC.Cornell.EDU (Matt Welsh) writes:
|> I've been trying to write an Imakefile for a small X-Windows program
|> that I'm working on, to no avail. Yes, I have RTFM but I can't seem
|> to translate the instructions into to workable Imakefile. I'd really
|> appreciate it if someone out there could write up a quick generic
|> file for me.... this program has, say, two C source files (foo.c and
|> bar.c) which are (of course) compiled to foo.o and bar.o respectively,
|> then linked together, against libm.a and libX11.a (-lm and -lX11) to
|> the executable baz. A normal Makefile for this would of course look like
|> 
|> baz: foo.o bar.o
|> 	cc -o baz foo.o bar.o -lm -lX11
|> 
|> And what I need to do is express this kind of operation in an Imakefile.
|> Also, do I need some other file (like an Imake.temp)? If so, what
|> would I put in that file for this (simple) program? 
This is a common problem with imake (We almost need a comp.windows.x.imake
or comp.soft-sys.imake to talk about it). Here's what I ended up using:
------------------------------------------------------------------------
#
# Simple(?) Imakefile
#
            SRCS = foo.c bar.c
            OBJS = foo.o bar.o
          LDLIBS = -lm -lX11 $(EXTRA_LIBRARIES)
        PROGRAMS = baz

ComplexProgramTarget(baz)
------------------------------------------------------------------------

Len.Makin@mel.dit.csiro.au               | Senior Computer Scientist    |
CSIRO Division of Information Technology | Supercomputing Support Group |
723 Swanston Street, Carlton             | Tel: +61 3 282 2622          |
VIC 3053, Australia                      | Fax: +61 3 282 2600          |
From: bmskc!moe!paul@uunet.UU.NET (Paul Evan Matz)
Newsgroups: comp.unix.programmer
Subject: Intercepting SIGCHLD signals seems to disrupt system() and pclose()
Date: 29 Sep 1992 01:30:36 -0500
Organization: UTexas Mail-to-News Gateway
NNTP-Posting-Host: cs.utexas.edu

Newsgroups: comp.unix.programmer,comp.unix.wizards
Distribution: na
Keywords: SIGCHLD system pclose

Folks,

Quick question; If a process is looking for SIGCHLD signals, it appears that
both OS functions (SunOS 4.1.1b) system() and pclose() have difficultly
detecting the completion of the process they launch.  As a work around,
we have temporarily disabled the signal handler when running either of these,
but are concerned that the process might miss an exiting child while running
system() or pclose().  Any standard workarounds for this?  Pointers to
references?  Please email me directly.  I'll post a summary.  Thanks!

Regards,
 ____________________________________________________________
| Paul E. Matz, Principal Engineer, PPG Biomedical Systems   |
|   RR 2, Box 55, 26 Lewis Road, Pound Ridge, NY, 10576      |
|   Phone: 914-234-0745, or 914-234-0661                     |
| (in KS:)                                                   |
|   PO Box 15955, 16505 W. 113 St, Lenexa, Kansas 66285-5955 |
|   Phone: 913-894-7500 x7179  Fax: 913-894-7733             |
| email: {...}!uunet!bmskc!paul or paul@bmskc.ppg.com        |
|____________________________________________________________|
Newsgroups: comp.unix.programmer
From: golovch@phoenix.rose.utoronto.ca (Gene Golovchinsky)
Subject: Re: client/server architecture
Keywords: client server NFS RPC MacTCP
Organization: University of Toronto, Department of Industrial Engineering
Date: Mon, 5 Oct 1992 20:29:36 GMT

golovch@phoenix.rose.utoronto.ca (Gene Golovchinsky) writes:

>I have a process that runs only under unix (the server) that I need to 
>send commands to and recieve replies from. The client can either be another
>process running on the same machine, a process on another unix box or a
>mac with MacTCP. 

I should also add that I do not have the source code for the server process.
The best I can do is spawn it from another process and grab its input and
output streams. 


>I am looking for public-domain code that will let me send a recieve a moderate
>volume of information (send to server: 50 bytes; recieve: 500 bytes) very fast.
>Two approaches have been suggested so far: RPC and NFS. I don't know much 
>about NFS, and am inclined to go with RPC although I understand it is more
>complicated.
 
Someone also suggested that I take advantage of NNTP, and use something called
NNTPLink (I think). Has anyone played with this beast, and if so, how feasable
or relevant is it to my situation?

>If anyone has some code (or knows where I can get it) or has some ideas about
>the best way to do this, I would appreciate hearing from you.

>Thanks!

> 2
>G
Newsgroups: comp.unix.programmer
From: wonga@steam.chem.su.oz.au (Adrian Wong)
Subject: Reading spell(1) hash-table
Organization: Dept. of Theoretical Chemistry, University of Sydney
X-Newsreader: Tin 1.1 PL5
Date: Mon, 5 Oct 1992 06:22:16 GMT

Hi,
   I would like to use spell's hashtable in my programme but I don't
know the format of the binary hashtable files. Does anyone know? Even
better, does anyone have sample code accessing the file(s).
Thanks Adrian.

--
-----------------------------------------------------------------------------
Adrian Wong, Dept.of Theoretical Chemistry     wong_a@summer.chem.su.oz.au
University of Sydney NSW 2006 Australia        061-2-692 4137
Newsgroups: comp.unix.programmer
From: jrpg8255@uxa.cso.uiuc.edu (Jeremy Payne )
Subject: transferring data between processes (sockets??)
Summary: how do I move data between process (actually X clients)
Organization: University of Illinois at Urbana
Date: Wed, 30 Sep 1992 23:23:32 GMT
Keywords: XProperties sockets communication

I need to move large amounts of data between X clients and their common
parent (children are created that signal their need for data by passing
around property atoms).  How do I get data from the parent down to its
children?  I figured that creating a socket connection between them
and doing read() & write() would work, but after trying all day to
figure it out I've given up my pride and I'm begging for help.  If 
sockets are the answer could someone explain the mechanics of opening
them and establishing connections etc.?  I suppose I could use the
XSelection stuff for this but I'd really rather not.  I _seem_ (?) to 
be able to create sockets and get them to listen & accept connections,
but I don't know how to deal with timing the data transfer and deciding
when it's ok to close them etc.  Any code frags or general descriptions
would be appreciated...

Thanks a bunch,


---------------------------
Jeremy Payne
UIUC Neuroscience program /
College of Medicine
jrpayne@uiuc.edu
(217)244-4478
---------------------------
From: qinyi@uk.ac.man.cs (Yi Qin (BCW PhD))
Newsgroups: comp.unix.programmer
Subject: Re: what is a socket file?
Date: 2 Oct 92 21:10:23 GMT
Organization: University of Manchester, UK
In-reply-to: mollers.pad@sni.de's message of 1 Oct 92 07:10:27 GMT


Ok, I understand a socket file is created when a Unix domain socket is
created. An actual entry in the file server is created for this file.(?)
But Unix domain sockets only deal with the comm. between the processes 
on the same computer system. Each time when a socket send or recv is
called, does the kernel actually trace this name to the file server?
Is it possible to create an entry in the local file system, such that
the send or recv operation does not need to cross the machine boundary
to get this file? I don't know how the Unix domain socket is implemented,
please enlight me if I am asking a silly question. It looks to me, there
is no need to use the network if the communication only concerns the
local processes.


Yi Qin
qinyi@cs.man.ac.uk
From: bin@primate.wisc.edu (Brain in Neutral)
Newsgroups: comp.unix.programmer,comp.windows.x
Subject: Re: Help needed writing a simple Imakefile
Date: 29 Sep 1992 12:01:08 -0500
Organization: Cafe Limbo
Reply-To: bin@primate.wisc.edu
NNTP-Posting-Host: uakari.primate.wisc.edu

From article <1992Sep29.055002.28144@mel.dit.csiro.au>, by len@mel.dit.csiro.au (Len Makin):
> 
> In article <1992Sep27.021625.1366@tc.cornell.edu>, mdw@theory.TC.Cornell.EDU (Matt Welsh) writes:
> |> I've been trying to write an Imakefile for a small X-Windows program
> |> that I'm working on, to no avail. Yes, I have RTFM but I can't seem
> |> to translate the instructions into to workable Imakefile. I'd really
> |> appreciate it if someone out there could write up a quick generic
> |> file for me.... this program has, say, two C source files (foo.c and
> |> bar.c) which are (of course) compiled to foo.o and bar.o respectively,
> |> then linked together, against libm.a and libX11.a (-lm and -lX11) to
> |> the executable baz. A normal Makefile for this would of course look like
> |> 
> |> baz: foo.o bar.o
> |> 	cc -o baz foo.o bar.o -lm -lX11
> |> 
> |> And what I need to do is express this kind of operation in an Imakefile.
> |> Also, do I need some other file (like an Imake.temp)? If so, what
> |> would I put in that file for this (simple) program? 
> This is a common problem with imake (We almost need a comp.windows.x.imake
> or comp.soft-sys.imake to talk about it). Here's what I ended up using:
> ------------------------------------------------------------------------
> #
> # Simple(?) Imakefile
> #
>             SRCS = foo.c bar.c
>             OBJS = foo.o bar.o
>           LDLIBS = -lm -lX11 $(EXTRA_LIBRARIES)
>         PROGRAMS = baz
> 
> ComplexProgramTarget(baz)

There are threee problems here.

1) To use ComplexProgramTarget(), you should set the make variable PROGRAM,
not PROGRAMS.  The latter is used with ComplexProgramTarget_[123]().

2) LDLIBS is defined in Imake.tmpl either as

	LDLIBS = -L$(USRLIBDIR) $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
or
	LDLIBS = $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)

Either way, you don't need to include EXTRA_LIBRARIES in the definition of
LDLIBS.

3) You shouldn't be setting LDLIBS anyway, because it's already given a
value in Imake.tmpl and you'll just end up with conflicting assignments.
For ComplexProgramTarget() the way to specify application-dependent libraries
is to assign them to LOCAL_LIBRARIES.

So I suggest your Imakefile should look like this:

             SRCS = foo.c bar.c
             OBJS = foo.o bar.o
  LOCAL_LIBRARIES = -lm -lX11
          PROGRAM = baz

ComplexProgramTarget(baz)

-- 
Paul DuBois
dubois@primate.wisc.edu
Xref: sparky comp.unix.programmer:4823 comp.windows.x:17287
From: klute@tommy.informatik.uni-dortmund.de (Rainer Klute)
Newsgroups: comp.unix.programmer,comp.windows.x
Subject: Re: Help needed writing a simple Imakefile
Date: 30 Sep 1992 16:02:55 GMT
Organization: CS Department, Dortmund University, Germany
Distribution: world
NNTP-Posting-Host: tommy

In article <1aa24kINNij3@uakari.primate.wisc.edu>, bin@primate.wisc.edu
(Brain in Neutral) writes:
|>
|> [stuff deleted]
|>
|> So I suggest your Imakefile should look like this:
|> 
|>              SRCS = foo.c bar.c
|>              OBJS = foo.o bar.o
|>   LOCAL_LIBRARIES = -lm -lX11
|>           PROGRAM = baz
|> 
|> ComplexProgramTarget(baz)

While most of Paul's comments (see [stuff deleted]) are correct and
helpful, there are still problems with the Imakefile:

- If the Motif library is not installed beside the X libraries the
  linker won't find it. For further information see the recent
  discussion about Imake and Motif.

- The line "PROGRAM = baz" is superfluous as the ComplexProgramTarget
  rule defines this Make macro itself:

/*
 * ComplexProgramTarget - generate rules for compiling and linking the 
 * program specified by $(OBJS) and $(SRCS), installing the program and its
 * man page, and generating dependencies.  It should only be used in 
 * Imakefiles that describe a single program.
 */
#ifndef ComplexProgramTarget
#define ComplexProgramTarget(program)                                   @@\
        PROGRAM = program                                               @@\
                                                                        @@\
AllTarget(program)                                                      @@\
                                                                        @@\
program: $(OBJS) $(DEPLIBS)                                             @@\
        RemoveTargetProgram($@)                                         @@\
        $(CC) -o $@ $(OBJS) $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS)
$(EXTRA_LO
AD_FLAGS) @@\
                                                                       
@@\
SaberProgramTarget(program,$(SRCS),$(OBJS),$(LOCAL_LIBRARIES),NullParameter
r) @@\
                                                                       
@@\
InstallProgram(program,$(BINDIR))                                      
@@\
InstallManPage(program,$(MANDIR))                                      
@@\
DependTarget()                                                         
@@\
LintTarget()                                                           
@@\
                                                                       
@@\
clean::                                                                
@@\
        $(RM) $(PROGRAM)
#endif /* ComplexProgramTarget */


-- 
  Dipl.-Inform. Rainer Klute      klute@irb.informatik.uni-dortmund.de
  Univ. Dortmund, IRB
  Postfach 500500         |)|/    Tel.: +49 231 755-4663
D-W4600 Dortmund 50       |\|\    Fax : +49 231 755-2386
From: mike@pacsoft.com (Mike Stefanik)
Newsgroups: comp.unix.programmer
Subject: Re: Truncating the file without closing the file.
Date: 29 Sep 92 16:25:25 GMT
Organization: Pacific Software Group, Riverside, CA

In an article, pererik@cmi.no (Per-Erik Nordbo) writes:
>How do I truncate my file during execution? I don't want to close the 
>file and reopen, since I have other processes flock()-ing the file.
>However, the file grows continously, so I would like to move the tail
>of the file up in the front and truncate during a lock. Is there a
>weof(int fd) or similar routine that would truncate the file. Would
>these blocks be returned to the free list immediately or when close()ing?

There is the ftruncate() call, and for SCO UNIX and XENIX systems, the
chsize() call.

-- 
Mike Stefanik  mike@pacsoft.com  ...!uunet!pacsoft!mike  (714) 681-2623
Pacific Software Group, Riverside, CA
From: melennec@stna.dgac.fr (Ronan Melennec STNA 7C p8240 BD22)
Newsgroups: comp.unix.programmer
Subject: Having a process explore its own symbol table
Date: 1 Oct 92 10:49:57 GMT
Organization: STNA 95 rue Henri Rochefort 91025 Evry Cedex 33(1)60.79.80.00

Hello,

I would like to know if there is a way within a process
to return a function external name (as generated by C compiler)
knowing its address, that avoids having to open and read or mmap
the process' associated executable file.

I have example code that shows how to extract these external
names knowing the executable file name, but I want to be able
to find these names even when the executable file name is unknown
(assuming the executable file isn't stripped, of course).

Example code welcome.
E-mail answers prefered.

Thank you in advance,
-- 
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