HDTenEightyP/NetNews huggingface dataset:
From: zpope@osf.org (William Pope)
Subject: Re: named pipes (was: Finger and .plan, .project)
Reply-To: zpope@osf.org
Organization: Open Software Foundation
	<1992Jul29.150454.2133@novatel.cuc.ab.ca> <13815@auspex-gw.auspex.com>
Date: 31 Jul 92 15:55:57


In article <13815@auspex-gw.auspex.com> guy@Auspex.COM (Guy Harris) writes:

>>:     ln -s ~/.plan /plans/$USER
>>
>>Wow... Another good idea that Domain/OS has had for years...
>>
>>It does away with things like "5bin, 5usr" etc... you can have
>>/bsd4.3/[bin, usr, etc] and /sys5.3/[bin, usr, etc] and then you
>>can "ln -s /usr /'($SYSTYPE)'/usr"...
>
>Except that in at least one system with "5bin" and the like, "5bin" is
>*not* a complete set of System V versions of programs; it's just a set
>of programs where the SV and BSD versions couldn't be (or weren't)
>merged into one common version.  In that system, there's no notion that
>you have two completely separate BSD and SV universes, with a brick wall
>between them - a notion that seems to be dying off, and frankly, *I*
>sure as hell won't miss it....

Agreed.  Not that there was a brick wall between the two in Doman/OS.  A sys
admin could set it up that way if they chose to but in practice not that
many people did.

>The general "object-oriented" file system in Aegis seemed like a nice
>idea (not having used it, I've no idea what problems it had in
>practice), though.

Was nice if a little hard to program to (IMHO).

Now if this DFS would just catch on maybe I could work out an alias for "//"
	:^) 

=bill

--
============================================================================
William Z. Pope                                     Phone: +1 (617) 621-8889 
Open Software Foundation                              Fax: +1 (617) 621-0584
11 Cambridge Center                                     Email: zpope@osf.org
Cambridge, MA  02142                             OSF DME Integration Project



Newsgroups: comp.unix.programmer,comp.unix.questions,comp.lang.c
From: etxmesa@eos.ericsson.se (Michael Salmon)
Subject: Re: #include file dependancies
Reply-To: etxmesa@eos.ericsson.se (Michael Salmon)
Organization: Ericsson Telecom AB
Date: Fri, 24 Jul 1992 07:20:20 GMT

In article <1992Jul23.212852.28935@cs.cornell.edu>,
ressler@cs.cornell.edu (Gene Ressler) writes:
|> >>>>>> On Wed, 22 Jul 1992 16:45:44 GMT, ajg@controls.ccd.harris.com
|> >>>>>> (Arnold Goldberg) said:
|> >
|> >    Arnold> What I'm looking for is a script or utility that will
|> >    Arnold> somehow tell me which #include files are not actually
|> >    Arnold> needed for a source file.
[...]
|> A more direct approach:
|> 
|> Write an awk script that omits the n'th #include from foo.c,
|> to create, say foo.<n>.c.
|> 
|> Write a shell script checkincludes so that `checkincludes foo.c' does this:
|> 
|> Compile foo.c to foo.o (without debug info), saving cc's warnings.
|> 
|> Run the awk script for n=1,2,...,(stop when it can't find an n'th include)
|> and apply cc to the result.  If cc completes on foo.<n>.c with the 
|> same warnings (by a `cmp') as for foo.c, and foo.<n>.o matches foo.o
|> (again by a `cmp'), then print `The <n>'th #include is not necessary.'
|> 
|> I'm sure you can see the possible problems and refinements.

I also thought of this approach but consider an include file that just
has prototypes. Strictly speaking this isn't required for successful
compilation but it is required for reliability and even perhaps for the
program to run.

-- 

Michael Salmon

#include	<standard.disclaimer>
#include	<witty.saying>
#include	<fancy.pseudo.graphics>

Ericsson Telecom AB
Stockholm
From: melennec@stna.dgac.fr (Ronan Melennec)
Newsgroups: comp.unix.programmer
Subject: strcoll(3) collating table installation.
Keywords: internationalisation, ANSI C.
Date: 29 Jul 92 15:42:49 GMT
Organization: Service Technique de la Navigation Aerienne, France

Hello,

I would like to know if someone (willing to share information)
already installed non trivial collating tables to be used by
strcoll(3) and strxfrm(3).

What I need is the ability to sort all ISO Latin 1 A's
(A, A-acute, A-grave, etc) before all B's.

I use either SunOS 4.1.1 or HP-UX 8.0 ; both feature the strcoll(3) and
strxfrm(3) function, but they behave like strcmp, whatever the
locale setting. Apparently, the only collating table they are able
to access is a `trivial' one, i.e. it maps every character to itself.

E-mail answers prefered.
Thank you very much in advance,
-- 
Ronan Melennec              | Service Technique de la Navigation Aerienne
+33 1 60 79 82 40           | Departement 7
melennec@stna7.stna.dgac.fr | 95, rue Henri Rochefort, 91025 EVRY CEDEX, FRANCE
Newsgroups: comp.unix.programmer
From: ross@augie.insci.com (ross andrus)
Subject: Re: I am stumped by this one!!!
Organization: Insci Incorporated
Distribution: usa
Date: Tue, 28 Jul 1992 18:52:59 GMT

In article <1992Jul27.134826.5592@cbfsb.cb.att.com> rajeev@cbnewsf.cb.att.com (rajeev.dolas) writes:
>In article <13744@auspex-gw.auspex.com> guy@Auspex.COM (Guy Harris) writes:
>>>>		cp_line = (char *)malloc(sizeof(strlen(pars_wbuf)));
>>>

  // stuff deleted

>>No, try it again with:
>>
>>>	cp_line = (char*)malloc(strlen(pars_wbuf) + 1);
>>

  // stuff deleted

>
>	I realize the error on sizeof instead of strlen() for malloc. But
>	I don't think that is the cause of SEGV error. If you look at my
>	original posting, you will notice that I am able to copy selected
>	characters to cp_line.

  Have you actually changed the code as Guy suggested and tried it? If not,
  you're only allocating sizeof(int) bytes for cp_line. If you ever try to
  put more than that many bytes there, you are almost guaranteed to hose
  your storage arena. After which the only thing between you and a core 
  file is time and execution flow - i.e. luck.

>	In my original code I wasn't even using the cp_line. I was reading
>	a char pointed to by *pbuf and was writing that to the file. I
>	got the SEGV error on the putc()!!! Now I am using fputs() to
>	write a string instead of a char and I get the same error on
>	fputs(). Also fputs(tmp_line,stdout) works fine while 
>	fputs(tmp_line,fp1) does not!!! That's what is driving me nuts.

  Hmm. You might comb the rest of your code for stepping-on-memory problems 
  similar to the above. What you've described certainly - has that feel to it. 
  I would probably not conclude that the library was busted.

  Good luck

  ross
-- 
+-----------------------------------------------------------------------------+
|  Ross Andrus  == ross@insci.com					      |
|  Clever Disclaimer.							      |
+-----------------------------------------------------------------------------+
Newsgroups: comp.unix.programmer
From: siebeck@infoac.rmi.de (Wolfgang Siebeck )
Subject: Re: I am stumped on this one!!!
Organization: RMI Net INFO.box Systems * Aachen * Hamburg * Flensburg
Date: Sat, 25 Jul 1992 16:54:51 GMT

bbobak@undergrad.math.waterloo.edu (Brad Bobak) writes:

>In article <1992Jul24.204944.18516@cbfsb.cb.att.com> rajeev@cbnewsf.cb.att.com (rajeev.dolas) writes:
>>
>>Hello all,
>>
>>		pbuf = pars_wbuf;
>>		cp_line = (char *)malloc(sizeof(strlen(pars_wbuf)));


> You're allocing the sizeof an int, which is likely four bytes.
> You also forgot to alloc space for the '\0'. Try it again with:

>	cp_line = (char*)malloc(sizeof(strlen(pars_wbuf) + 1));

or better:

	cp_line = (char*)malloc(strlen(pars_wbuf) + 1);


>>		strcpy(cp_line, "\0");
>>		tmp_line = cp_line;

-ws
--
siebeck@infoac.rmi.de (Wolfgang Siebeck)

Newsgroups: comp.unix.programmer
From: dnoble@jpl-devvax.jpl.nasa.gov (David Noble)
Subject: Re: Public Domain FTP Source based on BSD Sockets
Organization: Jet Propulsion Laboratory (NASA)
Date: Wed, 29 Jul 1992 17:15:44 GMT

In article <45821@shamash.cdc.com> ldh@svl.cdc.com (Lawrence D. Hare) writes:
>Does anyone know whether there exists public domain source code for FTP
>based on the BSD Socket Interface? Likewise for Telnet?

There is a ton of stuff like this at ftp.uu.net [137.39.1.9] under the
/packages/bsd-sources directory. The two subdirectories you want are:

	ftp.uu.net:/packages/bsd-sources/usr.bin/ftp
	ftp.uu.net:/packages/bsd-sources/usr.bin/telnet

You might also want to look at the RFCs that document the FTP and Telnet
protocols. They are located in the directroy

	ftp.uu.net:/inet/rfc

I think RFC #854 is the one that defines the simplest layer of Telnet, but
I don't know off the top of my head which RFC deals with FTP. I guess that's
why there's an index in the rfc directory :-) Happy hunting...

-- 
David Noble		    - RPI Computer & Systems Eng, class of '92 and 1/2
dnoble@ufo.jpl.nasa.gov	    - JPL Section 367 System Integration & Testing
dnoble@rdrc.rpi.edu         - Virtual Environment Group, RDRC/RPI
From: idf@cs.bham.ac.uk (Ian Fitchet)
Newsgroups: comp.unix.programmer
Subject: Re: named pipes (was: Finger and .plan, .project)
Date: 27 Jul 92 10:52:41 GMT
	<1992Jul26.165838.1278@news.eng.convex.com>
Followup-To: comp.unix.programmer
Organization: School of Computer Science, University of Birmingham


 Please excuse technical abberations, I'm still learning :-)

 On 26 Jul 92 16:58:38 GMT, Tom Christiansen wrote

Tom> Furthermore, I believe that under both Plan9 and SunOS that you can have a 
Tom> filesystem type that does the right thing, so if people did this:

Tom> ln -s ~/.plan /plans/$USER

Tom> Then have /plans be a special filesystem type that triggers invocation
Tom> of the right code.

 It doesn't strike me as being a particularly large step to modify the
code that catches /dev/* entries.  Devices are caught by the kernel
and the device driver is invoked, would it not be possible to flag a
file such that when it's opened a user process is invoked (a la inetd).

 How you do this is another matter, of course :-).  Perhaps
registering a table of file/proc pairs with a default for unregistered
ones?

--
Cheers,

	Ian

-------------------------------------------------------------------------------
Ian Fitchet     				      I.D.Fitchet@cs.bham.ac.uk
School of Computer Science
Univ. of Birmingham, UK, B15 2TT
Xref: sparky comp.unix.programmer:3971 comp.unix.questions:9507 gnu.misc.discuss:2569 gnu.gcc.help:1802 comp.unix.ultrix:5946
From: rjk@sawdust.sawmill.uucp
Newsgroups: comp.unix.programmer
Date: 16 Jul 92 09:39 MDT
Subject: Re: Bidirectional Pipes
Nf-ID: #R:1992Jul13.175933.26213@dragon.ac:1952253999:RJK.92Jul16093905@sawdust.sawmil:-328824565:001:989
Nf-From: sawdust.sawmill.uucp!rjk    Jul 16 09:39:00 1992


In article <1992Jul14.061826.11689@Unibase.SK.CA> roe@Unibase.SK.CA (Roe Peterson) writes:

   890025d@dragon.acadiau.ca (Andy DeWolfe) writes:

   >Can anyone provide examples/references/information on setting up
   >bidirectional pipes using "C"/Unix?

   Sorry, but there is no such beastie as a bi-directional pipe.  The
   pipe(2) system call will return two file descriptors, one open for
   write, and one open for read.  Have the reader close the write end, and
   the writer close the read end.

   You can't use pipe to communicate in both direction over one file
   descriptor.

Actually, all pipes under System V R4 are bidirectional.  From pipe(2):

"pipe creates an I/O mechanism called a pipe and returns two file
descriptors, fildes[0] and fildes[1].  The files associated with fildes[0]
and fildes[1] are streams and are both opened for reading and writing."
--
Rich Kuhns			{uunet,nstar}!sawmill!rjk
PO Box 6249
100 Sawmill Road
Lafayette, IN  47903
(317)477-6000 (days)

Newsgroups: comp.unix.programmer
From: avalon@coombs.anu.edu.au (Darren Reed)
Subject: Sorting technique..
Organization: Computer Services Centre, Australian National University
Date: 25 Jul 92 12:42:59 GMT

Recently a friend and I were doing some manual sorting of paper
documents.  We divided the heap in half ( :) and proceeded from there
using a variation on the insertion algorithm which was to not start
searching for the place to insert the new entry at the top, but rather
to start searching from where you last inserted an entry.

Does anyone know of any papers or other documentation on this type
of variation on the insertion sort and how it compares to normal
insertion sorts ?

thanks,
Darren.
Newsgroups: comp.unix.programmer
From: alan@dragon.acadiau.ca (Alan McKay)
Subject: File locking question
Organization: Acadia University
Date: Thu, 30 Jul 1992 12:52:26 GMT

Will file locking work properly on an NFS disk mounted on multiple
hosts?  I want to lock a file in the user's home directory so that
other active sessions cannot touch the file (yes, the other sessions
are checking the lock too).  However, other sessions could be on
any one of a number of machines, included Suns and a CDC4680.  Will
"flock"ing still work?
 ^^^^^
 ^^^^^
-- 
--
Alan W. McKay		| (902)542-2201.158	| Wolfville, N.S. Canada
alan@acadiau.ca		| Acadia University	| SUB Box 6008, B0P 1Z1
----------------------------------------- My Canada includes Quebec -----
Newsgroups: comp.unix.programmer
From: scairns@is.morgan.com
Subject: /tmp files
Organization: Morgan Stanley
Date: Fri, 31 Jul 1992 13:51:22 GMT


Is there a system call to randomly generate unique file names
in /tmp?  

Or alternatively, anyone have any code examples which do this?

I need to send output temporarily to a unique file in /tmp, do some
work with it and than discard it.

Thanks in advance.


Newsgroups: comp.unix.programmer
From: terry@npd.Novell.COM (Terry Lambert)
Subject: Re: register windows and setjmp/longjmp
Organization: Novell NPD -- Sandy, UT
Date: Tue, 28 Jul 1992 17:42:01 GMT

In article <2203@tivoli.UUCP> bjv@shasta.tivoli.com (Brian Vetter) writes:
>I am working on a program that creates its own lightweight threads (must manage
>the stacks).  To detect stack overflow, I am using the mprotect() system
>call to create a guard page at the end of the stack.  Instead of just dumping
>core when the stack overflows, I want to exit the failed thread (the others
>get to keep running).
>
>My idea is to use setjmp() at the beginning of each thread to provide a "place"
>to come back, and to call longjmp() from the bus error handler.  To do this,
>I have to have a separate signal stack (using sigstack() and sigvec()).
>
>The guard page works (I get my bus error), but I can't unwind the stack
>using longjmp().  I'm doing this on a Sun4 (ELC), and I suspect that there
>is some register window weirdness going on.
>
>The function calling setjmp gets control after the longjmp but it gets a
>bus error as soon as it returns to its caller.  The $i7 and $fp registers
>are foobar when the function calling setjmp() gets control.  I tried the
>#pragma unknown_control_flow for my function but it still doesn't get
>the correct $i7 and $fp.  (If I set them to their correct values by hand
>in the debugger, everything works ok).
>
>After disassembling the setjmp/longjmp code in the library, I'm wondering
>how they ever work with long stack depths with the register windows.
>
>Does anyone know what I'm doing incorrectly?  Or am I faced with a
>bug in SunOS (the rev. is 4.1.1)?

There is a techinical report on wuarchive.wustl.edu entitled
"Register Windows and User-Space Threads on the SPARC*"
by David Keppel.  It's number is #91-08-01.


It's available from FTP, or:

Department of Computer Science and Engineering
University of Washington
Seattle, Washington 98195



					Terry Lambert
					terry_lambert@gateway.novell.com
					terry@icarus.weber.edu
---
Disclaimer:  Any opinions in this posting are my own and not those of
my present or previous employers.
Newsgroups: comp.unix.programmer,comp.unix.questions
From: brandy@tramp.Colorado.EDU (BRANDAUER CARL M)
Subject: Re: Need (today's date + [1-7] days)
Keywords: date
Organization: University of Colorado, Boulder
Date: Wed, 29 Jul 1992 15:13:59 GMT

bernard@cpio1.UUCP (Bernard Fouche) writes:
[stuff deleted]

>There is also a hack : use TZ and set to a value a negative value if
>you want to go forward in time, a positive value if you want to go
>backward. For instance, assuming your TZ is GMT0, to go forward one
>day, try :

>$ date
>Mon Jul 27 23:41:44 WET 1992
>$ TZ=GMT-24 ; export TZ
>$ date
>Mon Jul 28 23:41:54 WET 1992
>$ 

>To go seven days forward, use GMT-(24*7), i.e. : GMT-168

Since the examples are using either sh or ksh, one can take advantage
of the little known but powerful keyword feature by writing:

	$ TZ=GMT-168 date

which will leave TZ unmodified except during the execution of the date
command.
Newsgroups: comp.unix.programmer,comp.unix.questions,gnu.misc.discuss,gnu.gcc.help,comp.unix.ultrix
From: dnicodem@cs.ulowell.edu (David Nicodemus)
Subject: help with unexec
Organization: University of Massachusetts at Lowell Computer Science
Date: Tue, 28 Jul 1992 01:49:55 GMT



I am looking for a way to force a program out of execution, and save an image
of the program that can be restarted from the same point at a later time. 

It appears that the gnu unexec() function from gnu emacs will do this; however,
the last parameter asks for a "starting address." 

	How can I find this "starting address" (which I want to be the
current point of execution)?  Is this even possible? I am trying to implement 
this on DECstation 5000's.

If anyone has anyone has information on finding this value, or on the
whole idea in general any help would be much appreciated.

			Thanks
				Dave


David Nicodemus 		
dnicodem@cs.ulowell.edu
dnicodem@duck.ulowell.edu
From: pd@x.co.uk (Paul Davey)
Newsgroups: comp.unix.programmer
Subject: Re: NAWK - ?Diff. printf output order when using a pipe.
Date: 28 Jul 92 13:11:39 GMT
	<1992Jul26.221156.12144@nsisrv.gsfc.nasa.gov>
Organization: IXI Ltd.

>>>>> On 26 Jul 92 22:11:56 GMT, merritt@climate.gsfc.nasa.gov (John H. Merritt) said:

John> In article <1992Jul26.033811.21614@nsisrv.gsfc.nasa.gov>, merritt@climate.gsfc.nasa.gov (John H. Merritt) writes:
John> |> Explain why the following 'nawk' program produces:
John> [ output deleted ]

John> Already there is misunderstanding about what I want in the way of answers.
John> I want a solution to getting the same output when seeing the output
John> at the terminal or redirecting it to a file.  
John> I WANT THE PIPE TO REMAIN.

Then your solution is to pipe everything through the pipe and it will
come out at the same time.  (Unfortunately you don't want to sort your
begin and end parts though.)

Your problem is illustrated here as a data flow diagram

	      BEGIN and END ----------> OUTPUT1
	    / 					\
data -> [awk] 					 > terminal output
	    \ MIDDLE --------> [cat] -> OUTPUT2 /

As soon as you have two processes (when awk forks the cat process as a
child) the branches get out of step.

Sort will take a long time to run as it has to read all its input
before starting to output. 


John> If there is something like 'fflush' in AWK, that would be great.

There isn't. Besides awk isn't producing the output of sort. 

John> So far 'close' was the closest thing I found, but the exact syntax eludes
John> me -- if it is the right thing at all.

That lets you close a file, but I don't think you can close a pipe.

I think you will have to settle for three lots of output, (BEGIN,
MIDDLE and END say) and join them together when the all processes have
exited.

Awk might exit before the cat or sort pipeline has however, so you
must move the pipe outside of awk.

Make your awk program do this

	BEGIN	do begin stuff > begin.tmp

	MIDDLE  do middle stuff to standard out 

	END 	do end stuff > end.tmp


Then run it like this

nawk -f awkfile  | sort > sort.tmp && cat begin.tmp sort.tmp end.tmp > finaloutput


John> -- 
John> \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
John> John H. Merritt --> merritt@climate.gsfc.nasa.gov
John> "I am generally intolerant of ignorance,
John> but I have made an exception in your case."




--
 Regards,			  pd@x.co.uk           IXI Ltd.
	Paul Davey		  pd@ixi.uucp          62-74 Burleigh St.
				  ...!uunet!ixi!pd     Cambridge,  U.K.
 "These _are_ interesting times"  +44 223 462 131      CB1  1OJ
From: andrew@cssc-woll.tansu.com.au (Andrew Zahra)
Newsgroups: comp.unix.programmer
Subject: keeping unix time synchronised
Summary: keeping unix time synchronised
Keywords: time synchronised
Date: 21 Jul 92 02:49:20 GMT
Organization: Customised Software Solutions Centre, Wollongong, Australia

Is there any simple way to keep the system time on a number of unix machines
in sync? Previously I used a script and the rdate command on sun workstations.

Now I have a number of ULTRIX workstations and want to do the same thing. 
Problem is that rdate doesn't seem to work the same way on the ULTRIX machines.

Anyone have any ideas?


Andrew Zahra				AARNET	andrew@cssc-woll.tansu.com.au
Telecom Australia
Customised Software
Solutions Centre

Phone:  +61 42 211111			Snail:	Telecom CSSC
Fax:	+61 42 291021			C/- Illawarra Technology Centre
					Locked Bag 8812
					South Coast Mail Centre
					NSW 2521
From: guy@Auspex.COM (Guy Harris)
Newsgroups: comp.unix.programmer
Subject: Re: I am stumped on this one!!!
Date: 26 Jul 92 02:14:54 GMT
Organization: Auspex Systems, Santa Clara

>>		cp_line = (char *)malloc(sizeof(strlen(pars_wbuf)));
>
> You're allocing the sizeof an int, which is likely four bytes.
> You also forgot to alloc space for the '\0'. Try it again with:
>
>	cp_line = (char*)malloc(sizeof(strlen(pars_wbuf) + 1));

No, try it again with:

>	cp_line = (char*)malloc(strlen(pars_wbuf) + 1);

because, as you noted, the "sizeof" doesn't belong there - it turns the
argument into the size of the result of "strlen", which isn't the length
of the string.

(Also, try not leaving every single line of the original posting in your
followup; it makes it rather hard to find the stuff that *doesn't* come
from the original posting....)
Xref: sparky comp.unix.programmer:3831 comp.unix.questions:9251
From: michael@xon.co.uk (Michael J Marshall)
Newsgroups: comp.unix.programmer,comp.unix.questions
Subject: Re: Need (today's date + [1-7] days)
Date: 21 Jul 92 08:47:21 GMT
Organization: X-ON Software - London, England
X-Newsreader: Tin 1.1 PL4

ltf@ncmicro.lonestar.org (Lance Franklin) writes:
: In article <1992Jul16.145836.15586@avalon.nwc.navy.mil> dejesus@archimedes.nwc.navy.mil (Francisco X DeJesus) writes:
: }I realize that date/time-related questions are common here, so no flames
: ...

Many UNIX/ANSI systems have an even easier way to calculate relative dates,
using the mktime() function:

time_t mktime( struct tm * );

First you get a starting date (easiest with time() and localtime()):

time_t now;
struct tm t1;

time(&now);
t1 = *localtime( &now );

To get the date say 9 days from now:

t1->tm_mday += 9;
mktime( &t1 );

mktime() will accept values 'out of range' in the fields and adjust them -
so it deals nicely if you add 9 days to 29 June (for example). It's clean,
it's elegant, and you don't have to deal with leap years, days in the
month, or any math at all.

Be careful if you subtract, though. SCO UNIX's mktime() is buggy when
dealing with negative values in the struct tm.

I hope this answers your questions.

Michael
= Michael John Marshall - michael@xon.co.uk = B0ftg+k-s(+)h-r-
=   X-ON Software - 21 Great Tower St, London EC3R 5AQ ENGLAND
=   H 071 281 7056 - W 071 522 0088
= Last night I played poker with a deck of Tarot cards -
= I got a full house and four people died - Steven Wright
Xref: sparky comp.unix.programmer:3973 comp.unix.questions:9510