HDTenEightyP/NetNews huggingface dataset:
From: ezras@sco.COM (Ezra Steinberg)
Subject: Re: ISC VP/ix Question(s)
Organization: The Santa Cruz Operation, Inc.
Date: Wed, 29 Jul 1992 20:43:52 GMT
Summary: DOS-under-UNIX  
Keywords: ISC Unix VP/ix


In article <BrGHIn.IMn@ernest.dseg.ti.com> alan@ernest.dseg.ti.com (Alan Edmonds) writes:
>In article <1992Jul13.195308.21397@access.digex.com> jcraig@access.digex.com (Joseph N. Craig) writes:
>>We have been somewhat disappointed to discover that VP/ix that comes with
>>ISC Unix emulates 286 class machines.  We have some software that requires
>>386 machines.
>
>I believe most DOS-under-Unix products (Merge,VP/ix,etc.) all are
>80286 style emulators.  I think they work by using the virtual-8086 mode
>of the 386, where you create a virtual 8086 processor.  If this is true,
>you won't find any DOS-under-Unix 386 style SW.  In fact, if you do allow
>access to real/protected mode under DOS app, it could (would) easily
>crash Unix.  

If the 80386 cpu is being used to create virtual 8086s (i.e. running
programs only in real mode), then programs designed to run on 80286
cpus or better (i.e. in protected) mode will not be able to run with
one of these emulators.  Currently, I believe all popular emulators
use the virtual 8086 method; hence, only real-mode programs can be run.

Ezra Steinberg
Newsgroups: comp.unix.msdos
From: leisner@trianguli (Marty Leisner 311/? x?)
Subject: Re: not on the FAQ
Reply-To: leisner.henr801c@xerox.com
Organization: Xerox
X-Newsreader: Tin 1.1 PL4
Date: Tue, 21 Jul 1992 18:55:14 GMT

holmes@gorilla.nbn.com (Tim Holmes) writes:
: So are there any alternatives to VP/IX?  VP/IX is an SCO product, correct?
: I was hoping there might be some type of "GNUish" free implementation
: of a DOS emulator.
: 
: Didn't find any of this stuff in the FAQ, so if anybody's out there,
: please fill me in.
: 
: 
: ==========================================================================
: Tim Holmes             holmes@gorilla.nbn.com             San Rafael, CA
: --------------------------------------------------------------------------
: 

I'm currently writting a Dos emulator (like softpc) to add to GNU.. I currently have a lot of work to do

I've used SoftPC and wasn't impressed.

I do know a good optimizing compiler will be able to optimize the hell out of the emulator (it should be able to stick everything inline...)

VP/IX on a sun386i I found rather good...there's an emulator for Linux and I may look into what it takes to get an emulator going on 386BSD...


--
marty
leisner.henr801c@xerox.com  
Member of the League for Programming Freedom
Newsgroups: comp.unix.programmer
From: ksc@cbnewsk.cb.att.com (kenneth.s.cobler)
Subject: Re: Shared Memory and Semaphores
Organization: AT&T
Distribution: usa
Date: Fri, 24 Jul 1992 20:28:41 GMT

In article <1992Jul23.155158.8075@gvl.unisys.com> rickt@gvls1.gvl.unisys.com (Rick Thompson) writes:
>
>Hello,
>
>  I have a couple questions regaurding shared memory and semaphores.
>
>  1)  I've created a shared memory area using shmget and my processes
>      can communicate correctly.  However, it is possible for any one of
>      the processes to remove the partion even though the others are still
>      using it.  The processes are all running under the same user so any
>      process has permission to remove it.  Is there a way to prevent the
>      removal if the memory is still in use?

	When a process requests IPC_RMID, the actual shared memory is not
	released until no other process is attached to it.  So, you
	are not in jeopardy of deleting an in-use shared memory segment.
	However, if you do request a segment to be removed, no new
	process can attach itself to the old shared memory.
>
>  2)  I need the ability to lock out a portion of shared memory in
>      some critical regions of the code.  Is it possible using semget and
>      semctl to do this?  Again, the processes using the shared memory are
>      running under the same user.
>
	You could use a semaphore.  The critical code section
	waits for the semaphore to be released, 
	sets the semaphore, performs its operation, and then
	releases the semaphore.  Use the lock semaphore
	technique for all access to shared memory.  This will
	ensure only one process performs its function upon shared
	memory at a time.
	
	Note: watch out for race conditions.
	
	
Kenneth Cobler		ksc@cbnewsk.att.com or ken@ihlpm.att.com
AT&T Bell Laboratories	attmail!cbnewsk!ksc or attmail!ihlpm!ken
2000 N. Naperville Rd.
Naperville, IL  60566
Newsgroups: comp.unix.programmer
From: les@chinet.chi.il.us (Leslie Mikesell)
Subject: Re: Named pipes
Organization: Chinet - Public Access UNIX
Date: Tue, 28 Jul 1992 19:46:27 GMT

In article <1992Jul27.221133.27847@mintaka.lcs.mit.edu> mycroft@hal.gnu.ai.mit.edu (Charles Hannum) writes:
>
>> mknod testpipe p
>> cat testpipe &
>> ls > testpipe
>> The "cat" process ends after the ls is sent to the screen.

>This is the way named pipes have worked since The Dawn of Time.  If you
>want to have multiple processes write to the pipe, you need the reader
>to reopen it.  In the shell, you could do something like this:
>(while :;do cat testpipe;done)&

Cat just happens to be written to exit when it hits EOF.  So, either
prevent it from seeing EOF by holding the write side open with an
unused fd:
  cat testpipe 4>testpipe &
or use a process that doesn't exit at EOF.  Just be sure it sleeps
a while between reads when there is no input.  A shell script that
periodically reads a control fifo makes a handy server:
do
 read A B
 ..process control command (if any) ..
 ..do some work...
done < fifo

You just have to start it in the background and throw it a real or
dummy command command to unblock its open on the fifo, then you
can "echo command argument > fifo"  manually or from other programs
to control it.  (Try that with sockets...).  If you want it to
wait for each command, open for write also ( done <fifo 4>fifo) 
otherwise the reads are non-blocking after the fifo has been
opened and closed by a writer.

Les Mikesell
  les@chinet.chi.il.us
Newsgroups: comp.unix.programmer
From: etxmesa@eos.ericsson.se (Michael Salmon)
Subject: Re: expanding ~'s in a directory name.
Reply-To: etxmesa@eos.ericsson.se (Michael Salmon)
Organization: Ericsson Telecom AB
Date: Thu, 30 Jul 1992 09:00:03 GMT

In article <1992Jul29.012629.14000@gucis.cit.gu.edu.au>, 
aroll@gucis.cit.gu.edu.au (Ashley Roll) writes:
|> I have a program that I'm writing in C in the UNIX environment and I have come
|> to a part where I need to get a directory name that the program will change 
|> into. 
|> 
|> My problem is how do I expand ~'s. I want to expand then the way that csh does.
|> 
|> Has anyone written or got code that will do this that I can use? Or is there
|> a library function that will do this.

This is what xrn uses:

char *
utTildeExpand(filename)
char *filename;    /* file name, possibly with a '~'             */
/*
 * tilde expand a file name
 *
 *   returns: the expanded name of the file (in a static buffer)
 *            or NIL(char) 
 */
{
#ifdef aiws
    static char dummy[MAXPATH];
#else
    static char dummy[MAXPATHLEN];
#endif /* aiws */
    char username[USER_NAME_SIZE], *loc;
    struct passwd *pw;
    
    if ((filename == NIL(char)) || STREQ(filename, "")) {
        return(NIL(char));
    }

    if (filename[0] != '~') {
        (void) strcpy(dummy, filename);
        return(dummy);
    }

    /* tilde at the beginning now */
    if (filename[1] == '/') {
        /* current user */
        char *home, *getenv _ARGUMENTS((const char *));

        if ((home = getenv("HOME")) == NIL(char)) {
#ifndef VMS
            /* fall back on /etc/passwd */
            if ((pw = getpwuid(getuid())) == NIL(struct passwd)) {
                return(NIL(char));
            }
            (void) sprintf(dummy, "%s%s", pw->pw_dir, &filename[1]);
#else
            return (NIL(char));
#endif
        } else {
            (void) sprintf(dummy, "%s%s", home, &filename[1]);
        }
            
    } else {
        if ((loc = index(filename, '/')) == NIL(char)) {
            /* error - bad filename */
            return(NIL(char));
        }
        (void) strncpy(username, &filename[1], loc - &filename[1]);
        username[loc - &filename[1]] = '\0';
#ifndef VMS
        if ((pw = getpwnam(username)) == NIL(struct passwd)) {
            return(NIL(char));
        }
        (void) sprintf(dummy, "%s%s", pw->pw_dir, loc);
#else
        return(getenv("USER"));
#endif
    }
    return(dummy);
}

-- 

Michael Salmon

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

Ericsson Telecom AB
Stockholm
Newsgroups: comp.unix.programmer,comp.unix.wizards,comp.unix.internals
From: ksc@cbnewsk.cb.att.com (kenneth.s.cobler)
Subject: Re: FAQ - keyboard input
Organization: AT&T
Distribution: usa
Date: Fri, 24 Jul 1992 20:36:36 GMT

In article <sprice.920723122640@eng.auburn.edu> sprice@eng.auburn.edu (Shannon W. Price) writes:
>
>	The three types of input are :
>
>		A single enter (e.g. Press enter to continue...)
Possible solution:
	use getchar() to wait for enter key
	
>		A single character (e.g. a menu selection)
	use getchar() with termio set to return when at least 1 keystroke
	
>		A character string that may have imbedded blanks
	use gets() to get a string
	

Kenneth Cobler		ksc@cbnewsk.att.com or ken@ihlpm.att.com
AT&T Bell Laboratories	attmail!cbnewsk!ksc or attmail!ihlpm!ken
2000 N. Naperville Rd.
Naperville, IL  60566
Newsgroups: comp.unix.programmer
From: dwthoma1@eos.ncsu.edu (DAVID W THOMAS)
Subject: is there an unbind() command for sockets
Originator: dwthoma1@c00041-118dan.eos.ncsu.edu
Reply-To: dwthoma1@eos.ncsu.edu (DAVID W THOMAS)
Organization: North Carolina State University, Project Eos
Date: Mon, 27 Jul 1992 18:09:50 GMT



Once a process is listening to a socket, is there anyway to
shutdown the socket and allow a new process to listen to the socket?
(without killing the process and all of it's children)?

In more detail:

I would like to be able to perform software upgrades to a batch server.
I want to kill the server, install the new program, and execute it.
However, the server might have batch jobs running, and I wish to leave
them intact, but as 'child processes' of the original batch server, they
cause the error message "internet domain bind: Address already in use" when
I try to restart a new server.

Is there any way to prevent children processes (created with fork/execl)
from inheriting open/bound sockets?

Is there any way to shutdown/unbind in the original server and children, so
that the new server can bind to the same address?  (If the answer is
"shutdown()" then I used it incorrectly, and an example would be appreciated).

I don't think that I want to use "setsockopt(... SO_REUSEADDR)" because then
ANY other process would be able to bind to the port.  Plus, I tried
this, and could not get it to work.  I need to see an example 
of how to use "setsockopt" if this is the answer.

David W. Thomas
dwthoma1@eos.ncsu.edu
Newsgroups: comp.unix.programmer
From: dominic@scooter.genie.uottawa.ca (Dominic Richens)
Subject: Re: File locking question
Originator: dominic@
Reply-To: dominic@shamin.genie.uottawa.ca
Organization: MCRLab - University of Ottawa
Date: Thu, 30 Jul 92 18:30:06 GMT


In article <1992Jul30.125226.16473@dragon.acadiau.ca>, alan@dragon.acadiau.ca (Alan McKay) writes:
! 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
Yes, if the locking is advisory.  

! 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?
No.

You want `lockf', which, depending on the mode of the file, will
give you an advisory lock that will work over NFS.  Look at the man page
for lockf(3/S) for specifics.  Also you might want to browse lockd(8C/NADM),
and chmod(2/S). 

dominic
-- 
!@$^&*)($#$@!@#$^&*()_+_)(*&^$#@!$^&*()_+)(*&^$#@$^&*+_(*&^$#@#^&*()&*$#@(*&+_$!
 Dominic Richens  :  dominic@shamin.genie.uottawa.ca  :  Tel. (613) 564 9911 
      MCRLab, Dept of Elec Eng, University of Ottawa, K1N 6N5, CANADA   
"You construct intricate rituals which allow you to touch the skin of other men"
From: graham@maths.su.oz.au (Graham Matthews)
Subject: Re: help with unexec
Organization: Sydney University Computing Service, Sydney, NSW, Australia
Date: Tue, 28 Jul 1992 08:30:26 GMT

(David Nicodemus) writes:
>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. 
>
>If anyone has anyone has information on finding this value, or on the
>whole idea in general any help would be much appreciated.

I would be most interested in this too - can people post replies
rather than email them.

Thanks

graham
--
Graham Matthews                 And it's true we are immune
Pure Math, Uni.Sydney, Oz       When fact is fiction and T.V. is reality
graham@maths.su.oz.au
From: quanstro@lars.StOlaf.edu (goon)
Newsgroups: comp.unix.programmer
Subject: Re: Bidirectional Pipes
Date: 21 Jul 92 18:20:27 GMT
	<5380@dsacg3.dsac.dla.mil> <1992Jul21.034220.22775@latcs1.lat.oz.au>
Organization: St. Olaf College, Northfield, MN USA

In article <1992Jul21.034220.22775@latcs1.lat.oz.au> wongm@latcs2.lat.oz.au (M.C Wong) writes:


   Hi, in Steven's Unix Network Programming, he suggests the use of
   socketpair() system call to create a pair of unnamed bi-directional
   stream socket. That book is a fantastic one, and I got it from erading
   the news and some helpful people on the net ! Thanks!


This is all cool, but not every version of unix supports this call.
(For example, any non-BSD-related Unix)
Newsgroups: comp.unix.programmer,comp.unix.questions,comp.unix.wizards,comp.sys.sun.misc
From: bzs@ussr.std.com (Barry Shein)
Subject: Re: Need help with socket problem on Sun
Organization: The World
Date: Thu, 30 Jul 1992 05:45:52 GMT


>  Note the crazy write to the console, inside the '#ifdef FOO' section: 
>If we do not include it, it takes us 25 seconds to transfer 500kBytes; 
>if we do write to the console, it takes only 5 seconds!  

that's remarkable, i'd like to see the answer to this one.

--
        -Barry Shein

Software Tool & Die    | bzs@world.std.com          | uunet!world!bzs
Purveyors to the Trade | Voice: 617-739-0202        | Login: 617-739-WRLD
Newsgroups: comp.unix.programmer
From: drt@brolga.cc.uq.oz.au (David Taylor)
Subject: Re: MAKE Question - am I asking too much?
Keywords: MAKE HELP 
Organization: Prentice Centre, University of Queensland
Date: Tue, 21 Jul 1992 23:06:28 GMT


mun@corp.hp.com (Duane T. Mun) writes:

>> - checkout any files that are needed to satisfy the make.
>$(HDRS) $(SRCS):	# Check out sources and headers as needed
>	co $@
Thank you for this one...works well.

>> - pre-compile the C/SQL files.
>> - compile the C files
>test.o: dclgen.h	# set up dependancies
Shouldn't this also be dependant on test.c (or test.sc) ?

>.c.o:			# how to make .o from .c
>	$(CC) $(CFLAGS) -c $< $(INCDIRS)
>
>.sc.o: 			# how to make .o from .sc
>	$(CPP) -C -P $< > $*.cpp	# get dclgen stuff
>	$(ESQLC) $*.cpp
>	$(CC) $(CFLAGS) -c $*.c $(INCDIRS)
>	rm -f $*.cpp $*.c
I have almost exactly this but it fails under one circumstance:
- If the .c file is still around from the last compile, it will not
  prep the .sc. This happens if the $(CC) fails because it will then
  miss the rm -f $*.c. It is a pain to remove these by hand every time
  the compile fails.

I'm not sure why it does this, but it looks to me like it hits the 
.c.o target instead of the .sc.o target. I think I'm wrong here
because swapping there order in the makefile makes no difference.
I have a suspicion that the problem lies with the program targets.

Any more ideas?
--
D.T
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
Distribution: comp
Date: Thu, 23 Jul 1992 08:29:22 GMT

In article <1992Jul23.013154.22987@ccu1.aukuni.ac.nz>, 
ecmtwhk@ccu1.aukuni.ac.nz (Thomas Koenig) writes:
|> ajg@controls.ccd.harris.com (Arnold Goldberg) writes:
|> 
|> >We here have a very large source tree.
|> 
|> >What I'm looking for is a script or utility that will somehow tell
|> >me which #include files are not actually needed for a source file.
|> 
|> Gcc (or rather, gcc's preprocessor) has the -M flag which will generate
|> makefile dependencies for the specified source files; check out the manpage
|> for your C compiler to see wether it also supports it.
|> -- 
|> Thomas Koenig, ecmtwhk@ccu1.aukuni.ac.nz, ib09@rz.uni-karlsruhe.de
|> The joy of engineering is to find a straight line on a double logarithmic
|> diagram.

If I interpret Arnold correctly he wants a program that checks which
include files are used rather than those that are included, there is a
subtle difference.

-- 

Michael Salmon

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

Ericsson Telecom AB
Stockholm
Newsgroups: comp.unix.programmer
From: Tom Christiansen <tchrist@convex.COM>
Subject: Re: named pipes (was: Finger and .plan, .project)
Originator: tchrist@pixel.convex.com
Keywords: named pipes, fopen, popen, .plan, .profile, .signature
Reply-To: tchrist@convex.COM (Tom Christiansen)
Organization: CONVEX Realtime Development, Colorado Springs, CO
Date: Mon, 27 Jul 1992 14:13:31 GMT
X-Disclaimer: This message was written by a user at CONVEX Computer
              Corp. The opinions expressed are those of the user and
              not necessarily those of CONVEX.


Matthias Urlichs writes:

> End of file. You'd have to wait for both tail processes to finish before you
> could start the diff

How come?  Can't I start as soon as there's something there, even in the
case of a file?

> You could probably create the temp files, mandatory-lock them, and then 
> exec the tail processes. If the diff waits for the lock correctly (that's why
> the lock has to be mandatory) you have a workable lockout.

Ah, I see -- you have to be able to know when the file is all done with.

> Or their .signature. ;-)

Moi? :-)

> Ugh. I'd include almost every development tool. Or take cp for instance --
> do you still want to be able to copy executable files?  ;-)

Yes, I'm not happy with it happening ALWAYS.  I think either a mode on 
the file (or type) or else an explicit open that way "[rw]x" would be 
better.

> If you happen to be one of the fretful minority who can do creative work,
> never force an idea; you'll abort it if you do. Be patient and you'll give
> birth to it when the time is ripe. Learn to wait.
>                 -- Lazarus Long

ah thanks; (cat; echo %%) >> ~/News/SIGNATURES

--tom

-- 
    Tom Christiansen      tchrist@convex.com      convex!tchrist

    "* Unix is a footnote of AT&T Bell Laboratories."
                             --Barry Shein
From: wongm@latcs2.lat.oz.au (M.C Wong)
Newsgroups: comp.unix.programmer
Subject: Re: Bidirectional Pipes
Date: 21 Jul 92 03:42:20 GMT
Organization: Comp Sci, La Trobe Uni, Australia

In article <5380@dsacg3.dsac.dla.mil> nto0302@dsacg3.dsac.dla.mil (Bob Fisher) writes:
>From article <1992Jul13.175933.26213@dragon.acadiau.ca>, by 890025d@dragon.acadiau.ca (Andy DeWolfe):
>> Can anyone provide examples/references/information on setting up
>> bidirectional pipes using "C"/Unix?
>
>A pipe only works in one direction on our system.  I got around this
>by creating two pipes - one for output and the other for input.
>-- 
>Bob Fisher
>EMAIL:    bfisher@dsac.dla.mil          osu-cis!dsacg1!bfisher
>VOICE:    Commercial 1-614-692-9071	Autovon 850-9071
>USPS:     Defense Logistics Agency, DSAC-TOL, Box 1605, Columbus OH 43216-5002


Hi, in Steven's Unix Network Programming, he suggests the use of
socketpair() system call to create a pair of unnamed bi-directional
stream socket. That book is a fantastic one, and I got it from erading
the news and some helpful people on the net ! Thanks!

- wongm@latcs1.lat.oz.au
Newsgroups: comp.unix.programmer
From: Tom Christiansen <tchrist@convex.COM>
Subject: Re: Better way to count files in dirs
Originator: tchrist@pixel.convex.com
Reply-To: tchrist@convex.COM (Tom Christiansen)
Organization: CONVEX Realtime Development, Colorado Springs, CO
Date: Mon, 27 Jul 1992 16:04:10 GMT
X-Disclaimer: This message was written by a user at CONVEX Computer
              Corp. The opinions expressed are those of the user and
              not necessarily those of CONVEX.

From the keyboard of bjg28027@uxa.cso.uiuc.edu (Skydive!):
:Hello,
:
:I'm modifying some code that I've written in C previously and would like to try
:to improve on it.  Right now, in order to determine the number of files
:in a directory I am doing a system call "ls -1 | wc -l > tmp" and then opening
:the file and fscanf the number.  Obviously this is a very ugly way to do
:this and I would like to improve it.
:
:Are there some functions in <dirents> library that I am missing?

RTFM readdir, opendir, etc.

--tom
-- 
    Tom Christiansen      tchrist@convex.com      convex!tchrist
    If you have ever seen the grim word "login:" on a screen, your mind
    is now a wholly-owned subsidiary of The Death Star.
                John Woods in <14105@ksr.com> of comp.unix.bsd
Newsgroups: comp.unix.programmer
From: bcschu@skws02.monsanto.com (Brett Schultz)
Subject: Re: Better way to find out the number of lines in a file
Organization: Monsanto Company
Date: Fri, 31 Jul 1992 12:45:07 GMT

tlg@uknet.ac.uk (Tim.Goodwin) writes:
: In article <5412@ucsbcsl.ucsb.edu> 6500mack@ucsbuxa.ucsb.edu (Michael P. Mack) writes:
: >Somebody has done it.  On our system (HPUX 8.0) we have a command
: >called 'wc' which counts the lines, words, and characters in a file.
: 
: If you're only interested in the number of lines,
: 
:     grep -c '^'
: 
: is, on my system at least, much faster than
: 
:     wc -l
: 
: (That's GNU grep, of course.  It even seems to go faster than a naive
I was thinking of the way to count from a C program.  I was just thinking
there may be some sort of trick (via some system call or something) to do
this other than using something like:

  system("wc -l file > tmp");

  Then read the number from the tmp file.

I guess the best way (from a C program with out using the above) would be
to read the file into a buffer using fread and then count the number of 
newline chars.


Thanks for everyone's input

--Brett
Newsgroups: comp.unix.programmer