Linux-Development-Sys Digest #942, Volume #7 Fri, 9 Jun 00 06:13:12 EDT
Contents:
Re: finding filename from file descriptor (Alexander Viro)
Re: Journaling File System ("Seth Anderson")
Re: HELP: SIMPLE IRQ Routine Crashes (Tod Daniels)
Re: Linux (unix) on a AS/400 (Vladimir COTFAS)
Re: How to make capabilities work for non-root (execve() considered (Vladimir
COTFAS)
Re: How to get returncodes from init_module ("A derelict Engineer")
Negating the effects of a device poll "tight loop" (Andrew Reid)
Re: Journaling File System (Kaz Kylheku)
Re: Journaling File System (Christopher Browne)
Re: HELP: SIMPLE IRQ Routine Crashes (Erik Max Francis)
What function call can get Gateway of network card? (Chan Chi Lung)
Re: What function call can get Gateway of network card? (Tom Roberts)
Re: Perl script in C wrapper won't suid (H. Peter Anvin)
Re: [Q] Hook system call (Sam Birch)
Re: What function call can get Gateway of network card? (Sam Birch)
Re: HELP: SIMPLE IRQ Routine Crashes (Arnaud Westenberg)
Re: HELP: SIMPLE IRQ Routine Crashes (Arnaud Westenberg)
linux vs unix? ([EMAIL PROTECTED])
Writing a internet file system (Winston Avalon)
Re: linux vs unix? (Josef Moellers)
how to add more than 8 loop devices ? (Karsten Laskowski)
Re: HELP: SIMPLE IRQ Routine Crashes (Michel Bardiaux)
----------------------------------------------------------------------------
From: [EMAIL PROTECTED] (Alexander Viro)
Subject: Re: finding filename from file descriptor
Date: 8 Jun 2000 19:18:48 -0400
In article <[EMAIL PROTECTED]>,
Josef Moellers <[EMAIL PROTECTED]> wrote:
>Why so overly complicated?
>Just open /proc/<oldprocess>/fd/<filedescriptor>!
Because it is
a) nonportable
b) breaking if /proc is not mounted
c) racey as hell since file might be renamed away after you've readlink
the thing
d) actually broken in your variant since opening sockets via procfs is
prohibited and since re-opening may have effects very different from sharing
the opened file.
(a) alone is more than enough - using Linux-only trick that does not even work
on all Linux boxen when there is a portable way to do the thing... <shrug>
--
"You're one of those condescending Unix computer users!"
"Here's a nickel, kid. Get yourself a better computer" - Dilbert.
------------------------------
From: "Seth Anderson" <[EMAIL PROTECTED]>
Subject: Re: Journaling File System
Date: Thu, 8 Jun 2000 18:02:32 -0500
Forgive a newbie's curiosity. What is a journaling file system?
"Aki M Laukkanen" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> In article <[EMAIL PROTECTED]>, Anes Lihovac wrote:
> >When I extract a source package, configure and compiled it,than started
> >it and crashes, the whole Directory
> >wasn't there any more after the reboot!
>
> Reiserfs only does meta-data journaling. Which program crashes the
> whole system?
>
>
> --
> D.
------------------------------
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.hardware
Date: Thu, 8 Jun 2000 19:51:42 -0400
From: Tod Daniels <[EMAIL PROTECTED]>
Subject: Re: HELP: SIMPLE IRQ Routine Crashes
Andrey,
Thanks for the follow up.
The syntax is standard for writing to a kernel message file.
In this case, the KERN_INFO is a #define for "<6>". Translation: the
actual printk message is "<6>Servicing Interrupt..." What this means is
that the kernel decodes this a message of type Informational (just like
you see in syslog). If you were to separate the KERN_INFO from the
remainder of the string with a comma, the compiler would interpret it as
the first parameter -- clearly not what we want here...
Again, not the answer I'm looking for but I appreciate the effort...
tod
On Thu, 8 Jun 2000, Andrey Vlasov wrote:
> Hi,
>
> are you sure that syntax of line correct
>
> printk(KERN_INFO "Servicing Interrupt %02d.\n", irq);
>
> as I never seen something like that. Normaly in C it looks
>
> printk(KERN_INFO, "Servicing Interrupt %02d.\n", irq);
> ^^^
> or
>
> printk("KERN_INFO Servicing Interrupt %02d.\n", irq);
> ^^^
>
> Check syntax. I do not have any experience with
> developing of drivers but it looks wrong from
> point of C syntax which I had to use. It seems to
> me that it should be like in case #1.
>
> Andrey
>
------------------------------
From: Vladimir COTFAS <[EMAIL PROTECTED]>
Subject: Re: Linux (unix) on a AS/400
Date: Thu, 08 Jun 2000 17:32:00 -0700
Pascal van bakkum wrote:
> Does anybody know of there is an linux distribution for as/400 ?
There is no such thing yet.
Go to http://www.linux.org and among the "software projects"
you'll find a link for porting Linux to the CISC AS/400's.
Vladimir
------------------------------
From: Vladimir COTFAS <[EMAIL PROTECTED]>
Subject: Re: How to make capabilities work for non-root (execve() considered
Date: Thu, 08 Jun 2000 17:39:04 -0700
Hi,
I was in the same situation one year ago. I used to play with CAP_NET_BIND. I
made a small patch for capability.h There's NO way that a user (!=0) process
to inherit active caps. I also wrote a small utility mkcap that changed both
uid/gid and the set of caps for the child process.
If you are interested in this, I'll send you a patch against the 2.2.2 kernel
and the source for the utility.
Vladimir
------------------------------
From: "A derelict Engineer" <[EMAIL PROTECTED]>
Subject: Re: How to get returncodes from init_module
Date: Thu, 8 Jun 2000 17:45:44 -0700
I'm not sure it's a really "thematic" thing to do, but you could just stuff
the error code in
the global 'errno' var - then you might be able to get to it afterwards with
a user program.
Of course, if anything else wrote errno before your user program got there,
it
would be gone; it's not a very sound solution...
<[EMAIL PROTECTED]> wrote in message
news:8gdq1i$9d1$[EMAIL PROTECTED]...
> Hello mighty kernelhackers.........
>
> I wrote a simple module with an 'init_module()' function that returns
> different errorcodes for some cases (i.e. -ENOMEM for kmalloc()error
> or -EIO for PCI errors). If I 'insmod' the module and it fails with
> some of these errorcodes I get only the errorstring from insmod which
> always fails with -1. Is there a simple way to see the returncode
> from 'init_module()' (best would be directly on the terminal after
> insmod !) ?? I tried 'strace insmod....' and also to start a
> userprogram with a simple 'perror()' call directly after the
> failed 'insmod...', but i was not successful.
>
> Would be nice If someboby helps me.....
>
> Michael Palme
> [EMAIL PROTECTED]
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
------------------------------
From: [EMAIL PROTECTED] (Andrew Reid)
Reply-To: [EMAIL PROTECTED]
Subject: Negating the effects of a device poll "tight loop"
Date: Fri, 09 Jun 2000 00:49:25 GMT
I have a situation where I have to "wrap" firmware code supplied in
on-board ROM with code to provide user access. I do not have access to the
code in the ROM other than the supplied API, and general knowledge of how
the code functions And in any event the code in the ROM is subject to
change. To accomplish a very low priority activity, the firmware in the
ROM polls a device in a tight loop for significant periods (10s of
seconds). As I don't wish to have this disrupt the other parts of the
system, I want to lower the priority of the wrapper. An added
complication is that the code in the ROM is not position independent, it
needs to run at a high virtual address (0xFExxxxxx).
This would seem a natural for a user process, running at a low priority.
I understand how to set up the "ipc" from the device drivers with ioctls
or "pipes" al la Rubini's book. Or a low priority kernel thread which can
be pre-empted (not a usual request for a kernel thread)
Problem-
How do I map this address (0xFExxxxxx virt = phys) into user space ?
or
Since I can map the code in kernel space, (we have to modify the kernel to
map other board resources) how do I get a kernel thread to run at a low
priority AND BE PRE-EMPTED like a user process, when that thread cannot
call schedule() because it is off in a tight loop. I have already
discovered that lowering the priority of the thread only controls when it
gets started, once started it does not release control until completion.
Any hints and pointers would be much appreciated.
------------------------------
From: [EMAIL PROTECTED] (Kaz Kylheku)
Subject: Re: Journaling File System
Reply-To: [EMAIL PROTECTED]
Date: Fri, 09 Jun 2000 01:13:17 GMT
On Thu, 8 Jun 2000 18:02:32 -0500, Seth Anderson
<[EMAIL PROTECTED]> wrote:
>Forgive a newbie's curiosity. What is a journaling file system?
It's a filesystem that records its tentative actions in a data area called a
``journal'' so that in the event of an ``unscheduled downtime'', on reboot, the
integrity of the filesystem can be recovered without performing an exhaustive
check of its entire structure; only the journal needs to be rectified against
what is on the disk. This recovery can save hours of checking on a huge
filesystem, and bring the system online within seconds.
--
#exclude <windows.h>
------------------------------
From: [EMAIL PROTECTED] (Christopher Browne)
Subject: Re: Journaling File System
Reply-To: [EMAIL PROTECTED]
Date: Fri, 09 Jun 2000 02:13:11 GMT
Centuries ago, Nostradamus foresaw a time when Seth Anderson would say:
>Forgive a newbie's curiosity. What is a journaling file system?
The basic idea is that everything that is updated in a file is, before
hitting that file, written out to a "journal."
As a result, if the system goes down before all of the disk updates
get done, the most recent updates are all listed in that journal.
Thus, when you reboot, rather than the system having to go out and check
the _WHOLE_ disk to see what might need to get repaired (on Linux, this
is done using "fsck" or "e2fsck;" on Windows, SCANDISK is the nearest
equivalent), you need only look at the journal to see what small number
of things on disk were being messed with.
On modern Big Disks, fsck can take a rather long time to run, on the
order of several minutes, whilst with ReiserFS, it need only look at a
32MB buffer _AT MOST_, which should take a few seconds, _AT MOST_.
Now, Linux is pretty reliable, so you don't need to reboot due to
kernel crashes very often. But if you've got flakey _POWER_, that
can result in spurious crashes, and on an important server, you
do _not_ want the system to sit there busy fscking for 20 minutes,
adding insult to injury.
--
[EMAIL PROTECTED] - <http://www.hex.net/~cbbrowne/lsf.html>
A man, a plan, a canoe, pasta, heros, rajahs, a coloratura, maps, snipe,
percale, macaroni, a gag, a banana bag, a tan, a tag, a banana bag again
(or a camel), a crepe, pins, Spam, a rut, a Rolo, cash, a jar, sore
hats, a peon, a canal--Panama!
------------------------------
From: Erik Max Francis <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.hardware
Subject: Re: HELP: SIMPLE IRQ Routine Crashes
Date: Thu, 08 Jun 2000 19:33:16 -0700
Andrey Vlasov wrote:
> are you sure that syntax of line correct
>
> printk(KERN_INFO "Servicing Interrupt %02d.\n", irq);
>
> as I never seen something like that. Normaly in C it looks
>
> printk(KERN_INFO, "Servicing Interrupt %02d.\n", irq);
> ^^^
(You should be using a fixed-width font for posting to Usenet, as the
highlight you attempted here didn't show up in the right place.)
What you replied to was correct. ANSI C indicates that juxtaposed
string literals are concatenated, and KERN_INFO is a macro which expands
to a string literal.
--
Erik Max Francis / [EMAIL PROTECTED] / http://www.alcyone.com/max/
__ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
/ \ When the solution is simple, God is answering.
\__/ Albert Einstein
7 sisters productions / http://www.7sisters.com/
Web design for the future.
------------------------------
From: Chan Chi Lung <[EMAIL PROTECTED]>
Subject: What function call can get Gateway of network card?
Date: 9 Jun 2000 03:21:16 GMT
Dears,
I want to ask how can I get the gateway and netmask of a network
card through a or a sequence of function call??
Thx.
------------------------------
From: Tom Roberts <[EMAIL PROTECTED]>
Subject: Re: What function call can get Gateway of network card?
Date: Thu, 08 Jun 2000 23:24:31 -0500
Chan Chi Lung wrote:
> I want to ask how can I get the gateway and netmask of a network
> card through a or a sequence of function call??
ifconfig prints it out. Desperate people might apply grep, cut, sed,
et al to tease the info you want out of its printout. But since this
is Linux you can just read its code....
Tom Roberts [EMAIL PROTECTED]
------------------------------
From: H. Peter Anvin <[EMAIL PROTECTED]>
Subject: Re: Perl script in C wrapper won't suid
Date: 8 Jun 2000 21:57:28 -0700
Followup to: <[EMAIL PROTECTED]>
By author: Edward Block <[EMAIL PROTECTED]>
In newsgroup: comp.os.linux.development.system
>
> This should be simple...
>
> I want to run a perl5 script with suid set. I followed the directions
> and advise given at Perl's FAQ:
>
> http://www.perl.com/pub/doc/FAQs/cgi/wwwsf5.html#Q49
>
> This doens't seem to work. The Perl library
> /usr/lib/perl5/5.00503/File/Copy.pm complains about insecure
> dependancies while runing setuid. I thought if I write a C wrapper like
>
> #include <unistd.h>
> void main () {
>
> execl("/usr/local/bin/perl","foo.pl","/local/web/cgi-bin/foo.pl",NULL);
> }
>
> it would work...
> Is there something I've missed?
>
You don't need to do this at all. Perl handles setuid all on its own
just fine. Your wrapper, on the other hand, is highly insecure (runs
it out of the current working directory!!)
The insecure dependencies has to do with "tainting", an extra security
mechanism Perl uses when running setuid.
-hpa
--
<[EMAIL PROTECTED]> at work, <[EMAIL PROTECTED]> in private!
"Unix gives you enough rope to shoot yourself in the foot."
------------------------------
From: Sam Birch <[EMAIL PROTECTED]>
Subject: Re: [Q] Hook system call
Reply-To: [EMAIL PROTECTED]
Date: Fri, 09 Jun 2000 06:22:00 GMT
On 8 Jun 2000 07:37:47 GMT, Chetan Ahuja <[EMAIL PROTECTED]> wrote:
> You don't have to modify the kernel for that. Just use the already
> built in ptrace system call. In fact there's a userland program
> available that does almost what you want without you having to do
> ANY programming. Do a "man strace" on your system.
I think the poster wanted more than just to see what sys calls were
made suring hte run of one program...
The poster wanted to log the usage of any/all system calls, regardless
of who they are called by and when they are run.
Sam
------------------------------
From: Sam Birch <[EMAIL PROTECTED]>
Subject: Re: What function call can get Gateway of network card?
Reply-To: [EMAIL PROTECTED]
Date: Fri, 09 Jun 2000 06:36:37 GMT
On Thu, 08 Jun 2000 23:24:31 -0500, Tom Roberts <[EMAIL PROTECTED]>
wrote:
>Chan Chi Lung wrote:
>> I want to ask how can I get the gateway and netmask of a network
>> card through a or a sequence of function call??
>
>ifconfig prints it out. Desperate people might apply grep, cut, sed,
>et al to tease the info you want out of its printout. But since this
>is Linux you can just read its code....
>
>
>Tom Roberts [EMAIL PROTECTED]
It's actually an ioctl. Your best bet is to look at the following 3
pieces of code:
IF YOU WANT C:
1) ifconfig.c (part of net-utils package--the calling side)
2) devinet.c (part of the kernel source--the receiving side)
IF YOU WANT PERL:
3) Net-Interface (a perl module which gives you access to ifconfig
functionality)
HTH
Sam
------------------------------
Date: Fri, 09 Jun 2000 08:22:17 +0200
From: Arnaud Westenberg <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.hardware
Subject: Re: HELP: SIMPLE IRQ Routine Crashes
Tod Daniels wrote:
> Here is the output from the KERN_DEBUG message:
See rubini's book about making (a little) more sense of oopses
> The code I wrote to service the interrupt is as follows:
[snip]
> if (request_irq(Card->Irq, &dcpInterruptService, 0,
[/snip]
Don't use the address of operator (&) in front of your handler name, the
name alone is already a handler.
Regards Arnaud
------------------------------
Date: Fri, 09 Jun 2000 08:24:24 +0200
From: Arnaud Westenberg <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.hardware
Subject: Re: HELP: SIMPLE IRQ Routine Crashes
> Don't use the address of operator (&) in front of your handler name, the
> name alone is already a handler.
fu^%#%^&* I meant the handler name is already a pointer! sh&^%&($(&^t
------------------------------
From: [EMAIL PROTECTED]
Subject: linux vs unix?
Date: Fri, 09 Jun 2000 08:20:44 GMT
hello friends,
can anyone list some top differences between linux
and unix. i am not looking in commercial terms but in technical terms
like at the kernel level. pleeease
thanks
gowtham
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
From: [EMAIL PROTECTED] (Winston Avalon)
Subject: Writing a internet file system
Date: Fri, 09 Jun 2000 08:52:59 GMT
I am writing a new sortof-filesystem that allow internet linking to
files or remote servers.... but I really dunno know where to start
looking for resource....
If anyone know of anything that maybe helpful, I would like to hear
from you.
------------------------------
From: Josef Moellers <[EMAIL PROTECTED]>
Subject: Re: linux vs unix?
Date: Fri, 09 Jun 2000 11:45:09 +0200
[EMAIL PROTECTED] wrote:
> =
> hello friends,
> can anyone list some top differences between linux
> and unix. i am not looking in commercial terms but in technical terms
> like at the kernel level. pleeease
> thanks
> gowtham
> =
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Warren Young gave me this link a few days ago:
http://www.cyberport.com/~tangent/ix/
-- =
Josef M=F6llers
Fujitsu Siemens Computers
SHV Server DS 1
------------------------------
From: Karsten Laskowski <[EMAIL PROTECTED]>
Subject: how to add more than 8 loop devices ?
Date: Fri, 09 Jun 2000 11:51:25 +0200
Hello,
I would like to use our Linux (SuSE 6.4, 2.2.14) as a CDROM Server.
I copied the raw data from every CD on the harddisk as one image and
mounted it with the option -o loop=/dev/loop1 - /dev/loop7.
White "mknod -m660 /dev/loop8 b 7 8", and "chmod disk loop8" i added
one more loop device.: When I try to mount a cdimage with this loop
device, the device is not found.
I searched in some mailing archives and found an advice to increase the
number for MAX_LOOP (at line 50-60) from 8 to 32 or 64 in the file
/usr/src/linux/drivers/block/loop.c I compiled the kernel and the
modules (loop as module). But it's still the same effect, I can only
access 8 loop devices, the next is not found. Are there other
dependencies in the code that restrict to the use of 8 loop devices ?
How can I get more loop devices, what's the maximum number ?
Thanks,
Karsten Laskowski, Germany
------------------------------
From: Michel Bardiaux <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.hardware
Subject: Re: HELP: SIMPLE IRQ Routine Crashes
Date: Fri, 09 Jun 2000 10:07:43 GMT
Arnaud Westenberg wrote:
>
> > Don't use the address of operator (&) in front of your handler name, the
> > name alone is already a handler.
>
> fu^%#%^&* I meant the handler name is already a pointer! sh&^%&($(&^t
How can PERL code be relevant here? :-)
--
Michel Bardiaux
------------------------------
** FOR YOUR REFERENCE **
The service address, to which questions about the list itself and requests
to be added to or deleted from it should be directed, is:
Internet: [EMAIL PROTECTED]
You can send mail to the entire list (and comp.os.linux.development.system) via:
Internet: [EMAIL PROTECTED]
Linux may be obtained via one of these FTP sites:
ftp.funet.fi pub/Linux
tsx-11.mit.edu pub/linux
sunsite.unc.edu pub/Linux
End of Linux-Development-System Digest
******************************