HDTenEightyP/NetNews huggingface dataset:
From: pbooth@ps.ucl.ac.uk (Peter Booth)
Newsgroups: comp.unix.programmer
Subject: dbx and double functions
Summary: dbx cannot examine value of double math functions
Keywords: dbx math.h double functions
Date: 25 Aug 92 17:53:04 GMT
Distribution: comp
Organization: Photogrammetry and Surveying, UCL

Has anyone come across this problem before? I am unable to print the
value of functions declared as double in math.h whilst using dbx or 
dbxtools on a SUN system. Code fragment :
#include <stdio.h>
#include <math.h>
 
extern double pow();
 
main()
 
{
        double a, b;
 
                {
                a = cos( (3.1415/2));
                b = pow( 10.0,3.0);
                printf("cosine(pi/2) is %8.3f and ten cubed is %8.3fkm", a,b);
                }
        return 0;
}
 
Dbxtool text window:
dbxtool) print pow(10,3)
pow(10, 3) = 0
(dbxtool) print pow(10.0,3.0)
pow(10, 3) = 1083129856
(dbxtool) whatis pow()
$integer;
(dbxtool) whatis cos()
$integer
dbxtool) print (double) cos(3.14)
(double ) (int ) cos(3.14000000000000012) = 1074339512.0
 
dbx seems to think these are int functions (apologies for anthropomorphism)
This is a simplification of a mathematically complex function I am
trying to debug step by step. I've RTFMd and I've RTFFAQd. Any ideas?
From: jrg@netcom.com (Parade)
Newsgroups: comp.unix.programmer
Subject: m4 Macro Preprocessor examples wtd
Date: 27 Aug 92 01:21:20 GMT
Reply-To: jrg@netcom.com
Organization: People's Popular Front for Revolutionary Darwinism
X-Newsreader: Tin 1.1 PL4


	I have been using cpp for some real ugly hacks and basically
now realize why the man pages for it state that it wasn't intended
for anything but a C pre-processor.

	Somehow I learned about the existence of the m4 macro
processor, and this looks more along the lines of what I want,
but I cannot glean a heck of a lot from its man page.

	Could any kind soul please send a short example of what
m4 can be made to do, or if there are any simple docs/refs on it,
I would appreciate those, too.  Email only, unless this would be
of general interest.


				Thanks,
				-russ.

-- 
jrg@netcom.com                                             russ granger
   Founder of the People's Popular Front for Revolutionary Darwinism
                     Parade says, "Evolution NOW!"
Newsgroups: comp.unix.programmer
From: peter@zeus.dialix.oz.au (Peter Wemm)
Subject: Dumb question: How do I find the remote address on a TLI connection
Organization: Karam Pty. Ltd. Perth, Australia
Date: Thu, 27 Aug 1992 21:36:24 GMT

OK, first I'll point out that I have no manuals....

I have a certain program that would be useful if run under the listener
on SVR4.  Anyway, it is invoked with a net.connection on fd 0.
How can I find the remote address info? A quick RTFM yielded little.

The original program used socket calls to find the address, but for TLI
this is not possible.

Any suggestions?

A quick fix would be appreciated, but it's not critical - the address info
is for utmpx logging (IE: it would be nice, but nobody would loose sleep..)

(I know, I know, find Stevens' book...  but I want to do this yesterday.. :-)
-- 
Peter Wemm : peter@zeus.dialix.oz.au     If it's broke, fix it (The MS-DOS way)
Work phone: +61-9-479-1855      If it aint broke, don't touch it (The Unix way)
Fax: +61-9-479-1134     If we can't fix it, it ain't broke (Maintainer's Motto)
  "Don't give me that intelligent life cr*p, find me something to blow up!"
Newsgroups: comp.unix.programmer
From: muts@fysap.fys.ruu.nl (Peter Mutsaers)
Subject: CVS and other sourcecode control systems: managing renamed files
Organization: Rijks Universiteit Utrecht
Distribution: comp
Date: Fri, 28 Aug 1992 09:44:26 GMT

Hello,

for a big chunk of sources I use cvs to manage different versions and
additions etc. It is wonderful, but I am missing one thing:

When I rename a file all I can do is remove it and add it as a new
one. History is lost and in short there is no decent way to cope with
changing filenames.

Is there something I am missing from the man page, or does anyone know
of other source code control systems that deal with
renaming/splitting/joining of files?
--
_________________________________________________________________________
Peter Mutsaers.         |================================================ 
muts@fys.ruu.nl         |              Memento Mori
Newsgroups: comp.unix.programmer,comp.unix.questions
From: frank@D012S436.sniap.mchp.sni.de ()
Subject: Re: Problem reading from pipe ("|") using read()
Organization: Siemens-Nixdorf AG
Date: Wed, 26 Aug 92 14:32:18 GMT

stsshol@st.unocal.COM (Herb Lam) writes:
: 
: First of all, my program reads input from standard in and writes to 
: standard out.  I had used fread() and fwrite() to do I/O, but because I
: needed to do some ioctls, it was suggested that I use read() and 
: write() instead.  I did not have any problems until I changed all my
: file pointers to file descriptors, fopen()/fclose() to open()/close(),
: and fread()/fwrite() to read()/write().
: 
: My problem is this.  When I run the program by itself, e.g.:
: 
: 	run < input > output
: 
: Everything is fine.  However, if I get the input from the pipe:
: 
: 	"some program" < input | run > output
: 
: The input to the "run" program gets messed up.  I don't get any system


What does "messed up" mean?  You need to supply
more info if anyone is going to be able to help you
with this.  

What does your read call look like?

Are you using any other system calls (e.g fork()?) 

: errors.  I believe the problem is with read(), but I don't know how or
: why it is doing this.  Someone suggested that it may be due to some 
: buffering problem in read().  Can anyone elaborate on this?  Since the 
: default for the program is standard in and standard out, I do not need 
: to use open() to open standard in and standard out, right?  I've checked
: the file descriptors when I run the program and they are correct:  0 for
: input and 1 for output.
: 
: Any suggestions to solving this?
: 

I doubt it, unless you give us some more info...

: Thanks,
: 
: 	Herb
--
Frank O'Dwyer		       			Disclaimer: 
Siemens-Nixdorf AG 	                        I will deny everything
Tel.  : +49 (89) 636-40639                      Fax.  : +49 (89) 636-45860
e-mail: Frank.ODwyer@sniap.mchp.sni.de
Newsgroups: comp.unix.programmer
From: haseka@aix.rpi.edu (Atilla A Hasekioglu)
Subject: re:multimedia
Organization: Rensselaer Polytechnic Institute, Troy NY
Date: Wed, 2 Sep 1992 20:54:26 GMT

I wrote before:

I am looking for a multimedia software that compresses images and has mailing 
options. This should be in Xwindows. I have images in many formats.
I would like to be able to change their formats and have printouts. I also
would like to be able to view them. The software I am looking for should
have all these options. I also would like to have the option to decompress and
view the image from where it is sent by mail, so this will be a two sided
software that can be used both by the sender and receiver  side.
  If anybody can help me,I will very much appreciate it.



I found the multimedia software I was looking for from a colleague, if
anybody is interested.It is very useful. It is for SUN and performs the
compression in JPEG. It has file conversion facilities in GIF, PPM,PGM,
TIFF, SUN raster, XBM, XWD, FAX G3 formats. It has also an option to
change from these formats to PS format and you can later print it.
It also mails the compressed image by email. At the other end the receiver
can make necessary format changes and view the image. My colleague says
he is very happy with this product, and it is indeed very useful.
For the interested you can find this software from :
IBS
1223 Peoples Ave.
Troy, NY 12180
Tel : 518 276 4770
Fax: 518 276 6380

 The name of the software is MultiMailv1.0.
From: sp_pm@space.alcbel.be (Paul Moore)
Newsgroups: comp.unix.programmer
Subject: Wanted: UNIX system/network programming book recommendation
Date: 4 Sep 92 16:54:47 GMT
Article-I.D.: space.9209041254.AA08146
X-Received: by usenet.pa.dec.com; id AA16258; Fri, 4 Sep 92 10:49:54 -0700
X-Received: by inet-gw-1.pa.dec.com; id AA02328; Fri, 4 Sep 92 10:49:51 -0700
X-Received: from ub4b.buug.be by mcsun.EU.net with SMTPid AA28222 (5.65b/CWI-2.174); Fri, 4 Sep 1992 19:49:27 +0200
X-Received: from alcbel.UUCP by ub4b.buug.be (5.65c/ub4b_02)id AA11870; Fri, 4 Sep 1992 19:49:26 +0200
X-Received: from se.alcbel.be by alcbel.be (4.1/SMI-4.1)id AA06284; Fri, 4 Sep 92 14:51:56 +0200
X-Received: by se.alcbel.be (5.57/SE_03)id AA18215; Fri, 4 Sep 92 14:55:27 +0200
X-Received: from btmpjw.space by space.alcbel.be (4.1/SMI-4.0)id AA08146; Fri, 4 Sep 92 14:54:47 +0200
X-To: comp.unix.programmer.usenet


Hello,


I'm looking for books that deal with UNIX network and system programming.

A book that has been recommended to me is:

    UNIX Network Programming, by W. Richard Stevens

Are there any other books available in this field?


I've heard that Stevens has another book available, just recently published:

    Advanced UNIX SYstem Programming

or some such similar title. Has anyone seen this book, or offer any comments?


Please email responses, as I don't have a News connection. As usual, I'll summarise responses if there is sufficient interest.


Thanks in advance for any replies,

- Paul

-------------------------------------------------------------------------------
email: sp_pm@space.alcbel.be       smail: Paul Moore
                                          Alcatel Bell Telephone,
phone: (+32) 3/829.5024                   Space Dept.,
                                          Berkenrodelei 33,
                                          2660 Hoboken,
                                          Belgium.
Newsgroups: comp.unix.programmer
From: rob@marsh.cs.curtin.edu.au (Robert Alley)
Subject: Reading from serial devices
Organization: Curtin University of Technology
Date: Sun, 30 Aug 1992 10:27:50 GMT

Apologies if this is a really stupid problem, but I'm no wizzard and its
got me stumped.

I have recently had to modify some code for reading two devices connected to
the serial ports on a PS/2 running AIX.  The code uses the low level open,
and read commands to set up and read from the ports (well setup with IOCTL).
One device (a grain analyser) is connected at 1200 baud, the other (a weigh-
bridge) ate 4800 baud.  The code is linked to a database which is running as
two processes, one reading each device.  Data from the 1200 baud device is
being lost as it appears not to be buffered.  I tried changing to use higher
level fget and fopen which I thought were buffered but still no luck.  They
even fail when used in two small programs running in the background, do to
much and the 1200 device drops characters.  Getty's are disabled in
/etc/inittab fro the two ports for what its worth.

Any ideas on where I'm going wrong?  This is bugging the hell out of me, as
it's obviously a pretty simple stuff up on my part, oh yeah catting from the
devices never seems to drop characters no matter how much processing is 
going on and how lower priority I run the cat at.

Many Thanks,

Rob.

--
----------------------------------------------------------------------------
Robert Alley		| See the stars come falling down from the sky
GIS Honours Student     | Gently passing, they kiss your tears as you cry
Curtin Uni. Bentley WA  | See the wind come softly blow your hair from
Australia		|   your face
rob@cs.curtin.edu.au    | And the rain come falling down in its crazy way
			| Still I'm sad, Still I'm sad
			| (Samwell-Smith/McCarthy)
----------------------------------------------------------------------------
Newsgroups: comp.unix.programmer,comp.unix.wizards
From: gerald@atlastele.com (Gerald Aden)
Subject: detecting process death from unrelated process
Organization: Atlas Telecom Inc.
Date: Tue, 25 Aug 1992 22:50:21 GMT

Is there a way for process A to detect that process B has exited where
process A has the pid of process B but is not the parent of process B?

Thanks in advance,
Gerald Aden
-- 
Gerald Aden                         EMAIL: gerald@atlastele.com
Atlas Telecom                       VOICE: [USA] 1+503.228.1400 x659
4640 SW Macadam Ave.                FAX1:  [USA] 1+503.225.5518
Portland, OR 97201                  FAX2:  [USA] 1+503.228-0368
-- 
Gerald Aden                         EMAIL: gerald@atlastele.com
Atlas Telecom                       VOICE: [USA] 1+503.228.1400 x659
4640 SW Macadam Ave.                FAX1:  [USA] 1+503.225.5518
Portland, OR 97201                  FAX2:  [USA] 1+503.228-0368
From: barmar@think.com (Barry Margolin)
Newsgroups: comp.unix.programmer
Subject: Re: help with rpc
Date: 2 Sep 1992 20:28:54 GMT
Organization: Thinking Machines Corporation, Cambridge MA, USA
NNTP-Posting-Host: telecaster.think.com

In article <1992Sep2.150036.8215@homebase.vistachrome.com> mark@homebase.vistachrome.com (Mark Alexander) writes:
>If I were to write a program using RPCs, could I write a
>client program that would cooperate with an ftp server
>process on a remote machine? 

No.  The FTP protocol is not built on RPC.  RPC clients talk to RPC
servers.  More specifically, they can only communicate if they're using the
same RPC protocol (e.g. Sun's ONC RPC or OSF's DCE -- I hope I'm getting
all the alphabet soup right), unless someone has developed an RPC-level
gateway.  (Actually, I think I've read that Sun is working on a
higher-level interface that hides the particular RPC protocol, so the same
application can use both ONC and DCE).
-- 
Barry Margolin
System Manager, Thinking Machines Corp.

barmar@think.com          {uunet,harvard}!think!barmar
Newsgroups: comp.unix.programmer
From: berg@physik.tu-muenchen.de (Stephen R. van den Berg)
Subject: getservbyname(), getprotobyname(), gethostbyname()
Originator: berg@tabaqui
Organization: Rechnerbetrieb Informatik  /  RWTH Aachen
Date: Wed, 2 Sep 92 18:46:23 GMT

I am reposting this question because the last time it seems to have been lost
in the noise (I mistakenly posted it as a reply to some earlier question of
mine).

------------------------

It's me again, sorry, but these portability problems always seem to
come in herds :-).

Let me explain the problem here.  I have this program (procmail) which is
trying to double as a /bin/mail substitute.  Now, the only thing that I yet
have to mimick is the biff/comsat notification which /bin/mail normally does.

Now, in order to that, I have to find out the following:

	1. gethostbyname("localhost.or.something.else")
	2. getservbyname("biff")
	3. getprotobyname("udp")

Well, so far so good, the only trouble is, these calls are done every time
when mail arrives.  I was wondering, what is common practice in this case?

	a. Go by the book and make all three calls at runtime?
	b. Do 1. and 2. at runtime, 3. at compile time?
	c. Do 1. at runtime, 2. and 3. at compile time?
	d. Do all three at compile time?  (By compile-time I mean: compile
	   a separate program that makes these calls, and then use the output
	   from this program to hardcode the number(s) in the real program).
	   
I personally like a., but I might suspect some performance penalty here
(depending on the configuration every one of these calls causes several files
to be opened and miscellaneous network-traffic to be generated).

As a reasonable compromise I suspect that b. is the most eligible, since
the protocOl number for udp is not likely to change, is it?

What would you consider acceptable practice?

Thanks.
-- 
Sincerely,                                  berg@pool.informatik.rwth-aachen.de
           Stephen R. van den Berg (AKA BuGless).    berg@physik.tu-muenchen.de

Real programmers don't just die, they produce core dumps.
From: pinard@IRO.UMontreal.CA (Francois Pinard)
Newsgroups: comp.unix.programmer
Subject: Re: m4 Macro Preprocessor examples wtd
Date: 1 Sep 92 14:34:26 GMT
Organization: Universite' de Montre'al

In article <v0bnrpb.jrg@netcom.com> jrg@netcom.com (Parade) writes:

   [...] but I cannot glean a heck of a lot from [m4] man page.  Could
   any kind soul please send a short example of what m4 can be made to
   do, or if there are any simple docs/refs on it [...]

Hi.  Let me suggest that you ftp GNU m4 from prep.ai.mit.edu, in the
pub/gnu directory, as file m4-1.0.tar.Z.  The documentation is in
Texinfo format, the Info files should be quite readable with any
editor, or printed as is.

Also, if you feel like looking at bigger/hairier examples (and are
familiar with Bourne shell programming), you can take a look at files
acgeneral.m4 and acspecific.m4 from the GNU Autoconf documentation,
which you might get as file autoconf-1.1.tar.Z from the same place.
--
Franc,ois Pinard        ``Vivement GNU!''        pinard@iro.umontreal.ca
(514) 588-4656                                    ...!uunet!iros1!pinard
Consider joining the League for Programming Freedom.  Email for details!
Newsgroups: comp.unix.programmer
From: stsshol@st.unocal.COM (Herb Lam)
Subject: Re: Problem reading from pipe ("|") using read() -- Solved
Organization: Unocal Corporation
Date: Wed, 26 Aug 1992 19:58:59 GMT

First of all, thanks to those who tried to help even thought I didn't 
provide enough info in my original post.  Thanks to David Wagner who
provided a subroutine for reading and checking the return value.

I have fixed the problem so that I can read from the pipe, but I don't
understand exactly why it works.  Here is my modification of David's 
read routine that I used to read data:

	size_t tp_read(int fd, char *bufptr, size_t count)
	{	
	    size_t nread = 0;
	    int    i;
 
	    for (i = 0; i < count; i += nread) {
		nread = read(fd, bufptr + i, count - i);
		if (nread < 0) 
	            err("read: %s", sys_errlist[errno]);
	        else if (nread == 0)
	            break;                      
	    }        

	    return nread;
	}

The data that I'm reading is in this format: ascii header, binary header,
binary data.  The binary data is broken into parts of equal sizes; i.e., 
the first data part contains 2000 bytes, the second part 2000 bytes, etc.  
The data part can be from ~250 bytes to ~64kb.

Now the part that I don't understand is this.  I read each section as 
follows:
	
	nread = tp_read(fd, &ascii_header, ascii_bytes);
	...
	nread = tp_read(fd, &binary_header, binary_bytes);
	...
	while(...) {
	  nread = tp_read(fd, &data, data_bytes);
	  ...
	}

Apparently, the program had tp_read(fd, (char *)&data, data_bytes).  
When I took out the cast, the program worked.  However, the original
program also cast the ascii_header and binary_header to (char *); 
but I was always able to read the headers correctly.  I won't list out 
the entire "data" structure since it is very long, but its members are 
of type short, unsigned short, long, and float.  The ascii_header and
binary_header have similar members.

I also tried replacing tp_read() with the system read() after I got
the program to work; however, I was not able to read the data correctly.  
The headers come out fine though.  As I put it in the other post, the 
data appears "all messed up."  What I mean by this is that I can't tell 
from the output how the data is being read.  It doesn't appear to have 
been offset.  It just looks like garbage.

If I go back and use the tp_read subroutine and check how many times
it went through the loop, everytime I checked the value came out to be 
1.  So it seems that it was able to read all the data on the first try.  
Why doesn't it work if I just put read() in place of tp_read()?
Organization: The American University - University Computing Center
Date: Monday, 31 Aug 1992 16:21:35 EDT
From: <JORDAN@auvm.american.edu>
Newsgroups: comp.unix.programmer
Subject: Help: RCS for UNIX from Purdue?

I understand that Purdue has produced a shareware configuration management
package called RCS (Revision Control System).  The latest version is 5.7.
Any information about this would be greatley appreciated.  Pls. Respond.
Newsgroups: comp.unix.programmer
From: fcw@telecom.ti.com (Fred Wedemeier)
Subject: Re: Sending "datagrams" on a connected socket.
Reply-To: fcw@telecom.ti.com
Organization: TI Telecom Systems, Dallas
Date: Wed, 2 Sep 1992 18:26:16 GMT

In article 6750@csc.ti.com, fcw@telecom.ti.com (Fred Wedemeier) writes:
> 
> I need two processes to talk to each other in a "reliable,
> flow-controlled, in-order, two-way" manner, quoting tcp(4). These
> processes need to exchange discrete messages rather than boundary-less
> streams of bytes.
> 

and...
> 
> I can add a layer onto a stream or datagram socket, but it would be
> nice if some incantation of socket library calls can do it instead.

Well, what I was hoping for was advice on some combination of socket(),
bind(), or whatever that would allow me to do the above with a single
send()/recv(), once the socket was created and bound properly. I guess I
didn't ask the question clearly enough.

Many people were kind enough to reply with the almost unanimous
suggestion to send() the byte count and then send() the text of the
message.  On the receiving side, recv() the fixed-size byte count and
then ask for that number of bytes in another recv(). Thx. for the
responses!

In an application program, this would be sufficient since a connected
socket guarantees sequential delivery of bytes. What I'm actually doing
right now is building a comm API to be used by a group of programmers.
The API needs to avoid the situation of an application program
bypassing the API, communicating directly with the socket, and
potentially getting the byte stream out of sync.

So the clarified question is "can I send/receive a 'datagram' on a
connected socket with an atomic send()/recv()?" 

If the answer is no, I'll probably hide the descriptor or put a USER
BEWARE in the API documentation.

---
Fred Wedemeier    pho: 214-997-3213     fax: 214-997-3639
                timsg: fcw             inet: fcw@pioneer.telecom.ti.com

Newsgroups: comp.unix.programmer
From: errant@polari.online.com
Subject: Need help with System()
Summary: System() wont work correctly
Keywords: Need help with System()
Organization: Seattle Online Public Access Unix.  (206) 328-4944 (all lines telebit-equipped)
Date: Fri, 28 Aug 1992 14:07:05 GMT

Am unit testing a much larger program, and have run into a glitch
with the below code:
main()
{
  if (system ("/bin/ps -el | /usr/bin/fgrep -c cron") == 1)
     printf ("good\n");
  else
     printf ("bad\n");
}

When program is run the following results:
#a.out
1
bad
#

As can be seen, it shows that 1 is how many times cron is
detected, but then it drops through and prints bad.  What gives??
Is there something I could add to the code that would show me??
I'm stumped!
Xref: sparky comp.unix.programmer:4505 comp.unix.xenix.sco:2773
From: bselling@liszt.helios.nd.edu (brian selling)
Newsgroups: comp.unix.programmer,comp.unix.xenix.sco
Subject: Help with modem and socket programming?
Date: 31 Aug 92 22:05:24 GMT
Organization: University of Notre Dame, Notre Dame

I am writing a program that allows for a socket to pass thru to a serial line
connected to a modem.  The idea is for a modem pool on the an SCO box that
allows for PC's running Lan Workplace for DOS to use a utilty that redirects
serial port communication thru a host and socket port.  The PC's can then use
kermit to access thru the socket to one of the modems.  That's the idea anyway.
Now here's the problems:  
(1) I can only access /dev/tty1a not /dev/tty1A ... isn't
that reversed of what it should be?
(2) How can I set up non-buffered IO thru the socket?  Currently the only
way I can communication thru the socket is using read() which waits for
a carriage return.
(3) Attempting to use the modem file descriptor in the same program with
the socket file descriptor gives accept errors?

If anyone has some experience with this sort of project, please send me some
email.  Thanks in advance.

Also I believe the version of SCO is 1.1.1
--
Teresa & Brian Selling
South Bend, IN
Newsgroups: comp.unix.programmer,comp.unix.wizards