HDTenEightyP/NetNews huggingface dataset:
From: jfoy@narcy.gao.dec.com (John Foy)
Subject: Re: Multiple listeners on same socket
Reply-To: jfoy@narcy.gao.dec.com (John Foy)
Organization: Digital Equipment Corporation
Date: Thu, 23 Jul 1992 08:41:08 GMT


In article <1992Jul22.034730.12159@menudo.uh.edu>, nagappa@menudo.uh.edu (Chaitanya Nagappa) writes:
|>From: nagappa@menudo.uh.edu (Chaitanya Nagappa)
|>Newsgroups: comp.unix.internals
|>Subject: Multiple listeners on same socket
|>
|>The following is posted for a friend of mine.
|>-C. Nagappa.
|>
|>==============================================================================
|>Howdy all,
|>I need something equivalent to a socket, but that more than one process
|>can listen on. This is for multiple consumers, and the output from the
|>server can be picked up by any one of the consumers. In the simplest
|>scenario, I have two processes doing a "listen" on the same socket,
|>and only one of these process is trigerred to establish the circuit.
|>Yes, I know neither BSD sockets or TLI can do this. What is then the
|>alternative? Do I have to create my own virtual device?
|>
|>Message queues & FIFOs are not a viable alternative, as the information
|>once placed cannot be ...
|>[...]
|>The problem of statically placing this using standard IPC methods such as
|>message queues, FIFOs or shared memory is that by the time my processes
|>get around to receiving the info. (worst case scenario) the call might
|>have been cleared. So I need a phased communication of the info.

I'm not sure what you mean by "phased communcation..."?

I'm not entirely familiar with select etc... (being more of a VMS'r) but have
you considered semaphores? e.g. the server pool waits on a counting semaphore
which is incremented by the 'dispatching' process (I think you refer to this as
the 'spawned' process)...? This way only available servers respond...


	jf
From: dtri@jerome.az.stratus.com (Dave Trinidad)
Newsgroups: comp.unix.internals
Subject: Re: SVR4/386 virtual memory info
Date: 22 Jul 92 19:44:52 GMT
Reply-To: dtri@jerome.az.stratus.com (Dave Trinidad)

In article <1992Jul18.181047.23311@netfs.dnd.ca> boucher@ncs.dnd.ca (R.  
Boucher) writes:
> 
> I'm looking for the declaration of a global array/structure called  
anoninfo.
> Anoninfo is of size 3 longs.  It is not defined in <sys/sysinfo.h> or
> any of the <sys/vm*.h> (or in any file within the /etc/conf or
> /usr/include subdirectories).  
> 
It's in the source tree in the uts/{cpu type}/vm directory in a header
file anon.h. Unless your a source code licensee you probably wont find
it referenced ...

BTW) This structure is used for EVERY anonymous virtual page whether this
page is on swap or actually resident in memory. It's main purpose is to
hold a reference count of the page so the last reference count on a multiply  
referenced copy-on-write page  can actually be tracked ...In particular this  
structure can be used to optimize the copy-on-write fork() ...


> Robert Boucher
> 
> (HOME/WORK) boucher@ncs.dnd.ca
> (WORK) ...!uunet!revcan!dcsem!252
> (HOME) ...!uunet!revcan!flatout!asimov!rob

---
*********************************************
David R. Trinidad			#include <disclaimer.h>
Stratus Computer Systems	(602) 852-3135
4455 East Camelback RD. #115A		UNIX is a way of life ...
Phoenix AZ. 85018
Internet:
david_trinidad@az.stratus.com	PHX Telecom CAC
		
********************************************		
Newsgroups: comp.unix.internals
From: lfoard@Turing.ORG (Lawrence C. Foard)
Subject: Re: AT&T vs. BSDI --> 4.3BSD-NET2 distribution requires AT&T license!!!
Keywords: AT&T 'Death Star' rises over BSDI's horizon [Tel. 1-800-800-4BSD
Organization: The Turing Project, Charlottesville Virginia.
Date: Wed, 22 Jul 1992 22:05:54 GMT

If any one is considering contributing to free OS projects please
consider Linux. Linux already has most of the functionality of BSD
and is much smaller. 

Take a look at comp.os.linux, or ftp tsx-11.mit.edu 
-- 
>>Unix/C Contract worker available 5 years C/unix work experience<<  ______
Available for Telecommuting/Travel and contracts on the T Line       \    /
in the Boston MA area. Send me e-mail for a copy of my Resume.        \  /
       -- VWIS 508-793-9568 (2400 baud), Linux support BBS.--          \/
Newsgroups: comp.unix.internals,comp.unix.sysv386
From: gemini@geminix.in-berlin.de (Uwe Doering)
Subject: Re: Installing asy driver twice?
Organization: Private UNIX Site
Date: Fri, 24 Jul 1992 07:14:56 GMT

root@candle.uucp (Bruce Momjian) writes:

>I am running AT&T 386 Unix SVr3.1 and want three COM ports. 
>Unfortunately, the asy driver only supports two ports.
>
>I have been able to modify the <sys/asy.h> file and the files in
>sdevice.d, node.d, and pack.d/asy/space.d and gotten three ports
>working, but it seems it causes subtle stty problems and the port gets
>opened exclusively, whether you want it that way or not. 
>
>I have tried FAS 2.08.0, but that panics the kernel when I run on an sxt
>device (which I do alot), and slows down the consoles repeat keys, both
>of which make me quite suspicious.  

I suggest that you try the current FAS release (2.09.1). If it still
crashes the machine then I don't know. FAS usually works under AT&T 386
UNIX.

    Uwe
-- 
Uwe Doering  |  INET : gemini@geminix.in-berlin.de
Berlin       |----------------------------------------------------------------
Germany      |  UUCP : ...!unido!fub!geminix.in-berlin.de!gemini
Newsgroups: comp.unix.internals,comp.unix.questions
From: gram@aim1.aztec.co.za (Graham Wheeler)
Subject: Termio ioctls panicking system! Help!
Organization: Aztec Information Management
Date: Fri, 24 Jul 1992 09:46:41 GMT

Hi all

I have a STREAMS module problem that I hope someone can help me with. I
have written some X.25 STREAMS device/modules which are working fine for
outgoing connections (via a Triple-X PAD pseudo-device). However, I am 
struggling with incoming connections. If I don't include any line discipline,
I get loads of messages warning about problems with job control, etc. I am
thus trying to get the ldterm line discipline module working as well, via
the autopush facility.

What happens now is that my pseudo-device gets the M_CTL message from 
ldterm, to which it replies with a M_DO_CANON (that is, it requests ldterm
to do all the termio processing as it doesn't do any itself). Shortly thereafter
I get a TCGETA ioctl (from uugetty) to which my device responds with a
ACK. Then the system panics.

My upper write put procedure looks like:

static int PADuwput(queue_t *q, mblk_t *mp) {
	struct PAD *PAD = (struct PAD *) q->q_ptr;
	switch (mp->b_datap->db_type) {

	case M_CTL: { /* Termio query from ldterm; see 12-7 */
		struct iocblk *iocp = (struct  iocblk *)mp->b_rptr;
		iocp->ioc_cmd = MC_DO_CANON;
		qreply(q,mp);
		break;
		}
	case M_IOCTL: {
		struct iocblk *iocp = (struct  iocblk *)mp->b_rptr;
		struct linkblk *linkp;
		int error = ENXIO;
		switch (iocp->ioc_cmd) {

		case I_PLINK:	...
		case I_PUNLINK: ...

		case TCSETA:
		case TCSETAW: /* Needs special processing; see 12-14 */
		case TCSETS:
		case TCSETSW:
		case TCSETSF:
		case TCSETAF:
		case TCGETA:
		case TCGETS:
		case TCSBRK: /* Needs special processing; see 12-14 */
		iocack:
			mp->b_datap->db_type = M_IOCACK;
			/*iocp->ioc_count = 0;*/
			break;
		default:
		iocnak:
			mp->b_datap->db_type = M_IOCNAK;
			iocp->ioc_error = error;
			break;
		}
		qreply(q,mp);
		break;
		}
	case M_FLUSH:	...
	case M_DATA:	...
	case M_BREAK:	...
	case M_PROTO:	...
	default:	...
	}
	return 0;
}

Does anyone know what I am doing wrong? Do I have to send the data in the
ioctl back with a COPY message? 

I usually have lots of cmn_err calls embedded in this code, and the last thing
I can see happening is the acknowledgement of the ioctl. I suspect that
ldterm wants some data back and is assuming it exists and causing some kind
of violation as a result, but I can't figure out from the STREAMS manual
what more I should be doing.

Any help will be much appreciated!

Thanks in advance
Graham

-- 
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: ts@cup.portal.com (Tim W Smith)
Newsgroups: comp.unix.internals
Subject: Re: AT&T vs. BSDI --> 4.3BSD-NET2 distribution requires AT&T li
Date: Fri, 24 Jul 92 04:45:07 PDT
Organization: The Portal System (TM)

The sky is falling!  The sky is falling!  Wolf!  Wolf!
From: wilson@cs.utexas.edu (Paul Wilson)
Newsgroups: comp.unix.internals
Subject: getrusage() in SunOS: minflt & majflt meaning (reversed?)
Date: 24 Jul 1992 22:05:13 -0500
Organization: CS Dept, University of Texas at Austin
NNTP-Posting-Host: estoril.cs.utexas.edu
Summary: what do ru_minflt & ru_majflt REALLY mean?
Keywords: confused replacement paging faults

I'm using getrusage in SunOS on a SPARC ELC and am getting some 
rather weird results.  It appears to me that the meanings of
ru_minflt and ru_majflt are reversed.  Then again I may be
crazy, and I'm sure a couple of other things about my application
aren't what I expect.

My guess about minflt and majflt is that they're using a
segmented FIFO queue approximation of LRU replacement, a la
Babaoglu and Ferrari, and that major faults are "real"
page faults that you'd normally think of as page faults,
i.e., you have to go to swap disk to service it.  Minor
faults (supposedly reflected in ru_minflt) are partly
an artifact of the replacement policy, because the system
access-protects your pages behind your back, now and then,
to see if you're still using them.  If you are, it unprotects
them and lets your program continue, without your program
knowing about it.

I believe that minor faults also include faults caused by
access protections set at the user level via mprotect(),
and handled with a user-specified handler set by signal().

I have two very similar programs, one of which stores data
in a file and faults it in using an access protection hack.
The other leaves very similar data in virtual memory, and
faults it in via the normal virtual memory faulting mechanism.
Before I run either of them, I evict their working sets from
memory and file caches by running a routine that just romps
through a bunch of garbage heap and file data.

When the former (file-based) program runs, it should get
ONLY lighweight (user-level) access faults, and possibly
some lightweight faults from the replacement policy.  The
disk activity is not done by the virtual memory system,
but by my access-protection handler which goes through
the file system.

When the other program runs, it should get mostly heavyweight
page faults, because it's faulting data in from swap space.

The problem is that when I run these programs, I get minflts
and majflts numbers that are the opposite of what I expect.
The program that bypasses the VM and goes through the
file system has lots of majflts and low minflts.

Does SunOS 4 have the meanings of those things reversed,
or do I completely misunderstand the those statistics,
or is my program in deep trouble?

Thanks prematurely for any assistance,

   Paul

-- 
| Paul R. Wilson                                    wilson@cs.utexas.edu      |
| U. of Texas Computer Sciences Dept.               voice: (512) 471-9555     |
| Taylor Hall 2.124, Austin, TX 78712-1188          fax:   (512) 471-8885     |
| "Inertia makes the world go 'round."                                        |
Newsgroups: comp.unix.internals
From: gram@aim1.aztec.co.za (Graham Wheeler)
Newsgroups: comp.unix.internals,comp.unix.questions
Subject: Re: Termio ioctls panicking system! Help!
Date: 30 Jul 92 14:20:19 GMT
Article-I.D.: aim1.gram.712506019
Organization: Aztec Information Management

gram@aim1.aztec.co.za (Graham Wheeler) writes:

>In the case when I allocated a termio structure myself in a message
>continuation block, I was still just filling this with zeros. Perhaps this
>is enough to kill a UNIX system; if so, that is quite disturbing. I will
>try this again and put in some more sensible values, particularly for the
>c_cflag field, and see what happens - it could well work.

Well, I'll be damned. I changed it so that I sent back all zeroes except for
c_cflag, which I set to B9600|CS8, and it works! (no more hung system).
I can hardly believe it after all this. Thanks Matthias!

Any UNIX gurus out there who can speculate why a return of 0 in c_cflag
hung the whole OS?

-- 
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: johnr@mendip.UUCP (John Redden)
Newsgroups: comp.unix.internals
Subject: extent based file systems
Keywords: file system extent
Date: 23 Jul 92 14:25:22 GMT
Organization: ICL North America, Irvine, CA 92718

Veritas makes a nice extent based file system mostly for SysV4 under vfs.
It does not "fsck", which I have long considered part feature and part bug.
It also has the same performance for most cases, as the BSD fast file system.

johnr@al.irv.icl.com
From: barmar@think.com (Barry Margolin)
Newsgroups: comp.unix.internals
Subject: Re: Problems with fsync(2) in SunOS
Keywords: fsync EACCES
Date: 31 Jul 92 16:28:36 GMT
Organization: Thinking Machines Corporation, Cambridge MA, USA
NNTP-Posting-Host: telecaster.think.com

In article <1089@krabat.marco.de> leo@krabat.marco.de (Matthias Pfaller) writes:
>main(argc, argv)
>int argc; char **argv;
>{
>	int fd;
>	char b[80];
>
>	if ((fd = open(argv[1], O_WRONLY|O_CREAT, 0666)) < 0) {
>		perror("open");
>		exit(1);
>	}
>
>	if (fchmod(fd, 0444))
>		perror("fchmod");
>
>	sprintf(b, "su root -c '/etc/chown bin %s'", argv[1]);
>	system(b);
>
>	if (write(fd, "hallo\n", 6) != 6)
>		perror("write");
>	if (fsync(fd))
>		perror("fsync");
>	if (close(fd))
>		perror("close");
>	exit(0);
>}

The error actually occurred because of the write(2).  But since writes are
buffered up in the kernel, you don't find out about the error until you
call fsync(2) or close(2).

This problem is due to the statelessness of NFS.  For UFS, access is only
checked when you open a file, and the allowable access modes are stored in
the process's file table; after that, you can change the file modes, change
the owner, even delete the file, and still write to the file.

The NFS protocol doesn't have the concept of an "open file"; each read or
write to the object is independent.  Therefore, the server checks access on
each operation.  In this case, when it received the WRITE request, it sees
that you don't have write access, and returns an error.

You may be wondering why the chown is necessary to demontrate this problem.
Well, there's a kludge that exists mainly because of programs that do a
fchmod(3) after they open a file.  If the write request comes from the
file's owner, the NFS server always permits it.  This isn't really a
security violation, since the owner has the ability to change the
permission if he wants to.  It generally doesn't cause problems because
most clients also do access checking when they open a file, so they'll
return an error from open(2) if you ask for write access when you don't
have it.
-- 
Barry Margolin
System Manager, Thinking Machines Corp.

barmar@think.com          {uunet,harvard}!think!barmar
From: edgar@DrWho.Stanford.EDU
Newsgroups: comp.unix.internals
Date: 18 Jul 92 02:32 MDT
Subject: Entering octal code at prompt
Nf-ID: #N:1992Jul17.223243.13253@morrow.st:-89894429:001:489
Nf-From: DrWho.Stanford.EDU!edgar    Jul 18 02:32:00 1992


How does one enter an octal code to a program that is doing a getchar?
Say I wanted to enter octal 247.  How does one do this from the keyboard?
This is on a DECstation 5000/25 running Ultrix 4.2A with csh.

I already tried comp.unix.questions but got no responses so I decided
to try this newsgroup.

Reply by email.

Thanks,

edgar
--
Edgar Holmann                       UUCP:   decwrl!nova!edgar@uunet.uu.net
edgar@Nova.stanford.edu             BITNET: edgar%Nova.stanford.edu@stanford

Xref: sparky comp.unix.internals:1574 comp.unix.sysv386:12218
From: root@candle.uucp (Bruce Momjian)
Newsgroups: comp.unix.internals,comp.unix.sysv386
Subject: Installing asy driver twice?
Date: 21 Jul 92 02:53:02 GMT
Organization: a consultant's basement
X-Newsreader: Tin 1.1 PL4

I am running AT&T 386 Unix SVr3.1 and want three COM ports. 
Unfortunately, the asy driver only supports two ports.

I have been able to modify the <sys/asy.h> file and the files in
sdevice.d, node.d, and pack.d/asy/space.d and gotten three ports
working, but it seems it causes subtle stty problems and the port gets
opened exclusively, whether you want it that way or not. 

I have tried FAS 2.08.0, but that panics the kernel when I run on an sxt
device (which I do alot), and slows down the consoles repeat keys, both
of which make me quite suspicious.  

I was wondering if there was a way to install the 'asy' Driver.o twice
under different names, and therefore solve my problem.  I figured if I
changed the prefix on all the external symbols, maybe it would work.
Any suggestions?

-- 
Bruce Momjian                      |  830 Blythe Avenue
root%candle.uucp@bts.com           |  Drexel Hill, Pennsylvania 19026 
                                   |  (215) 353-9879(w)  853-3000(h)
From: leo@krabat.marco.de (Matthias Pfaller)
Newsgroups: comp.unix.internals
Subject: Problems with fsync(2) in SunOS
Keywords: fsync EACCES
Date: 31 Jul 92 08:46:58 GMT
Organization: marco GmbH, D-8047 Karlsfeld

We have a network of three sun-machines (one of them with SunOS 4.1.2,
the other two with SunOS 4.1.1) and four SysVr3 machines (one 386-based,
three M68020-based). The filesystems are crossmounted with NFS.

We are using SCCS to maintain our sources.
We noticed that when one does a delta from a sun on a directory mounted
from a SysVr3 machine, the delta command fails with
"directory `.' unwritable"
also the directory IS writable.
using trace(1) we could identify the failing systemcall. It's "fsync(2)".

You can use the following small c-program to reproduce the problem.
Requirments:
You need root-access on your own machine.
You need root-access on the remote machine.
You must not be logged in as root or bin.

execute the command with:
tst remote-filesys/file

It is important that the chown that is done with a call to system(3)
succeeds. If your remote machine is a SysV machine you may insert
	if (fchown(1, 2, -1))
		perror("fchown");
instead of the call to system(3).

The fsync-call will fail with EACCES.
If you try the program on a local file, there will be no problem.
Has anyone a solution for our problem?

	Matthias Pfaller (leo @ marco.de)

#include <fcntl.h>

main(argc, argv)
int argc; char **argv;
{
	int fd;
	char b[80];

	if ((fd = open(argv[1], O_WRONLY|O_CREAT, 0666)) < 0) {
		perror("open");
		exit(1);
	}

	if (fchmod(fd, 0444))
		perror("fchmod");

	sprintf(b, "su root -c '/etc/chown bin %s'", argv[1]);
	system(b);

	if (write(fd, "hallo\n", 6) != 6)
		perror("write");
	if (fsync(fd))
		perror("fsync");
	if (close(fd))
		perror("close");
	exit(0);
}
From: wilson@cs.utexas.edu (Paul Wilson)
Newsgroups: comp.unix.internals
Subject: Re: getrusage() in SunOS: minflt & majflt meaning (reversed?)
Date: 25 Jul 1992 14:26:18 -0500
Organization: CS Dept, University of Texas at Austin
NNTP-Posting-Host: estoril.cs.utexas.edu
Summary: yup
Keywords: confused replacement paging faults

New development... we got one of the programs to run on a DECstation 5000,
and getrusage is reporting the opposite of what it does on Sun's.   So
I guess Sun does have maxflts and minflts backwards...?

-- 
| Paul R. Wilson                                    wilson@cs.utexas.edu      |
| U. of Texas Computer Sciences Dept.               voice: (512) 471-9555     |
| Taylor Hall 2.124, Austin, TX 78712-1188          fax:   (512) 471-8885     |
| "Inertia makes the world go 'round."                                        |
Xref: sparky comp.unix.internals:1630 comp.unix.programmer:4010
From: murphyn@rtsg.mot.com (Neal P. Murphy)
Subject: Re: Background processes and stdin
Organization: Motorola Inc., Cellular Infrastructure Group
Distribution: na
Date: Tue, 21 Jul 1992 22:20:39 GMT

rsaripa@saturn.cs.clemson.edu (Saripalli Ramakrishna) writes:

>	When a background process needs terminal input,it is stopped.
>	The message "Stopped " appears on the output.
>...
>	Now if the shell and the process both happen to need input from
>	"stdin",why does not the background process steal whatever I type
>	on the terminal and let the shell wait for input?.

Under sh (Bourne), this is precisely what happens. Under ksh and csh
and perhaps tcsh, backgroud processes that desire input are stopped,
because these shells have job control built in. Older SysV flavors
have shl - shell layers - effectively doing the same thing.

NPN
Xref: sparky comp.unix.internals:1573 comp.unix.programmer:3832
From: mueller@delta.fsu.edu (Frank Mueller)
Newsgroups: comp.unix.internals,comp.unix.programmer
Subject: How to measure context switches time? (Repost)
Date: 21 Jul 92 19:22:59 GMT
Followup-To: comp.unix.internals
Organization: Florida State University Computer Science

Hi there!

I'm trying to measure the context switch overhead of UNIX processes (SunOS 4.1).

I did something like this:

fork off a child,
lower the parent's priority (-> nice lavel)
child installs a signal handler
child suspends on sigpause
parent reads clock (before)
parent sends signal to child
child resumes
child executes signal handler which contains a call to read the clock (after)

The approximate time for the context switch is (after-before). But I am also
timing some operations which are not part of the context switch:
(a) the parent's sending of the signal
(b) the overhead of installing a signal handler for the child (_sigtramp etc.)

Does anyone know a more accurate way to measure the context switch time
between UNIX processes?

Please e-mail: mueller@cs.fsu.edu or post.

Frank
Newsgroups: comp.unix.internals
From: willr@.wedge.nt.com (Will Raymond)
Subject: PD Curses Supporting softkeys
Organization: Northern Telecom Inc., RTP, NC
Distribution: na
Date: Tue, 21 Jul 1992 16:54:01 GMT

Does anyone know of a public domain implementation of
curses supporting SysV type softkeys.

Thank-you.
Will
Newsgroups: comp.unix.internals,comp.unix.questions
From: gram@aim1.aztec.co.za (Graham Wheeler)
Subject: Re: Termio ioctls panicking system! Help!
Organization: Aztec Information Management
Date: Mon, 27 Jul 1992 15:47:48 GMT

With regard to my previous post, I havce stopped the panic. It seems that
getty does not allocate a buffer in TCGETA/TCGETS ioctls. If I allocate a 
buffer myself before ACKing the ioctl, no panic happens.

I still would like to know why ldterm passes these ioctls on after I send
it a DO_CANON message from my driver. Also, although the system no longer
panics, when I do an stty after logging in from a remote site I lose my
connection; it seems the shell dies and I get thrown out, as the disconnection
is not initiated by my driver. And without stty, ldterm is not much use.

So, any ldterm experts out there who can offer any advice? Else I will just
have to do termio handling myself. 8-(

-- 
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 
Newsgroups: comp.unix.internals