HDTenEightyP/NetNews huggingface dataset:
From: bill@Celestial.COM (Bill Campbell)
Newsgroups: comp.unix.programmer
Subject: Re: moving directories from file sys to file sys
Date: 26 Sep 92 17:08:49 GMT
Organization: Celestial Software, Mercer Island, WA

In <1992Sep25.152034.1697@maths.tcd.ie> tim@maths.tcd.ie (Timothy Murphy) writes:

:mccalld@vax.sonoma.edu writes:

:>   I remember a script receintly posted which allows one to move entire
:>directories from one file system to another.....
:>could someone repost! thanks ahead of time

:Would that be the old tar standby,

:cd fromdir; tar cvf - . | (cd todir; tar xvf -)

This is in every man page I've seen for tar.

Or with cpio:
	cd fromdir; find . -depth -print | cpio -pdumva todir

Add options to cpio to your taste, particularly l to link where
possible.

Bill
-- 
INTERNET:  bill@Celestial.COM   Bill Campbell; Celestial Software
UUCP:   ...!thebes!camco!bill   6641 East Mercer Way
             uunet!camco!bill   Mercer Island, WA 98040; (206) 947-5591
SPEED COSTS MONEY -- HOW FAST DO YOU WANT TO GO?
Newsgroups: comp.unix.programmer
From: cmlow@iti.gov.sg (Low Chee Meng (KSL))
Subject: Help needed -- Reading/writing serial ports
Keywords: serial port, unix, RS232
Organization: Information Technology Institute, National Computer Board, S'pore
Date: Mon, 5 Oct 1992 12:27:00 GMT

Hi,

I need to write a program (on a Sun Sparcstation) that would read and write
ascii characters from/to the workstation's RS232 port. So far, I have
been unable to find any reference manual that can describe how to do it
in a simple enough way. The man pages for TERMIO and ZS seems too
complicated for me to grasp, and there were no examples to follow.

Can someone recommend a good book or a good source where I can get 
a quick intro to serial port programming on Unix? Example code would
be most useful.

Thanks in advance,

C.M. Low

PS: Please email replies to cmlow@iti.gov.sg
-- 
Chee-Meng Low (cmlow@iti.gov.sg)
Knowledge Systems Lab
Information Technology Institute
Singapore
From: quandt@mcs213c.cs.umr.edu (Brian Quandt)
Newsgroups: comp.unix.programmer
Subject: function documentation
Date: 5 Oct 92 21:59:00 GMT
Organization: University of Missouri - Rolla

I am responsible for setting up the coding environment for a project that
I'm envolved in.  

What I'd like to do is define a proceudure that when a (C) programmer
writes a new function there has to be a formatted header that 
precedes this function.  This header is then stripped out by a 
an awk or sed macro and then reformated to create a manual page
entry.  Any suggestions on what this header should look like?  It 
I don't think it should be a raw nroff format since it is then difficult
to read in the original C file.  I'd also like to keep it simple, i.e.,
things like WEB are probably an overkill for this type of development.
Lastly, does anyone one have a macro and format to accomplish the
previous?  Any other suggestions and feedback are always welcome.

Here's an example:
/*
	NAME: function

	SYNOPSIS:
		function(int,int,int...)

	DESCRIPTION:
		blah blah blah

	OTHER HEADERS
		like input output, database usage, etc...

*/
function(int x, int y, ...)
	{
	}

					Thanks
						Brian quandt
Newsgroups: comp.unix.programmer
From: jmp@moscom.com (Joe Palumbos)
Newsgroups: comp.unix.programmer
Subject: Question about Internet Services
Date: 6 Oct 92 17:16:00 GMT
Organization: Moscom Corp., Pittsford NY
X-Newsreader: Tin 1.1 PL5

When you bind to a port using Internet protocol, and specify zero as
your port-number in your local address, the system will assign you an
unused port (between 1024 - 5000).  The port-number is not filled in
in the address structure, however.  

Is there a function that will return an unused port-number, or allow
you to find out which port-number was assigned as described above?

Thanks,

-- 
Joe Palumbos	jmp@moscom.com		{rit,tropix,ur-valhalla}!moscom!jmp
Newsgroups: comp.unix.programmer
From: rmf@chopin.cs.columbia.edu (Robert M. Fuhrer)
Subject: Re: Library linking on Unix + Question
Organization: Computer Science Dept., Columbia Univ.
	<1992Oct2.002252.9401@nas.nasa.gov>
Date: Fri, 2 Oct 1992 16:07:35 GMT

I believe if you look at many Unix systems' packaging of the C standard library
routines (via "nm(1)"), for instance, you'll notice that many routines were
originally in their own source files, and therefore ended up in separate object
files. Since "most linkers" link at the granularity of object files, this has
the effect you want; i.e., that only the routines you use are linked in.

Unfortunately, this depends on each routine residing in its own source file.
Not so nice from a modularity perspective... Oh well...
--

-- Bob
Newsgroups: comp.unix.programmer
From: s8923098@macnab.mqcs.mq.oz.au (Josef WIDJAJA)
Subject: non-blocking I/O lib and lightweight processes.
Organization: Macquarie University, School of Mathematics, Physics, Computing and Electronics
Date: Wed, 7 Oct 1992 03:26:52 GMT

Can someone explain how I can use non-blocking I/O
in a program that creates lightwight processes?
(I am using SunOS)

Do I only need to specify a special option
when compiling? Or do I need to do something
inside the code?

For example, I might have have a code that looks
something like this


....

main()

{
...
create thread1;
...  /* do something */
}

thread1()
{
    while(1)
        read(fd, dat, nbytes);
}


If I compile this in the usual way, thread1 might run and prevent 
main() from progressing further because thread1 spends its time
blocking when it tries to read. I want to have main and thread1
running concurrently; when one will block, the other thread will
get the chance to run (just like heavywight processes 
created by fork()).

I am new to this lightweight stuff, so please explain
clearly.

Also, can someone explain what a non blocking socket is?

 
--
 _________Josef Widjaja____________  
|  s8923098@mackay.mpce.mq.edu.au  |
|  Macquarie University, Australia | 
|__________________________________| 
Newsgroups: comp.unix.programmer
From: ggorden@techbook.com (Greg Gorden)
Subject: TCP/IP broken socket question
Organization: TECHbooks --- Public Access UNIX --- (503) 220-0636
Date: Tue, 6 Oct 1992 21:39:52 GMT


I've read in the past in this group where you should not use the 
"keepalive" method to determine a broken TCP/IP socket, but instead
should use a "select" for a read.  If the read returns a length of 0
the socket has been broken.

Using C programs I set up a socket (SOCK_STREAM) between two PS/2s running    
AIX 1.21.  I had the programs exchanges a message to verify that the
connection was good.  Then both programs sat on a select waiting for a
read.  If I killed either program, as anticipated the other program fell
off of the select to do a read with a return length of 0.  However, if
I disturbed the token ring connection either by physically removing
the token ring cable or by disabling the interface with a "ifconfig tk0
down" command, both programs continue to wait on the select.  Is this a 
bug or am I missing a parameter that would allow my select to recognize
the lost connection?

The application I am working on needs to know when any machine in the
lan is no longer available, no matter what the reason.  Each machine
sends out frequent broadcast messages.  If a machine doesn't receive a 
broadcast message within a specific timeframe, it marks that machine as
unavailable until it receives a broadcast message from it.  Although this 
works, it is a bit cpu intensive with all of the messages.   I was hoping 
the "select" would solve this problem, but it doesn't look like it will.  

Thanks in advance for any suggestions on how to solve my problem either by
using the select or another methodology.

Barbara Schlichting
Consolidated Freightways
-- 
ggorden@techbook.COM  Public Access User --- Not affiliated with TECHbooks
Public Access UNIX and Internet at (503) 644-8135 (1200/2400, N81)
Newsgroups: comp.unix.programmer,comp.unix.questions
From: gibanez@cecux1.cec.uchile.cl (IBANEZ CORVALAN GABRIEL ANTONIO)
Subject: HELP !! (again)
Originator: gibanez@cecux1
Date: Mon, 05 Oct 1992 16:44:17 GMT
Organization: Centro de Computacion, Universidad de Chile


Hi, 

   I made a program for using finger server, and
my need is to know who is connected in what WorkStation
or X-terminals.

   First, I create child processes that they will query
for the information that I need. And they read the utmp file
for that. Then, in order to obtain what my processes CHILD did,
I use a pipe and I read from them using a select() call.
But I have problems with it:
    - sometimes it is fine, and its performance is high.
    - sometimes my program is stoped for long time and
      I must kill it.

  Do you know what is the real problem ???
  Perhaps, the pipe() is not realiable and I must
 to use a socket ????
  I work in Ultrix system Release 4.1  :-)
  I hope your help.

Gabriel.
gibanez@cecux1.cec.uchile.cl

PS: I use a timeval of NULL, that is, I wait until a write
( from my childs ) is made. Then, I read.


Newsgroups: comp.unix.programmer
From: golovch@phoenix.rose.utoronto.ca (Gene Golovchinsky)
Subject: client/server architecture
Summary: Need to establish bidirectional communication between two machines
Keywords: client server NFS RPC MacTCP
Organization: University of Toronto, Department of Industrial Engineering
Date: Mon, 5 Oct 1992 13:29:04 GMT

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 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. 

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,comp.windows.x
From: schwartz@roke.cs.psu.edu (Scott Schwartz)
Subject: Re: Help needed writing a simple Imakefile
	<1992Sep29.055002.28144@mel.dit.csiro.au>
Date: Wed, 30 Sep 1992 02:03:04 GMT

Researchers working on mutation testing, take note.  Imake is a highly
effective tool for generating errors.
From: jmc@hopi.eel.ufl.edu (Jim Callahan)
Newsgroups: comp.unix.programmer
Subject: "remsh" Hangs my Program!
Date: 28 Sep 92 17:56:51 GMT
Organization: University of Florida

I am trying to execute a process on a remote machine from inside a C program.  I am using a the "fork - exec - wait" C functions to execute the equivalent of:

remsh machine_name -n command arg1 arg2 ... argN &

This seems to hang the MAIN PROGRAM as well as the WORK PROGRAM which makes the "exec" call and I get a "suspended tty input" error message.  Can someone explain what is going on here?  I temporarily replaced the fork/exec pairs with a "system" function call and it works fine.  The diagram below might help explain the relationship of processes and calls.


MAIN PROGRAM
 fork() ------------------>  exec "WORK PROGRAM"                           
 event_loop()...           WORK PROGRAM
                           fork() 1 -------------------> exec() "remsh 1 ... " 
                           fork() 2 -------------------> exec() "remsh 2 ... " 
                           fork() 3 -------------------> exec() "remsh 3 ... " 
                           fork() N -------------------> exec() "remsh N ... " 
                           wait() 1
                           wait() 2
                           wait() 3
                           wait() N
                           
	 	           final actions ...

                           exit()

						

Please e-mail your reply or Post to this group.	
Thanks for the help....

						-Jim
From: Kari.Hurtta@Helsinki.FI (Kari E. Hurtta)
Newsgroups: comp.unix.programmer
Subject: Re: what is a socket file?
Date: 4 Oct 92 12:02:33 GMT
	<QINYI.92Oct2221023@r6i.uk.ac.man.cs>
Organization: Department of Computer Science, University of Helsinki, Finland

In article <QINYI.92Oct2221023@r6i.uk.ac.man.cs> qinyi@uk.ac.man.cs (Yi Qin (BCW PhD)) wrote:
> 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?

Answer depends what filesystem is used. RFS (Remote File Systems) interpretes 
magic files in locally. So answer is no, if unix domain socket is in RFS 
filesystem.

- K E H
( Kari.Hurtta@Helsinki.FI,
  hurtta@cc.Helsinki.FI,
  hurtta@cs.Helsinki.FI,
  HURTTA@FINUH.BITNET
)
Newsgroups: comp.unix.programmer
From: pererik@cmi.no (Per-Erik Nordbo)
Subject: Truncating the file without closing the file.
Organization: Chr. Michelsen Institute
Date: Mon, 28 Sep 92 11:48:40 GMT

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?

--
Per Erik Nordboe, Christian Michelsen Research, Norway pererik@cmr.no
Newsgroups: comp.unix.programmer
From: hunt@dg-rtp.rtp.dg.com (Greg Hunt)
Subject: Re: Truncating the file without closing the file.
Date: Mon, 28 Sep 92 16:43:37 GMT
Reply-To: hunt@dg-rtp.rtp.dg.com
Organization: Data General Corp., Research Triangle Park, NC

In article <1992Sep28.114840.9707@alf.uib.no>, 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 are the truncate() and ftruncate() calls that will truncate a
file to a specified length.  The blocks are freed immediately in the
file systems I know about.

Enjoy!

-- 
Greg Hunt                            email: hunt@dg-rtp.rtp.dg.com
DG/UX Core Development
Data General Corporation
Research Triangle Park, NC, USA      These opinions are mine, not DG's.
Newsgroups: comp.unix.programmer
From: assela@marcus.its.rpi.edu (A. Andre Asselin)
Subject: is there a coff spec available?
Keywords: coff manual
Date: Mon, 28 Sep 1992 07:54:24 GMT

I'm looking for documentation on the COFF file format.  Does anybody know
where I could find any info. on it?  Thanks.....
        - Andre Asselin      (assela@rpi.edu)
From: basile@soleilserma.cea.fr (Basile STARYNKEVITCH)
Newsgroups: comp.unix.programmer
Subject: Re: Library linking on Unix + Question
Keywords: SunOS shared libs
Date: 6 Oct 92 17:04:43 GMT
Reply-To: basile@soleil.serma.cea.fr (Basile STARYNKEVITCH)
Organization: Commissariat a l Energie Atomique

In article <1992Oct2.002252.9401@nas.nasa.gov>, mcnab@dinsdale.nas.nasa.gov (David McNab) writes:
|> In article <1992Oct1.171348.29897@jarvis.csri.toronto.edu>, jwang@white.toronto.edu (Jingwen Wang) writes:
|> > 
|> >     We developped a library for distribute applications in unix environment.
|> > The library is quite big in size. A typical application may only need to
|> > use a couple of calls of the library. 
|> > 
*** skipped ***
|> 
|> If your OS provides shared libraries you may want to use them.
|> That will keep your executable small, at least until you actually
|> execute it.
|> 
|> Which brings up my question.  The SunOS 4.1.1 man page for `ld'
|> [quoted without permission] says this:
|> 
|>     "When ld.so is given control on program startup, it finds all
|>      .so  files  specified  when the program was constructed (and
|>      all .so's on which they depend), and  loads  them  into  the
|>      address  space."
|> 
|> Does ld.so really load the entire shared library file into memory,
|> or does it also only load the code for unresolved references?
|> 

On SunOS4 & SunOS5, shared objects are mmap(2)-ed by the dynamic
linker.  So only used code pages are paged-in by the virtual memory
subsystem.

As for cross-library references, they are usually lazily resolved, ie
resolved at first call. More precisely, on SunOS5 and SVR4, a call into
a shared lib's routine is a call into the procedure linkage table.
This PLT is a writable data; it is actually a table of calls.
Initially, each entry calls the dynamic linker, with a register %g1
identifying the call. This dynamic linker replaces this current PLT
entry by a call to the routine actually called. There is an option in
SunOS5 for resolving all references at start time (ie before entering
main, or before returning from dlopen).

However, please note that data references is allways done at start
time, and not lazily (with a major difference between SunOS4 which have
.sa files and SunOS5 or SVR4 which put data segments into shared
objects)

This stuff is explained in
AT&T System V Application Binary Interface Sparc Supplement

Unix Press, Prentice Hall, 1990
ISBN 0-13-877630-X

-- 
Basile STARYNKEVITCH
Commissariat a l Energie Atomique
DRN/DMT/SERMA * C.E. Saclay bat.470 * 91191 GIF/YVETTE CEDEX * France
fax: (33) 1- 69.08.23.81;    phone: (33) 1- 69.08.40.66
email: basile@soleil.serma.cea.fr;  homephone: (33) 1- 46.65.45.53
N.B. Any opinions expressed here are solely mine, and not of my organization.
N.B. Les opinions exprimees ici me sont personnelles et n engagent pas le CEA.
From: lu@m2c.org (Thomas Lu)
Newsgroups: comp.unix.programmer
Subject: "&" sign and DEC C compiler
Date: 5 Oct 92 18:00:08 GMT
Organization: Massacusetts Microelectronics Center, Westboro, Ma.


   Greeting:

     I don't know this real a programming problem or a compiler problem. 
     Please help !

     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.

     Here is the part of the program which got complained by 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); )

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

Thomas Lu
Massachusetts Microelectronics Center : Internet: lu@m2c.org
75 North Drive                        : Phone: (508) 870-0312 x245
Westboro, MA. 01581                   : FAX: (508)898-2275
From: elliott@veronica.cs.wisc.edu (James Elliott)
Newsgroups: comp.unix.programmer
Subject: Looking for source for instrumented malloc()
Summary: My heap is getting scrambled; my Ultrix seems to lack malloc debugging
Keywords: malloc_debug
Date: 6 Oct 92 20:16:10 GMT
Article-I.D.: cs.elliott.718402570
Organization: U of Wisconsin Madison - Computer Sciences

Does anyone have source to a version of the malloc library that
supports debugging (i.e. heap integrity checking after each allocation
and free, and on demand at other times)? The malloc available to me in
Ultrix seems to lack these features, and they would be very helpful to
me in tracking down a bug that has manifested itself in code I'm
working on.

I will be trying to follow this group for a while to look for answers,
but sending a copy of your response to me via email would be greatly
appreciated.

-- 
Jim Elliott----------------------------------------elliott@cs.wisc.edu
 "There is perhaps no phenomenon which contains so much destructive
  feeling as moral indignation, which permits envy or hate to be acted
  out under the guise of virtue."  -- Erich Fromm
Newsgroups: comp.unix.programmer
From: Josef Moellers <mollers.pad@sni.de>
Subject: Re: what is a socket file?
Date: Thu, 1 Oct 1992 07:10:27 GMT
Organization: Siemens Nixdorf Info.Sys. AG, Paderborn, Germany

In <9209301641.AA16925@annapurna.wbst147.xerox.com> leisner@eso.mc.xerox.com (Marty Leisner) writes:


>Socket files have the = magic charecter in ls appended to it.

>I'm running on a Sparcstation with SunOS 4.1.x, and the man page for stat(2)
>talks about:
> #define    S_IFSOCK       0140000  /* socket */

>What is this, how do I make one and what do I use it for?

It's the file system entry that's created for an AF_UNIX type socket.

You don't want to!

Nothing!

B-{)

Serious:
When You create a "socket", You must specify the address family You want
to use. This information is later used to interpret the "network
address" given in the "bind" or "connect" calls.
You also have to specify a protocl family to use, but as there is
usually a 1:1 correspondence between address family and protocol family,
that is of no real interest.

"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]

If You use AF_UNIX sockets and adhere to a strict naming convention, You
might be able to use the path names to advertise the availability of
certain services.
-- 
| 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 |
Newsgroups: comp.unix.programmer
From: jrpg8255@uxa.cso.uiuc.edu (Jeremy Payne )
Subject: doing listen() on a socket with a timeout
Summary: what's the best way to give up on a listen() call
Organization: University of Illinois at Urbana
Date: Thu, 1 Oct 1992 22:13:11 GMT
Keywords: listen() socket

First off thanks for all the replies to my question about sockets.  Now I've
got several independent X clients passing data around over sockets using 
calls via the Xserver to ask a server for data etc in response to things 
like exposure events.  The problem is X requests are a bit slow, and if several
(~3) events requiring service happen more or less simultaneously the listen()
call on the server gets stuck and blocks.  Is there a simple way to use 
something like select() to make a timeout loop instead of using listen()?  
Currently a client decides it needs service, flags the server and tries to 
connect until it either succedes or times-out.  The server (which does other 
stuff too so can't be sitting around just waiting to accept connections) then 
starts a listen() call, and finally accepts().  I guess the problem is, being a
socket novice, that the clients are much faster at asking for service this way 
than the server is capable of providing it, and I wouldn't mind just ignoring 
excess requests if it prevented the server from blocking for more than a short
time on a listen.

Thanks in advance,


---------------------------
Jeremy Payne
UIUC Neuroscience program /
College of Medicine
jrpayne@uiuc.edu
(217)244-4478
---------------------------

(in response to earlier replies I know this could at the moment be done better
with pipes or socketpairs, but down the road I can't count on nice parent/
child relationships -- suggestions helped though :-) )

Newsgroups: comp.unix.programmer