HDTenEightyP/NetNews huggingface dataset:
From: wang@saturn.sdsu.edu (Luqing Wang)
Subject: ??? about i-nodes and file system 
Organization: San Diego State University, College of Sciences
X-Newsreader: Tin 1.1 PL5
Date: Sat, 22 Aug 1992 16:37:08 GMT

Dear netters,

Right now I am worrking on a project which require to deal with a file's
disk block number directly. Is there any existing system calls which can
get a file inode structure, and the disk blocks allocated to a file?

I did this using ram i/o(treat disk as a file); First get the inode number 
of the file, then compute  the disk absolute address of the inode, then
read in the disk inode structrre. From the inode , one can easily find the 
disk block allocateion. However, this method has a deadly drawback, it
totally bypassed the unix file system, if the kernel has not write the 
recnet change of the file's inode information to disk, the program will 
get wrong infromation.

Any idea to get around this ?  Or is there a way to force the unix OS to
write all bufferd information(inodes information) to disk? I tried to use
sync from console, it does not work. Only thing I found worked so far is 
to shutdown the system, then reboot, this will force the system write most 
recent change to the disk. Obvious I can not do this in a program.

I am working SUN OS4.1

Any suggestionis highly appreciated.

Luqing



--
  .-.  ^^*^^        ;;;_         ||     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
 ( o )             ~~&_/~*       ||       San Diego State University
;.   &   \     _ *___~.~.~. ^ __ ||     Internet: wang@saturn.sdsu.edu
Y/  $$$  \&/  _-_-_- _-==- ***  - +++   ||||||||||||||||||||||||||||||| 
Newsgroups: comp.unix.internals
From: boyd@prl.dec.com (Boyd Roberts)
Subject: Re: cd-ing to a dir using a process, then staying there on exit.
Organization: Digital Equipment Corporation - Paris Research Laboratory
Date: Thu, 20 Aug 1992 19:08:26 GMT

If you're going to post any such pretense get the details right:

In article <1992Aug20.163507.4449@gateway.novell.com>, terry@thisbe.Eng.Sandy.Novell.COM (Terry Lambert) writes:
> 
> 5)	Get the locked vnode number for the process' cwd from the u struct.
> 

The [igv]node will most probably _not_ be locked, and the u-area
holds a pointer to it.

> 7)	To avoid having to reverse map the parent's cwd to a file name and
> 	to avoid dorking the reference count on the vnodes and locking up
> 	your file system, swap cwd's between the parent and the child
> 	process.  Do this by writing the childs vnode number into the
> 	parent's u struct, and the parent's into the childs.  This is the
> 	sneaky bit.

It's a _pointer_ and all of this will break for a variety of reasons.


Boyd Roberts			boyd@prl.dec.com

``When the going gets wierd, the weird turn pro...''
From: thomas@IRO.UMontreal.CA (Steve Thomas)
Newsgroups: comp.unix.internals
Subject: file locks
Summary: help with file locks
Keywords: lockf, mutual exclusion
Date: 21 Aug 92 19:07:34 GMT
Organization: Universite de Montreal

Could someone explain or provide an example
of how to properly use file locks.

I am aware that chmod +l file will allow
locks to be placed on a file and that
the function lockf will lock the file.

I would like to allow multiple processes
the ability to change the same record
(or separate records) in a file but
with mutual exclusion enforced.

Specifically I need the order of calls
to fopen, lockf et.

I would also like each process to get the
lateest (updated) copy of the file
once it is allowed access to the file.

thanks
Steve

--
internet: thomas@kovic.iro.umontreal.ca
Newsgroups: comp.unix.internals
From: ganesh@cs.albany.edu (Ganesh Murugesan)
Subject: Question on signals
Originator: ganesh@pascal.albany.edu
Organization: The University at Albany, Comp. Sci. Dept.
Date: Thu, 20 Aug 1992 15:36:46 GMT


Newsgroups: comp.unix.internals,comp.unix.sysv386
From: gpitcher@crash.cts.com (Glenn Pitcher)
Subject: SIGKILL problem with Interactive
Date: 14 Aug 92 12:48:46 PDT
Keywords: SIGKILL Interactive


We're running Interactive SVR3 here on an Edge 433/SE and I've been finding  
that sending a SIGKILL to a process doesn't always do as it advertises.

For instance, I have one job that is recycled each night.  It's first 
terminated by using 'kill -9 <pid>'.  Most of the time it works but last
night the job was in a infinate loop trying to kill this thing off.  Another
example is a little script that kills users off just before I perform a 
system backup at 0200.  Here I also use kill -9 (I know it's crude) and it
works... most of the time.

I have seen things like this happen before (such as with zombies under BSD)
but not to this extent.

Also, occasionally, my backup job (which is started by cron) simply sits
in the process queue sawing logs (asleep :-) ).  Nothing I do will wake it
up and I have absolutly no idea as to why my system is doing this.  I even
tried sending a SIGCONT but the kill command doesn't recognize it! Geezzz.

Can anyone (Sun, are you listening?) give me some input?

Thanks
Glenn Pitcher
Systems Administrator
United States Bankruptcy Court - Southern District of California
San Diego, CA

Newsgroups: comp.unix.internals,comp.unix.sysv386
From: cpcahil@virtech.uucp (Conor P. Cahill)
Subject: Re: SIGKILL problem with Interactive
Keywords: SIGKILL Interactive
Organization: Virtual Technologies Inc.
Date: Mon, 17 Aug 92 11:07:10 GMT

gpitcher@crash.cts.com (Glenn Pitcher) writes:


>For instance, I have one job that is recycled each night.  It's first 
>terminated by using 'kill -9 <pid>'.  Most of the time it works but last
>night the job was in a infinate loop trying to kill this thing off.  Another
>example is a little script that kills users off just before I perform a 
>system backup at 0200.  Here I also use kill -9 (I know it's crude) and it
>works... most of the time.

Most likely the jobs you can't kill are asleep within the kernel at too high
of a priority level to get woken up by a signal.  This can happen for several
reasons, but the most likely culprit is an i/o request to a device in which
the device driver put the program to sleep at an uninteruptable level.

This is easy to re-generate.  Just run "ls -lR /" and when the output 
starts, enter <Ctrl>-s.   After a few moments the output buffer will fill
and the program will be put to sleep pending the receipt of a ctrl-q.
At this point, signals are almost always disabled and if you send a kill -9,
the program will not die (although the signal will be delivered as soon as 
a ctrl-q is delivered from the terminal and the program will die then)

>Also, occasionally, my backup job (which is started by cron) simply sits
>in the process queue sawing logs (asleep :-) ).  Nothing I do will wake it
>up and I have absolutly no idea as to why my system is doing this.  I even

Perhaps a problem with the tape driver?

-- 
*** SENTINEL(tm) The ultimate Debugging Environment - email for more info ***

Conor P. Cahill              (703)430-9247            cpcahil@virtech.vti.com
Virtual Technologies, Inc.  46030 Manekin Plaza          Dulles, VA 21066 
Newsgroups: comp.unix.internals,comp.unix.programmer
From: root@candle.uucp (Bruce Momjian)
Subject: PD Streams pty implementation
Organization: a consultant's basement
Date: Wed, 19 Aug 1992 17:16:24 GMT
X-Newsreader: Tin 1.1 PL5

Does one exist?  

I just installed a PD non-streams pty implementation that works quite
well, but you can't poll() on the pty's, which can be a problem.  My
poll() only works on streams, and I have no select().

Is there another way?

I am running AT&T 386 Unix SVr3.1

-- 
Bruce Momjian                      |  830 Blythe Avenue
root%candle.uucp@bts.com           |  Drexel Hill, Pennsylvania 19026 
                                   |  (215) 353-9879(w)  853-3000(h)
Newsgroups: comp.unix.internals
From: rsaripa@venus.cs.clemson.edu (Saripalli Ramakrishna)
Subject: Socket to which related processes may read/write ?.
Organization: Clemson University Computer Science Dept.
Distribution: na
Date: Wed, 19 Aug 1992 22:53:24 GMT

Hi ,

	I would like to know if there is any way a socket can be established
	by some ancestor so that all of its descendants might be able to
	monitor the socket(channel) and be able to read/write from/to the
	socket.

	I am specifically interested in sockets because my program uses 
	recv() system calls(which I found very useful) and it works only 
	on sockets(Even socketpair() would not work).

	I want to use recv() system calls because I want to peek at the 
	incoming stream to retrieve the control information which always
	precedes the actual data .For instance,the control information
	contains the actual length(bytes) of the following message,the 
	identity of the sender and some other relevant information.
	
	Of course,the length of the control information is constant across
	all messages.the processes would do recv() on the socket ,peek
	at the incoming stream(MSG_PEEK option of recv()) and remove from
	the stream messages relevant to themselves.

	I need this info very much.I went through Rich Stevens "Network
	Programming in Unix" but I was not able to find the relevant info.

	I would appreciate anyone who could send me this info.I will post
	to the group if there is enough interest.

						Thanks in advance,
						Saripalli Ramakrishna

e-mail : rsaripa@cs.clemson.edu

Man is a beast and usually has no control over his passions.
From: bill@bailey.UUCP (Bill Glidden 882-8369)
Subject: Re: looking for a way to tell a machines current state.
Newsgroups: comp.unix.programmers,comp.unix.internals
Date: 15 Aug 92 05:03:07 GMT
Distribution: world
Organization: Ben Bailey's Home..Tampa Fl.

clarkc@IMD.Sterling.COM (Clark Cheney) writes:
> I am looking for an easy way to tell the State of a machine (single or 
> multiuser) from with in a process.
> 
> Does anyone now of a subroutine or system call or some file to check.  
> 

On some Unix systems, the "who -r" command shows the current run-level.
You can use this assuming you know the various run-levels and their
meanings on the system you use it on.
From: boyd@prl.dec.com (Boyd Roberts)
Newsgroups: comp.unix.internals
Subject: Re: cd-ing to a dir using a process, then staying there on exit.
Date: 20 Aug 92 13:52:48 GMT
Organization: Digital Equipment Corporation - Paris Research Laboratory

In article <BtA8CG.ME4@encore.com>, mpalmer@encore.com (Mike Palmer) writes:
> Can anyone suggest a way for a process to cd to a dir & stay there when the \
> process exits.
> 

Eh?  Just what is going to be where _after it exits_?


Boyd Roberts			boyd@prl.dec.com

``When the going gets wierd, the weird turn pro...''
Newsgroups: comp.unix.internals
From: terry@thisbe.Eng.Sandy.Novell.COM (Terry Lambert)
Subject: Re: cd-ing to a dir using a process, then staying there on exit.
Organization: Novell NPD -- Sandy, UT
Date: Thu, 20 Aug 1992 16:35:07 GMT

In article <BtA8CG.ME4@encore.com> mpalmer@encore.com (Mike Palmer) writes:
>Can anyone suggest a way for a process to cd to a dir & stay there when the \
>process exits.

I assume that what you mean is that you want the parent to have the childs
directory after the child exits...  sure!  It's easy!

1)	Inside the child process, use chdir() to change to the desired
	directory.

2)	Open up /dev/kmem, /dev/mem, and potentially /dev/swap.

3)	Find the proc struct for your process.

4)	Find the u struct associated with your process' proc struct.

5)	Get the locked vnode number for the process' cwd from the u struct.

6)	Repeat steps 3 through 5 for the parent process as well.

7)	To avoid having to reverse map the parent's cwd to a file name and
	to avoid dorking the reference count on the vnodes and locking up
	your file system, swap cwd's between the parent and the child
	process.  Do this by writing the childs vnode number into the
	parent's u struct, and the parent's into the childs.  This is the
	sneaky bit.

8)	Close /deb/kmem and anything else you had to have open to read
	and write the proc tables, the proc structs, and the u structs.

9)	Reset the childs cwd (using chdir()) to the desired directory.
	This will avoid a potential credentials problem on process exit.

10)	Exit the child process.


Or if you were lazy, you could type 'cd' in the parent, which is probably a
shell.  If the parent isn't a shell, you could popen() the child, read(),
the child could write() it's cwd on exit, and the parent could chdir() to
the value returned by read().


					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.wizards
From: james@Cigna.COM (James Dornan)
Subject: Calling a terminal from unix
Summary: I need to know how to do callback from unix(SunOS).
Keywords: modem,terminal,unix,callback
Organization: CIGNA FIRST, Moon
Date: Fri, 21 Aug 1992 23:27:51 GMT

Hello Wizards,

I need to have a Unix(SunOS) call a terminal with modem and
display a login prompt.  I have a Hayes Ultra 9600 on both
ends and I'm using a Sun4 machine running SunOS 4.1.1.
The reason is my employer needs some data entry done remotely
and does not want to give out the number. Thank you all and
to all a good net.


James "AAAAARGHHHHH!!! I hate PCs" Dornan
From: tchrist@convex.COM (Tom Christiansen)
Newsgroups: comp.unix.wizards
Subject: Re: cd'ing to a dir from a process & staying there
Date: 20 Aug 92 13:22:11 GMT
Reply-To: tchrist@convex.COM (Tom Christiansen)
Followup-To: comp.unix.shell
Organization: Convex Computer Corporation, Colorado Springs, CO
Originator: tchrist@pixel.convex.com
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 mpalmer@encore.com (Mike Palmer):
:Can anyone suggest a way for a process to cd to a dir & stay there when the \
:process exits.
:
:I have a ksh solution using an alias, a script & the program, but I'd like
:to do it just with a program, or at least a script & program than will work
:under csh & ksh.

You posted this question to more than one newsgroup, without using the
newsgroups line for crossposting, which wastes a lot of bandwidth.  
Please do not do this.

This is Unix FAQ #14.  I've responded to you in comp.unix.shell, 
whither followups to this post have been redirected.

I strongly suggest you RTFFAQ first next time.

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

    "* Unix is a footnote of AT&T Bell Laboratories."
                             --Barry Shein
Newsgroups: comp.unix.wizards
From: boyd@prl.dec.com (Boyd Roberts)
Subject: Re: Queueing of signals
Keywords: SIGCHLD, signals, queueing, sigvec
Organization: Digital Equipment Corporation - Paris Research Laboratory
Date: Fri, 14 Aug 1992 11:22:12 GMT

I wasn't going to followup to this thread because the whole `signal
on child death' is a quagmire, but:

In article <1992Aug14.072625.26349@fcom.cc.utah.edu>, terry@cs.weber.edu (A Wizard of Earth C) writes:
> You know, if I had any sense, I'd be going to bed right this instant...
>

Hmm...
 
> 1)	Signals aren't queued

Well it depends.  On System V `death of child' persists until all your
zombies have been waited for.  And it's near indistinguishable from a
queue when your signal handler is coded correctly; you get one signal
per child death.  You must ensure that you wait _before_ you reset
the SIGCLD handler because signal(2) will search the process table 
looking for any outstanding zombies, which in turn generates another
signal.  Get this wrong and your stack explodes.


Boyd Roberts			boyd@prl.dec.com

``When the going gets wierd, the weird turn pro...''
Newsgroups: comp.unix.wizards
From: gwaters@bwdls139.bnr.ca (Glenn Waters)
Subject: Queueing of signals
Keywords: SIGCHLD, signals, queueing, sigvec
Organization: Bell-Northern Research
Date: Thu, 13 Aug 1992 16:08:24 GMT

I have a program that seems to lose SIGCHLD signals. There are two (or more)
processes that die simultaneously -- thus generating two SIGCHLDs
to the parent. I only seem to get the first SIGCHLD.

Are the signals queued? I believe not.

What is the correct method of catching the subsequent child deaths that are
not queued?

-- 
Glenn Waters, Network Management Systems      gwaters@bnr.ca
Bell-Northern Research, Ltd.                  ...!uunet!bwdls35!gwaters
P.O. Box 3511, Station C                      (613)763-3933 (Voice)
Ottawa Ontario Canada K1Y 4H7                 (613)763-3283 (FAX)
#include <standard_disclaimer.h>
Newsgroups: comp.unix.wizards
From: SDENARO@vm.poly.edu
Subject: Re: What must I learn to become a Lizard?
Organization: Polytechnic University
Date: Wed, 12 Aug 92 12:02:55 EST

In article <1992Aug9.201148.248@decuac.dec.com>
mjr@hussar.dco.dec.com (Marcus J. Ranum) writes:
 
>>>You must like to live under rocks.
>
>
You must use CMS on an (shudder) IBM mainframe
 
--
Sal Denaro sdenaro@polyvm.poly.edu
A UNIX guy in a CMS hell hole.
Newsgroups: comp.unix.wizards
From: jeffj@krfiny.uucp (J. Jonas)
Subject: Re: flock(2) emulation?
Summary: you can roll your own
Organization: Jeff's house of computer pieces
Date: Fri, 14 Aug 1992 17:10:20 GMT

If I recall the history correctly:
first was lockf(3) - a library that provided advisory record locking.
Then it was rolled into the OS as flock(2), and lockf(3) became
simply calls to flock.  This enabled manditory record locking
(write(2) returns EAGAIN or blocks if it would overwrite a locked
region of the file).

As mentioned in this newsgroup, the library probably kept a file
containing
- the file being locked (by major number/minor number/inode)
- the region locked and the PID
that way, all processes can access the global file and
inspect each other's locks.

You might even place the table in shared memory.

The problem with advisory record locking is that a 'rude'
program that doesn't respect the locking can destroy the file.
Manditory record locking (having a file with the "get GID bit" set)
enforces the lock by blocking writes on locked portions.

- Jeffrey Jonas
jeffj@synsys.uucp
-- 
-- 
Jeffrey Jonas

jeffj@synsys.uucp
Newsgroups: comp.unix.wizards
From: pds@lemming.webo.dg.com (Paul D. Smith)
Subject: Re: Torek a hack? [Re: What must I learn...]
Date: 12 Aug 92 14:39:14 GMT
	<1992Aug5.021413.6797@decuac.dec.com> <1992Aug05.053915.7712@kithrup.COM>
	<1950@dutiws.tudelft.nl> <avalon.713546720@coombs>
Organization: NSDD/ONSD, Data General Corp., Westboro, MA

[] Regarding Re: Torek a hack? [Re: What must I learn...];
[] avalon@coombs.anu.edu.au (Darren Reed) writes:

    dr> Dunno about coffee/cappucino, but coke definately :-) I
    dr> remeber a post ages ago about a finger daemon hooked upto a
    dr> coke machine so they knew how cold the coke was likely to be -
    dr> not something for a unix rookie :)

That was (is?) at Carnegie Mellon University; it definitely worked
(works?).

The coke machine was in the graduate comp lab; it had the 16 oz.
bottles and was the only place on campus to get Real(TM) Coke during
the infiltration of Coca Cola Corp. by evil [aliens|Commies|terrorists]
intent on demolishing the high-tech industry in America (read: the New
Coke debacle :).

After much finagling I even managed to get myself a legitimate X-1
key.
--

                                                                paul
-----
 ------------------------------------------------------------------
| Paul D. Smith                          |    paul_smith@dg.com    |
| Data General Corp.                     | pds@lemming.webo.dg.com |
| Network Systems Development Division   |                         |
| Open Network Systems Development       |   "Pretty Damn S..."    |
 ------------------------------------------------------------------
Xref: sparky comp.unix.wizards:3600 comp.unix.bsd:4102
From: osycs@giac1.oscs.montana.edu (Craig Spannring)
Newsgroups: comp.unix.wizards,comp.unix.bsd
Subject: Re: Have $8000, what to buy?
Keywords: n
Date: 13 Aug 92 21:31:33 GMT
Distribution: comp
Organization: Geographic Information & Analysis Center Montana State University

In article <RG.92Aug10111713@nymph.msel.unh.edu> rg@msel.unh.edu (Roger Gonzalez) writes:
>
>I want a Unix machine.  Now.

Whichever machine you decide to get, you probably should budget money 
for a tape drive of some sort.  Backups to disk are a pain.

-- 
====================================================================
 Six of one, 110 (base 2) of       | Craig Spannring
 another.                          | osycs@giac1.oscs.montana.edu
 ----------------------------------+--------------------------------
From: 88001636@vax1.dcu.ie ( Damn the electric fence!)
Newsgroups: comp.unix.wizards
Subject: RE: Enquiry for GNU Emacs Editor
Date: 19 Aug 92 16:53:50 GMT

Hi,

I think I have what you're looking for. It's quite a large file though
(3429135 bytes after compression). If you're still interested let me know
and we can arrange transfer.

Ciaran Treanor

Advanced Telecommunications Research Unit
Dublin City University
Ireland
Newsgroups: comp.unix.wizards
From: bill@chaos.cs.umn.edu
Newsgroups: comp.unix.wizards
Subject: $500 to spend on service tools - Was Re: Have $8000, what to buy?
Date: 21 Aug 92 14:05:16 GMT


>While we are discussing what to get for $8000, I would like to get opinions
>about what are the better service tool kits around for about $500 to $600.
can i presume that you mean like screwdrivers, side cutters, etc? as in hardware?
well personnaly (as a hw design kinda guy, nowhere near even a wizardly dweeb)
id a kit which has the parts you like, then go purchase a zero hallberon case,
then fill it with the aforementiond parts, only manufactured by xcellite.
from what i've seen sold in kits most of it is pure d simple junk! priced
about 5 times what it goes for when sold in a convienience store. it's a nice
idea but the execution leaves a bit to be desired (as *they* say).
go find a decent tv repair shop, you know the kind where the last of the great 
gnurds works/ownes and as him either for an old catalog or the address of
where he buys his stuff 7 out of 10 times (yea i just made it up) he buys 
the good stuff and can point you the way to it. avoid hardware stores
they'll only be able to provide the most basic of items (always avoid the
chain store as they only provide the crap put out by fast buck japannese
and far east mom and pop shops. always avoid radio shack for the same reason).
you said you wanted the good stuff? well this is how ya get it. it ain't
cheep, but i am still using hand tools purchased in the very early '70's.
expensive? yes. are they lasting? what do you think. untill about 5 years ago
i *only* did hw. now i'm slowly evolving to only doing sw. i may rank as
a wizards apprentice helper 3rd class. (but i bet i can do 1 or 2 things with
the hw that a few of you don't know about :-)
oh yea why don't i do hw anymore? i got discusted wheb the bankers shut down
eta systems.
later.
bill pociengel