HDTenEightyP/NetNews huggingface dataset:
From: thor@arrakis.denver.co.us (Robert B. Hood)
Subject: Altering UUCP-owned devices
Reply-To: thor@arrakis.denver.co.us
Organization: Bob's Programming Paradise, Lakewood, CO, USA
Date: Tue, 13 Oct 1992 03:15:59 GMT

A quick question:

I have a war-games-like dialing program that runs with
     su uucp -c '/usr/lib/uucp/call.isis'
or something similar to that.  This C program (which
I wrote) modifies the Systems file, rotating the telephone
number of a particular system (isis), and then modifies
the .Status file in /usr/spool/uucp so that redial wait
is set to 0, and initiates spawns `call.isis'.

I do this because the system I'm calling has multiple
lines in, and UUCP has no facilities for designating
a sequence of systems and stopping after it connects
to one.

The system I call has, unfortunately, altered all but
one dial-in line to 8-N-1.  My UUCP will hang when it
connects to such a line because the device (/dev/tty11)
is set for 7-E-1.

My UNIX is getting a little rusty, but I could have sworn
there was a command-line utility that I could use to alter
the stty of this device, even though it is not my current
terminal device.  I can't seem to locate the command
in the manuals (my ability to locate commands in the AT&T
manuals -- an art unto itself -- is also getting rusty).

Any takers?

Thanks in advance, and please e-mail me.  If there's
sufficient interest (although I can't believe there would
be 8^), I'll post the solution...if there is one.

Bob
-- 
Bob Hood    thor@arrakis.denver.co.us     H: 303-980-8392  W: 303-632-2180
---------------------------------------------------------------------------
     152,000 miles-per-second:  Not just a good idea, it's the law!
Newsgroups: comp.unix.programmer
From: anthony@kurango.cit.gu.edu.au (Anthony Thyssen)
Subject: Re: personalized xlock
Organization: Griffith University, Brisbane, Australia.
Date: Tue, 13 Oct 92 06:20:29 GMT

ellis@nova.gmi.edu (Stew Ellis) writes:
| I was more easily amused:  I merely wanted to replace the logo in the
| "bounce"?  mode (flashing SUN logos) with our school logo, plus get rid of
| swarm and one of the other dull modes.

I also replaced the Sun logo with that of the university here. However
the university logo I was forced to use is larger that 64x64
This should up a division by zero bug in the oroiginal code.

This seems to be such a common thing done that maybe a resource for
the bitmap to use should be added!


Any one created a bitmap (1 or more) that just moves slowly around the screen
I'd think I'd prefer that than just logos appearing and disapearing.

Maybe even a number of differant bitmaps.

  Anthony Thyssen - (CIT, Griffith University)       anthony@cit.gu.edu.au
------------------------------------------------------------------------------
  There are two ways of constructing a software design.  One way is to make
  it so simple that there are obviously no deficiencies and the other is to
  make it so complicated that there are no obvious deficiencies.
                                            - Charles Anthony Richard Hoare
------------------------------------------------------------------------------
Newsgroups: comp.unix.programmer
From: johnh@cssc-woll.tansu.com.au (John Harding)
Subject: ioctl() calls on /dev/ttya
Summary: Can't get ioctl to work with /dev/ttya
Keywords: ioctl,termio,serial,port
Organization: Customised Software Solutions Centre, Wollongong, Australia
Date: Wed, 7 Oct 1992 04:26:05 GMT

After spending many hours wading through man pages and experimenting I was
wondering if someone could help me with the following problem:

I want to change the settings on the serial port - /dev/ttya but the ioctl()
system call keeps failing on the SUN. Consider the following program which
opens the port and tries to get the current settings, change them and then
reset them:

#include <sys/termio.h>
#include <sys/file.h>
#include <sysent.h>
#include <errno.h>
#include <iostream.h>

void main()
{
	int fd;
	termio tbuf;

	if ((fd = open("/dev/ttya", O_RDWR)) == -1)
	{
		perror("ERROR: cannot open device");
	}

	if(ioctl(fd, TCGETA, &tbuf) == -1)
		perror("could not get termio settings");

	tbuf.c_cflag &= ~(B9600|CS7|PARENB|PARODD|B300|CS8);
	tbuf.c_cflag |= (B9600|CS7|PARENB);

	if(ioctl(fd, TCSETA, &tbuf) == -1)
		perror("could not change termio settings");

	cerr << pausing << endl;

	pause();
}

The pause is put in the program so that I can observe the changes made to the 
settings using stty.

When I run this program, both ioctl() calls fail saying "Inappropriate ioctl fordevice". WHY?????!!!!!!

This code has to run on a DECstation (running ULTRIX 4.2) so a portable
solution would be nice. The above program seems to work on the DEC insofar that
the ioctl calls don't fail, but I couldn't get stty to verify and changes I 
had made to the settings.

By the way I am running SunOS 4.1.2 on a SPARC station IPX.

Any help would be greatly appreciated

Thanks in advance,

John Harding.

johnh@cssc-woll.tansu.com.au

Newsgroups: comp.unix.programmer
From: mjn@pseudo.uucp (Murray Nesbitt)
Subject: Re: Div by zero - signal?
Organization: Private system in Toronto, ON
Date: Sat, 10 Oct 1992 08:42:36 GMT


puckett@lambda.msfc.nasa.gov (Jim Puckett) writes:

>Is there any signal which corresponds to Divide by 0?
>
>...I mean for ints. I've already noticed FPE instruction....

If you're dividing an integer by the integer 0, SIGILL should be
raised.  However, receipt of SIGILL does not necessarily mean an
integer divide by zero occurred...

-- 
Murray
From: melennec@stna.dgac.fr (Ronan Melennec)
Newsgroups: comp.unix.programmer
Subject: On the fly compression
Date: 13 Oct 92 16:41:40 GMT
Organization: STNA 95 rue Henri Rochefort 91025 Evry Cedex - FRANCE

Hello,

I have to transmit or receive data over a pipe ;
the data being highly redundant Shannon-wise,
I'd like to have access to source code that would allow me to
compress/decompress it on the fly.

(Otherwise I'll have to dismantle one of the popular
file compression utilities...)

E-mail answers prefered.

Regards,
-- 
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
Newsgroups: comp.unix.programmer
From: puckett@lambda.msfc.nasa.gov (Jim Puckett)
Subject: Div by zero - signal?
Organization: NASA/MSFC
Date: Wed, 7 Oct 1992 13:41:45 GMT


Is there any signal which corresponds to Divide by 0?

...I mean for ints. I've already noticed FPE instruction....

...and if not, how can one trap a div-by-0 ?

You might want to respond by e-mail, since the geniuses on this list
would probably be offended, seeing responses to such an easy question! 8-)
COnsider yourselves thanked.

jim p.

puckett@lambda.msfc.nasa.govA

-- 
Jim Puckett    NTI    puckett@lambda.msfc.nasa.gov     
Madison,AL (205)461-4922  
i need to ask myself.....
***********         Would I rather be right, or happy?         ***********
Newsgroups: comp.unix.programmer,comp.unix.sysv386
From: gwr@mc.com (Gordon W. Ross)
Subject: Re: TLI - how to find the name of transport provider special file ?
Reply-To: gwr@mc.com
Organization: Mercury Computer Systems, Lowell MA 01854
Date: Thu, 15 Oct 1992 20:05:33 GMT

Tim Barnett <spxtrb@thor.cf.ac.uk> asks:
> Does anyone know how to find the name of the special files for use with
> the TLI function t_open() ?  Stevens' book mentions that the WIN/TCP
> package uses /dev/ip, /dev/tcp and /dev/udp - but does not mention how
> to discover the file names on other systems.

See the getnetpath(3N) and netdir(3N) manual entries.

For example, on SVR4 one does something like this:

    if ((handle = setnetpath()) == 0) {
	nc_perror("netconfig");
	return(-1);
    }
    while ((nc = getnetpath(handle)) != 0) {

	if ((nc->nc_flag & NC_VISIBLE) == 0) continue;
	if (nc->nc_semantics != NC_TPI_COTS_ORD) continue;
	if (GetAddr (nc, phostname, idisplay, &addr)) continue;

	fd = t_open(nc->nc_device, O_RDWR, 0);
	if (fd < 0 || t_bind(fd, 0, 0)) {
	    t_error(nc->nc_device);
	    continue;
	}

	bzero(&call, sizeof(call));
	call.addr = addr;

#ifdef	DEBUG
	printf("Trying \"%s\"", nc->nc_device);
	for(n=0; n<addr.len; n++)
	    printf(" %2X", addr.buf[n]);
	putchar('\n');
#endif
	n = retries;
	while (n && t_connect(fd, &call, 0))
	    n--;
	if (n) break;

	t_close(fd);
    }
    endnetpath(handle);
    if (!nc) return(-1);
    /* Success! */

GetAddr(...)	/* see netdir_getbyname(3N) */

The above is from my TLI port of X11R5 which is currently being
reviewed and will probably be posted to comp.sources.x soon.
--
Gordon W. Ross			Mercury Computer Systems
gwr@mc.com			600 Suffolk Street
508-458-3100			Lowell Mass 01854-3608
-- 
Gordon W. Ross			Mercury Computer Systems
gwr@mc.com			600 Suffolk Street
508-458-3100			Lowell Mass 01854-3608
From: sam@bsu-cs.bsu.edu (B. Samuel Blanchard)
Newsgroups: comp.unix.programmer
Subject: Re: stdout vs stderr (was Re: Should I use syslog?)
Date: 9 Oct 92 15:53:42 GMT
Organization: Ontario Systems Corp.  Muncie IN

In article <1992Oct7.235620.24833@amd.com> cariapa@angelo.amd.com (Sandeep Cariapa) writes:
>In article <bosullvn.718484862@unix1.tcd.ie> bosullvn@unix1.tcd.ie (Bryan O'Sullivan) writes:
>>>  * A colleague has the impression that re-directing stderr is somehow
>>>    different from re-directing stdout, and that "2> /dev/console" may be
>>>    safe when "> /dev/console" is not.  Does this have any foundation?
>>
>>I strongly doubt it.  Stderr and stdout behave in the same way on
>>mike@inform.co.nz (Mike Williams) writes:
>
>	Bzzt! Wrong answer! Stderr is indeed different from stdout.
>Sandeep Cariapa, Systems Engineer, CTS/DSN.  >cariapa@amd.com, 408-987-9043

I think Sandeep is showing the differerence between the stream stdout
and stderr.  Although interesting, I think the point Mike made was that
stdout and stderr behave in the same manner (not are the same thing).
Although stdout and stderr redirection use different syntax in shell
conventions, I agree with Mike: I'd like to see any real problems related to
redirecting stderr to the console.

ON the preference of syslog:
The original poster should create a logging procedure which can accomodate
many final forms for reporting errors.  This is just good practice.

Our Motorola SVR3.2 box has /dev/osm for operating system messages.
Alternatively, I think syslog allow writing without being root.  This
can be a problem with both /dev/console and /dev/osm.

Syslog on our Sequent has an option LOG_CONS to place messages on the console
if message cannot be passed to syslogd.

I think syslog provides a better final solution.  /dev/console may solve your
short term or in-house needs.  Any product using syslog should have an option
when that facility does not exist.

(Feel free to flame lightly, just use mail)
-- 
B. Sam Blanchard        sam@bsu-cs.bsu.edu
418 Winfield Dr         (317) 284-7131   work
Greenfield, IN 46140
Xref: sparky comp.unix.programmer:4971 comp.unix.questions:12158
From: ben@st-canard.spc.edu (Ben Cohen)
Newsgroups: comp.unix.programmer,comp.unix.questions
Subject: popen()/pclose() and SIGCHLD
Summary: Can you use popen()/pclose() with a SIGCHLD catcher?
Date: 16 Oct 92 03:58:16 GMT
Article-I.D.: st-canar.ben.719207910
Reply-To: ben@st.canard.spc.edu
Organization: St. Peter's College, USA

This was a question that came up today from two different programmers making
very different assumptions. :-)
   From what I've seen [and, yes, I've looked at the BSD sources], these two
are utterly incompatible. The scenario that was being attempted was as
follows:
	main()
	    installs SIGCHLD handler
	    fork()/exec() [and we need to catch death of this child]
	    calls foo()

	foo()
	    popen()
	    pclose()

At this point, the SIG handler gets called, sees that it's not for the PID
we were interested in and just tosses it away. However, we never return from
the pclose() call because it's sitting there trying to do a waitpid() which
isn't ever going to come back.

   My initial reaction was to go to the guy who wrote foo() and tell him to
do things differently, although I'm not _entirely_ happy with this answer
because my initial reaction (before thinking about it) was that this
_should_ work.

   Thoughts, comments, suggestions? [BTW, for the record, the system this
was being performed on is a Sun SS2, with 4.1.2...]

   TIA,
-- 
Ben Cohen		ben@st.canard.spc.edu, ...!rutgers!spcvxb!ben
St. Peter's College	Jersey City, NJ  USA -or- 40-42-57 N/74-03-54 W
   You can't kill a man born to hang! -- Dick's Last Resort, Chicago
Newsgroups: comp.unix.programmer
From: nelsonc@colossus.cs.rpi.edu (Chris Nelson)
Subject: stdarg
Organization: Rensselaer Polytechnic Institute, Troy, NY
Date: Wed, 14 Oct 1992 20:09:11 GMT

This isn't exactly _Unix_ programming but I couldn't find a C news group...

I've got a routine I inherited from a previous programmer:

   void addoffset(int number int* vars, ...) {
      int a, b;
      int* c;
      
      a = getoffset();
      
      for (b = 0; b < number; b++) {
         **(&vars + b) = a - **(&vars + b);
      }/* for */
   }/* addoffset */

I'd like to convert this to use va_arg from stdarg but can't seem to get
it to work.  Can someone here help?

                                  Chris


-- 
------------------------------+----------------------------------------------
Chris Nelson                  |  Rens-se-LEER is a county.
Internet: nelsonc@cs.rpi.edu  |  RENS-se-ler is a city. 
CompuServe: 70441,3321        |  R-P-I is a school in Troy!
Newsgroups: comp.unix.programmer
From: gsf@ulysses.att.com (Glenn S. Fowler)
Subject: Re: personalized xlock
Date: Fri, 9 Oct 1992 09:54:24 GMT
Organization: AT&T Bell Labs

In article <ellis.718590391@nova> ellis@nova.gmi.edu (Stew Ellis) writes:
>winney@DAL.MOBIL.COM (Randy Winney) writes:
>>In article <1b094aINNpop@goldwing.ksu.ksu.edu>, hendric@goldwing.ksu.ksu.edu (Richard Hendricks) writes:
>>|> ...  I would like to write my own Xloxk program that will print a 
>>|> picture of celluar automata ...
>>I did the same thing to make my own version of xlock that would display
>>some neat string art graphics ...
> ... I merely wanted to replace the logo in the
>"bounce"?  mode (flashing SUN logos) with our school logo ...

Our group modified xlock, but in the opposite direction.  We distribute
make actions onto the local network,  where login idle time and load
average are used to determine desirable hosts.  xlock (doing fractals?)
drove the unused host load average up to between 1 and 2.  Nobody ever
saw the fancy graphics though, because the screen blanker was also
running.  Our default xlock now just blanks and locks the screen.  It
was a few years back, but it seems like it took about a dozen
edit-compile-runs to finally get xlock to shut up.

Glenn Fowler    (908)-582-2195    AT&T Bell Laboratories, Murray Hill, NJ
uucp: {att,ucbvax}!ulysses!gsf              internet: gsf@ulysses.att.com
Newsgroups: comp.unix.programmer
From: stas@use.kahrkov.ua (Stanislav V. Voronyi )
Subject: Re: (none)
Date: Thu, 15 Oct 92 09:13:52 GMT

ahalim@ics.uci.edu wrote:
> Is 'write' atomic ?
> 
> I am writing a program that forks several processes, and they
> do 'write' on the same file descriptor at the same time. Do we
> need some kind of lock for mutex or is write itself already atomic so
> that we don't have to worry about implementing lock?
> 

	Yes, write() atomic system call, and we really don't have
to worry about locking and even mode of files: write() appends lock flag
to mode of file automatically.

> Thanks
> /aha

-- 
Stanislav V. Voronyi | E - mail: stas@use.kharkov.ua
  Programmer and     | Internet: stas%use.kharkov.ua@ussr.eu.net
    postmaster       |   Voice +7 (0572) 218-123
 of use.kharkov.ua   |      K'harkov, Ukraine
Newsgroups: comp.unix.programmer
From: Josef Moellers <mollers.pad@sni.de>
Subject: Re: what is a socket file?
Date: Mon, 12 Oct 1992 07:22:47 GMT
Organization: Siemens Nixdorf Info.Sys. AG, Paderborn, Germany

In <1b9p69INNm2g@smurf.smurf.sub.org> urlichs@smurf.sub.org (Matthias Urlichs) writes:

>In comp.unix.programmer, article <josef.717923427@uranium>,
>  Josef Moellers <mollers.pad@sni.de> writes:
>> 
>> "The name space used by the Unix domain protocols consists of
>> pathnames.
>> ...
>> The 4.3BSD implementation creates a file in the file system with the
>> specified pathname, although there are comments in the 4.3BSD manuals
>> indicating that future versions might not create these files. This is
>> somewhat misleading, however, because these filesystem entries are not
>> true "files". For example, we cannot open these files with the 'open'
>> system call. These files have a type of S_IFSOCK as reported by the
>> 'stat' or 'fstat' system calls." [Stevens, 1990]
>> 
>Dumb question: If you can't open the file, how do you call fstat() on it?
>My manual entry on fstat() does not list connect() as a valid way to obtain
>a file descriptor for fstat().

Sorry, I quoted from Steven's book without processing the information.
You're right. If one can't open the "file", one can't use "fstat" on
it's file descriptor.
Stevens probably mentioned "fstat" as a companion to "stat".
A small inaccuracy in an otherwise excellent book!
-- 
| Josef Moellers		| c/o Siemens Nixdorf Informationssysteme AG  |
|  USA: mollers.pad@sni-usa.com	| Abt. STO-XS 113	   | Riemekestrasse   |
| !USA: mollers.pad@sni.de	| Phone: (+49) 5251 835124 | D-4790 Paderborn |
From: ldh@svl.cdc.com (Lawrence D. Hare)
Newsgroups: comp.unix.programmer
Subject: Registering/acquiring well known port number.
Date: 13 Oct 92 18:19:27 GMT
Organization: Control Data Systems
X-UserAgent: Nuntius v1.1.1d9
X-XXMessage-ID: <A700611158010456@ethelred.svl.cdc.com>
X-XXDate: Tue, 13 Oct 92 11:18:41 GMT

Is anyone familiar with the process required to obtain a well-known-port
number for a product. We have a networking product, part of which is a
server, that establishes a passive connect on a well-known-port. How do I
select a free port? I presume I contact the NIC, but can I do it
electronically (eMail), is there a list of currently assigned port
numbers and I choose, is there an agency that assigns a number?

Any help will be appreciated.
--
Lawrence D. Hare       Control Data - Silicon Valley Operations
Consultant             Voice: (408) 496 4339 - C/N [234] 4339
ldh@svl.cdc.com        Mail: SVLa60  FAX: (408) 496-4106
Newsgroups: comp.unix.programmer,comp.programming
From: bosullvn@unix1.tcd.ie (Bryan O'Sullivan)
Subject: Re: THREAD PROGRAMMING REF
Organization: Department of Computer Science, Trinity College, Dublin, Ireland
Date: Thu, 15 Oct 1992 21:00:44 GMT

dbrillha@dave.mis.semi.harris.com (Dave Brillhart) writes:

>Where can I get a good *practical* book on C programming using
>threads?

I am unaware of any book specifically on thread implementations
using C, but for more general information, you might want to take
a look at Tanenbaum's "Modern Operating Systems" or (I think)
Larson's "Systems Programming Using Modula-3".  The former goes
into a reasonable level of detail on threads and other areas of
concurrency and distribution, and the latter has a very good chapter
on the practical issues associated with writing threaded applications.

	-- Bryan
--
Bryan O'Sullivan                                         bosullvn@unix1.tcd.ie
Department of Computer Science          "We don't want to go back to tomorrow;
University of Dublin                                   we want to go forward."
From: ahalim@ics.uci.edu
Subject: (none)
Date: 14 Oct 92 18:47:52 GMT
Newsgroups: comp.unix.programmer

Is 'write' atomic ?

I am writing a program that forks several processes, and they
do 'write' on the same file descriptor at the same time. Do we
need some kind of lock for mutex or is write itself already atomic so
that we don't have to worry about implementing lock?

Thanks
/aha
Newsgroups: comp.unix.programmer
From: ritter@CS.MsState.EDU (Tom Ritter)
Subject: Re: Any Good Book(s) about [Advance] "C" on Uni
Reply-To: ritter@CS.MsState.EDU
Organization: Mississippi State Univ., CS Dept.
Date: Wed, 14 Oct 1992 13:58:36 GMT


Two offhand:    "C: An Advanced Introduction" by Narain Gehani
		ISBN: 0888-2096

		This book is just what the title says.  If your not comfortable
		with the first example program, ( comma operator, #defs etc...)
		you better not delve in farther. 

		"Topics in C Programming" Kochan & Wood
		ISBN: 0-471-53404-8

		Second in a great series, the first is the intro., this book
		STARTS at stuctures and pointers and moves on to real 
		Unix stuff pretty quick...

		

Newsgroups: comp.unix.programmer
From: brandy@tramp.Colorado.EDU (BRANDAUER CARL M)
Subject: Re: stdout vs stderr (was Re: Should I use syslog?)
Organization: University of Colorado, Boulder
Date: Sun, 11 Oct 1992 20:14:35 GMT

In any reasonable implementation stdout is buffered and stderr is not.
From: buzz@toxicavenger.bear.com (Buzz Moschetti)
Newsgroups: comp.unix.programmer
Subject: Re: Signal Question
Date: 9 Oct 92 17:58:50 GMT
Reply-To: buzz@fsrg.bear.com (Buzz Moschetti)
Organization: Bear, Stearns & Co. Inc.
In-reply-to: ssurgui@ucdacm.denver.colorado.edu's message of 8 Oct 92 23:55:17 GMT

In article <4007@copper.Denver.Colorado.EDU> ssurgui@ucdacm.denver.colorado.edu (Scott Surguine) writes:

	[...deleted...]

       #define SIG_IGN  (int(*)())1

       Is this A pointer to function of type integer that returns a value of
       1?  Can't be...   or can it?  Curious how signal actually works.

Normally you call signal() to install your own handler for a particular
sig:
	int myhandler();
	signal(SIG_TERM, myhandler);

myhandler() will end up having some non-zero address value, e.g. 0x0243421.
If you want to ignore a signal, you call:

	signal(SIG_TERM, SIG_IGN);

which, without all the casting to satisfy lint, evals to

	signal(15, 1);

The idea here is that the address of any handler you supply will *not* be
0x1; in a sense it's a reserved address.
Newsgroups: comp.unix.programmer
From: robert@charon.jpl.nasa.gov (Robert Angelino)
Subject: Makefile Help needed...
Reply-To: robert@triton.Jpl.Nasa.Gov
Organization: Jet Propulsion Laboratory, Pasadena CA
Date: Mon, 12 Oct 1992 19:10:31 GMT

I'm trying to create a makefile that creates a static library that
is dependent on source files that reside in a SCCS directory.  I'm
trying to make it so that make gets the c source, compiles it, and
adds it to the library.	

I have so far failed miserably.  If someone out there has a sample makefile
in which I can go by, I would greatly appreciate it..

thanks


-robert
Newsgroups: comp.unix.programmer,comp.unix.sys5.r4