Linux-Development-Sys Digest #795, Volume #7 Sun, 23 Apr 00 13:13:27 EDT
Contents:
Re: Dual processor pthreads and stdio -- not thread-safe? Sequel (Robert Sim)
howto set variable in shell script for exit status? (M Sweger)
Re: LIMITS OF LINUX.........PLEASE HELP (Stefaan A Eeckels)
Re: Far pointer (Pankaj Chhabra)
Re: read from kernel (Pankaj Chhabra)
Re: getting started... (Pankaj Chhabra)
Re: loopback filesystem locking with pre-2.4 kernels (Eric Buddington)
Re: How To Protect Memory From Swapping ??? (fvw)
Re: Kernel source browser (Francis Hartojo)
Re: MS caught breaking web sites (Gary Connors)
Re: fine tracing memory usage ? ("Mark Graybill")
Re: Is It Possible To Decompile Kernel Modules? (Kaz Kylheku)
Re: LIMITS OF LINUX.........PLEASE HELP (Kaz Kylheku)
hdc: lost interrupt ("BP")
Re: How To Protect Memory From Swapping ??? (David Steuber)
Re: Far pointer (Grant Edwards)
Re: howto set variable in shell script for exit status? (terry)
Re: MS caught breaking web sites ("Dave Bethke")
Re: howto set variable in shell script for exit status? (M Sweger)
Re: MS caught breaking web sites (The Ghost In The Machine)
Re: MS caught breaking web sites (Sean LeBlanc)
----------------------------------------------------------------------------
From: Robert Sim <[EMAIL PROTECTED]>
Subject: Re: Dual processor pthreads and stdio -- not thread-safe? Sequel
Date: Sat, 22 Apr 2000 20:13:58 GMT
Robert Sim wrote:
> The following short program works fine on a single processor machine,
> but aborts on a dual. I haven't tried it yet w/ open(2) and read(2), so
> I'm not sure if it's a libc problem or kernel problem. In any case it's
> a serious problem.
I have since tried the program using the system calls open and read,
without any trouble, so it is fgets (and also the gnu extension getline)
which is not multi-processor friendly.
R
--
We ARE as gods and might as well get good at it.
-- Whole Earth Catalog
------------------------------
From: [EMAIL PROTECTED] (M Sweger)
Subject: howto set variable in shell script for exit status?
Date: 22 Apr 2000 21:10:27 GMT
Reply-To: [EMAIL PROTECTED]
Hi,
I'm trying to return to a variable/environment variable the status
code of a shellscript that is a numerical value either negative or positive.
I keep getting the null value. Here's what I'm doing.
t.sh contains
#!/bin/sh
exit 20
I'm setting the environment variable as follows.
err=`t.sh`
however err is always null when echoingthe $err instead of 20.
So how is this done?
--
Mike,
[EMAIL PROTECTED]
------------------------------
From: [EMAIL PROTECTED] (Stefaan A Eeckels)
Subject: Re: LIMITS OF LINUX.........PLEASE HELP
Date: 22 Apr 2000 20:29:59 GMT
In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] (John McKown) writes:
> On Wed, 19 Apr 2000 19:34:14 +0200, Mario Klebsch <[EMAIL PROTECTED]> wrote:
>>
>>TCPs limit is 64K commections per client. :-)
>>
>
> What is a "client" in this case. I would have thought that the limit would
> be 64K per IP address. So if you had 3 ethernet cards with three different
> IP addresses, wouldn't you be able to have 3*64K TCP connections? And wouldn't
> that be per IP address. Can two different processes use the same IP/port
> combination? I am honestly curious since I am still towards the bottom of
> the learning curve.
What makes an IP conversation unique is the following:
1. Protocol (UDP, TCP)
2. Originator address
3. Destination address
4. Port number.
Thus, for any destination address, you could have 128k
"conversations", that is, 64k TCP connections, and
64k distinct UDP chats (as UDP is connectionless).
All of this is in theory, of course. You'll hit OS
limits long before you've exhausted IP's possibilities.
Processes are not part of the IP space, thus they cannot
be used to differentiate data flows (you'd need to stash
the process ID in the IP packets, and there's no provision
for that --honestly, it would be a *bad* idea).
Your're quite correct about the 3 IP addresses tripling the
number of TCP connections. Note that most modern OSes support
more than one IP address per interface. Multiple interfaces
are necessary when you want to connect to different wires
(like segments on a LAN, or to bridge two networks).
Take care,
--
Stefaan
--
--PGP key available from PGP key servers (http://www.pgp.net/pgpnet/)--
Ninety-Ninety Rule of Project Schedules:
The first ninety percent of the task takes ninety percent of
the time, and the last ten percent takes the other ninety percent.
------------------------------
From: Pankaj Chhabra <[EMAIL PROTECTED]>
Subject: Re: Far pointer
Date: Sat, 22 Apr 2000 18:34:34 -0700
Hi,
For MS-DOS you need a far pointer because of Segment:Offset scheme.
All near pointers point to the same segment and far pointers give
you the
capability to access the data in other segment.
For example.
char *p = 0x4000;
implies ds:0x4000;
whereas char *p = 0x40000200;
implies segment 0x4000 and offset 0x200.
For 32 bit model every pointer is 32 bit. So you don't need to
declare far.
For example
char *p;
On 32 bit machine is a 32 bit pointer.
- Pankaj
Jan Lund Kristensen wrote:
> Hi,
>
> How can I make a far pointer for direct memory access?
> Like using MK_FP macro in C++ for MS-DOS.
>
> Greetings
> Jan
------------------------------
From: Pankaj Chhabra <[EMAIL PROTECTED]>
Subject: Re: read from kernel
Date: Sat, 22 Apr 2000 18:36:56 -0700
Hi,
For what you are trying to achieve /Proc file system is one of the
solutions.
- Pankaj
Badrinath Venkatachari wrote:
> Hi,
> Is there a way that I can issue read requests for a file from within
> the kernel (to read it sequentially), instead of having a user process
> ask for data.
>
> What I want to do is to have a user process opening a file and
> periodically read from the buffer (associated with the file) instead of
> requesting data ? The kernel would just get the data beforehand and keep
> it in a buffer for the client to read.
>
> thanks and regards
> badri
------------------------------
From: Pankaj Chhabra <[EMAIL PROTECTED]>
Subject: Re: getting started...
Date: Sat, 22 Apr 2000 18:30:06 -0700
Hi,
Here is a good book on OS -
Operating System Concepts, 5th Edition
by Abraham Silberschatz, Peter Baer Galvin
Next level is this book -
Operating Systems: Internals and Design Principles -- William Stallings;
- Pankaj
Clint Box wrote:
> Hey,
>
> I've purchased "Design and Implementation of 4.4BSD" and it's not a starter
> book. It's very informative but I think I need to get a better understand
> of OS functions. Can anyone suggest a good book, or video, or even a simple
> OS that would simplify what an OS can and should do?
>
> Clint
------------------------------
From: [EMAIL PROTECTED] (Eric Buddington)
Subject: Re: loopback filesystem locking with pre-2.4 kernels
Reply-To: [EMAIL PROTECTED]
Date: Sun, 23 Apr 2000 01:45:15 GMT
In article <[EMAIL PROTECTED]>, Se�n C. McCord wrote:
>It worked fine in 2.2.x, but 2.3.99-*, every time I try to mount with
>the -o loop option, the mount command hangs... kill -9 will not remove
>it
>Anyone have any ideas? Diagnosis techniques? Similar problem?
Similar, but not identical.
I can make an iso9660 image and mount it loopback.
I can ls the filesystem fine.
But if I try to read a file or run an 'ls -l', then the process locks
hard (immune to SIGKILL), as does anyhing else that seems to touch
*ANY* filesystem at all. SysRq to sync and remount-ro both fail.
This is reliable behaviour. No ideas why.
-Eric
------------------------------
From: [EMAIL PROTECTED] (fvw)
Crossposted-To:
comp.os.linux.development,comp.os.linux.development.apps,linux.dev.c-programming,linux.redhat.development
Subject: Re: How To Protect Memory From Swapping ???
Reply-To: [EMAIL PROTECTED]
Date: Sat, 22 Apr 2000 23:41:00 GMT
In <KldM4.3106$[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote:
>I think I may have answered my own question.
>
>A call to mlock() looks like it will do the trick.
>
>Cany anyone verify that this is the correct method??
Correct, or mlockall. You need to be root for this to work under linux though.
--
Frank v Waveren
[EMAIL PROTECTED]
ICQ# 10074100
------------------------------
From: Francis Hartojo <[EMAIL PROTECTED]>
Subject: Re: Kernel source browser
Date: 23 Apr 2000 02:54:18 GMT
Reply-To: Francis Hartojo <[EMAIL PROTECTED]>
root <[EMAIL PROTECTED]> wrote:
>Does anyone know where I can find a good application or website which
>maps out the Linux source code. I keep hearing that one exists but I
>can't find it.
In addition to the excellent suggestions that other people have made,
I'd look at cscope which SCO's made open-source. The URL is:
http://cscope.sourceforge.net/
I haven't tried building this particular version myself; but, it seems
to be set up for the Linux/i386 environment.
FWIW, HTH.
--
+------------------------+-------------------------------------------------+
| Francis Hartojo | Ph.: 480-391-8506 [Lucent doesn't endorse my |
| Lucent Technologies | Fax: 480-391-8555 opinions. |
| [EMAIL PROTECTED] | Which is a shame, really.] |
------------------------------
From: Gary Connors <[EMAIL PROTECTED]>
Crossposted-To:
comp.os.linux.advocacy,comp.os.ms-windows.advocacy,comp.os.ms-windows.nt.advocacy,comp.os.linux.networking,comp.os.linux.security,comp.os.ms-windows.networking.tcp-ip,alt.conspiracy.area51
Subject: Re: MS caught breaking web sites
Date: Sun, 23 Apr 2000 01:00:08 -0400
in article [EMAIL PROTECTED], laugh at [EMAIL PROTECTED] wrote on
4/16/00 1:07 AM:
> Robert,
> And with Linux growing to 35% of all servers and 10% of desktops this year
> alone
> (half of those being NT replacements), there won't be much of an audience
> for any future releases of windows when and if they do make it out.
If its a "NT replacement" is not on the desktop. In the real world, NT is
not a desktop OS.
------------------------------
Reply-To: "Mark Graybill" <[EMAIL PROTECTED]>
From: "Mark Graybill" <[EMAIL PROTECTED]>
Subject: Re: fine tracing memory usage ?
Date: Sun, 23 Apr 2000 05:15:26 GMT
You might also use the 'top' command. You can use this program to kill
tasks that are taxing the system.
Linux should free resources when the program terminates. You probably
wouldn't want to be able to free memory out from under a running program.
------------------------------
From: [EMAIL PROTECTED] (Kaz Kylheku)
Subject: Re: Is It Possible To Decompile Kernel Modules?
Reply-To: [EMAIL PROTECTED]
Date: Sun, 23 Apr 2000 05:48:15 GMT
On Sat, 22 Apr 2000 01:13:34 -0400, Young4ert <[EMAIL PROTECTED]> wrote:
>Hi,
>
>I am not sure if this is the right NG that I am supposed to post the
>question. Anyway, this may sound awkward; however, I have mistakenly
>deleted some of my own source files that I used to develop some drivers
>for Linux kernel. However, I may be a little bit lucky since I do have
>the object files (not stripped) that I compiled from the source using
>-O2 optimization switch. The question is if it is possible to decompile
>the object files to regain the source. If so, what decompilation
>utility I should use?
There is no such thing as decompilation. That would be like turning hamburger
back into cow. (Just try starting this topic in some comp.lang.* newsgroup, and
watch the flames engulf you).
What you have to do is rewrite the code from scratch. If the original code
contained some bit of clever logic that you can't remember, disassemble the
object files with ``objdump -d'' and then reverse engineer the semantics from
the machine code.
--
#exclude <windows.h>
------------------------------
From: [EMAIL PROTECTED] (Kaz Kylheku)
Subject: Re: LIMITS OF LINUX.........PLEASE HELP
Reply-To: [EMAIL PROTECTED]
Date: Sun, 23 Apr 2000 05:54:40 GMT
On Wed, 19 Apr 2000 19:34:14 +0200, Mario Klebsch <[EMAIL PROTECTED]> wrote:
>[EMAIL PROTECTED] writes:
>
>>Ekta Agarwal <[EMAIL PROTECTED]> wrote:
>>: 1. Does linux have a limit on the no of TCP connections that can be
>>: concurrently open at one time?
>>: If yes, How do I find out what the limit is. Can I change it, if so
>>: where and how?
>
>>I don't know. TCP has an inherent limitation, related to
>>the number of port numbers available, so probably your
>>maximum here is of the order of 64K.
>
>TCPs limit is 64K commections per client. :-)
A TCP connection is uniquely identified by two IP addresses and two port
numbers. Thus, in principle, billions of connections connections can emanate
from one machine, if CPU resources and memory allow. TCP connections can share
a local address and port number so long as the remote address and port number
is distinct. This commonly happens on the server side: every TCP connection
that is made to the same local service shares a port number with every other
TCP connection to the same service. If an implementation doesn't let an
outgoing connection reuse a local port number, that is a limitation of the
implementation, not of TCP.
--
#exclude <windows.h>
------------------------------
From: "BP" <[EMAIL PROTECTED]>
Crossposted-To:
comp.os.linux.hardware,linux.dev.config,linux.dev.c-programming,linux.dev.kernel,uk.comp.os.linux
Subject: hdc: lost interrupt
Date: Sun, 23 Apr 2000 11:37:43 +0200
Hi all,
I install two IDE disk (6,4 Go each) on /dev/hdc and /dev/hdd - (with 4
partitions on each disk: 512Mo, 2Go, 3Go and a swap partition)
When I try to access hdd disk (with cpio cde for example), system crash with
"hdc: lost interrupt" message - the only way is to reboot the system ... I
've change partitions size (<1Go), bios configuration (ide block mode,
LBA/Normal cfg), but nothing change, I can't have a full access to the
second drive
Does anybody knows what goes wrong ?
Thanks in advance
------------------------------
Crossposted-To:
comp.os.linux.development,comp.os.linux.development.apps,linux.dev.c-programming,linux.redhat.development
Subject: Re: How To Protect Memory From Swapping ???
From: David Steuber <[EMAIL PROTECTED]>
Date: Sun, 23 Apr 2000 12:00:10 GMT
[EMAIL PROTECTED] (fvw) writes:
' Correct, or mlockall. You need to be root for this to work under linux though.
Can the app be owned by root and have the suid bit set?
What about kernel drivers? It seems to me that they are the type of
application that would most need to have locked memory for soft
realtime requirements.
--
David Steuber | Hi! My name is David Steuber, and I am
NRA Member | a hoploholic.
http://www.packetphone.org/
Real Programs don't use shared text. Otherwise, how can they use
functions for scratch space after they are finished calling them?
------------------------------
From: [EMAIL PROTECTED] (Grant Edwards)
Subject: Re: Far pointer
Date: Sat, 22 Apr 2000 22:26:05 GMT
On Sat, 22 Apr 2000 17:48:35 GMT, Jan Lund Kristensen <[EMAIL PROTECTED]> wrote:
>How can I make a far pointer for direct memory access?
>Like using MK_FP macro in C++ for MS-DOS.
1) There are no "near" or "far" pointers under Linux. Linux
uses a flat (non-segmented) address space.
2) If you want to access memory at 0x12345678 you just do:
i = *(int*)0x12345678
3) Linux uses demand-paged, virtual memory, so doing 2) will
generally result in a seg fault since you can't go off
looking at memory that doesn't belong to you.
4) What are you trying to do? Messing with hardware is
generally done in device drivers.
5) If there really is a need for a user program to directly
access a particular block of addresses, the way to do it is
to write a device driver that impliments the mmap() system
call to allow a user to map the pertinent block of
addresses into user-space.
6) If you're running as root, you can use /dev/kmem to access
physical memory.
Confused enough yet?
;)
--
Grant Edwards grante Yow! I didn't order
at any WOO-WOO... Maybe a
visi.com YUBBA... But no WOO-WOO!
------------------------------
From: terry <[EMAIL PROTECTED]>
Subject: Re: howto set variable in shell script for exit status?
Date: Sun, 23 Apr 2000 08:57:44 -0400
M Sweger wrote:
>
> Hi,
> I'm trying to return to a variable/environment variable the status
> code of a shellscript that is a numerical value either negative or positive.
> I keep getting the null value. Here's what I'm doing.
>
> t.sh contains
>
> #!/bin/sh
>
> exit 20
>
> I'm setting the environment variable as follows.
>
> err=`t.sh`
>
> however err is always null when echoingthe $err instead of 20.
>
Here are two things you can try.
1) Change the script
#!/bin/sh
echo 20
exit 0
2) Keep the same script, use "$?" for exit code
err=$?
Hope this helps,
Terry
------------------------------
From: "Dave Bethke" <[EMAIL PROTECTED]>
Crossposted-To:
comp.os.linux.advocacy,comp.os.ms-windows.advocacy,comp.os.ms-windows.nt.advocacy,comp.os.linux.networking,comp.os.linux.security,comp.os.ms-windows.networking.tcp-ip,alt.conspiracy.area51
Subject: Re: MS caught breaking web sites
Date: Sun, 23 Apr 2000 12:58:45 GMT
Gary Connors <[EMAIL PROTECTED]> wrote
>
> If its a "NT replacement" is not on the desktop. In the real world, NT is
> not a desktop OS.
I guess I don't work in the real world. My desktop has had NT Workstation
for about a year.
------------------------------
From: [EMAIL PROTECTED] (M Sweger)
Subject: Re: howto set variable in shell script for exit status?
Date: 23 Apr 2000 16:04:51 GMT
Reply-To: [EMAIL PROTECTED]
Thanks. both ways worked!
M.
terry ([EMAIL PROTECTED]) wrote:
: M Sweger wrote:
: >
: > Hi,
: > I'm trying to return to a variable/environment variable the status
: > code of a shellscript that is a numerical value either negative or positive.
: > I keep getting the null value. Here's what I'm doing.
: >
: > t.sh contains
: >
: > #!/bin/sh
: >
: > exit 20
: >
: > I'm setting the environment variable as follows.
: >
: > err=`t.sh`
: >
: > however err is always null when echoingthe $err instead of 20.
: >
: Here are two things you can try.
: 1) Change the script
: #!/bin/sh
: echo 20
: exit 0
: 2) Keep the same script, use "$?" for exit code
: err=$?
: Hope this helps,
: Terry
--
Mike,
[EMAIL PROTECTED]
------------------------------
From: [EMAIL PROTECTED] (The Ghost In The Machine)
Crossposted-To:
comp.os.linux.advocacy,comp.os.ms-windows.advocacy,comp.os.ms-windows.nt.advocacy,comp.os.linux.networking,comp.os.linux.security,comp.os.ms-windows.networking.tcp-ip,alt.conspiracy.area51
Subject: Re: MS caught breaking web sites
Date: Sun, 23 Apr 2000 16:34:03 GMT
Followups trimmed to a dull roar. :-)
In comp.os.linux.advocacy, Gary Connors <[EMAIL PROTECTED]>
wrote on Sun, 23 Apr 2000 01:00:08 -0400
<[EMAIL PROTECTED]>:
>in article [EMAIL PROTECTED], laugh at [EMAIL PROTECTED] wrote on
>4/16/00 1:07 AM:
>
>> Robert,
>
>> And with Linux growing to 35% of all servers and 10% of desktops this year
>> alone
>> (half of those being NT replacements), there won't be much of an audience
>> for any future releases of windows when and if they do make it out.
>
>If its a "NT replacement" is not on the desktop. In the real world, NT is
>not a desktop OS.
How so?
NT is on quite a few desktops. Either you meant it should be on
servers only, on desktops AND servers, or it should be taken
off entirely for a true desktop OS -- whatever that is, I've
no idea. :-)
But NT + Office2000 makes a good desktop, from the standpoint
of convenience. (There are some issues with respect to interoperability
and reliability, though. Of course, desktops don't require great
reliability, although it does help -- the story of the DoD coffeepot
surviving a nuclear blast comes to mind for some reason. Interoperability
is because there are a lot of Unix boxes out there. :-) )
Linux makes a good server OS, but the desktop convenience isn't
quite there yet. (To be fair, I haven't evaluated KDE and Gnome
recently; I'm an old Unix-head and use fvwm (not fvwm2-95) as a
window manager, :-) and I'm not up on BeOS -- which sounds like the
hottest thing since the Amiga, from a multimedia standpoint.)
And Windows95/98 is good for....something. :-)
--
[EMAIL PROTECTED] -- insert random misquote here
------------------------------
Crossposted-To:
comp.os.linux.advocacy,comp.os.ms-windows.advocacy,comp.os.ms-windows.nt.advocacy,comp.os.linux.networking,comp.os.linux.security,comp.os.ms-windows.networking.tcp-ip,alt.conspiracy.area51
Subject: Re: MS caught breaking web sites
From: Sean LeBlanc <[EMAIL PROTECTED]>
Date: Sun, 23 Apr 2000 16:58:54 GMT
Gary Connors <[EMAIL PROTECTED]> writes:
I'm not sure what you mean by "NT is not a desktop OS"...when I contracted
at Corning-Asahi in State College, they had switched EVERYBODY to NT (in 1998).
"Everybody"
includes software engineers on down to secretaries...before they switched
everybody to NT, the group I worked with (IT) had been using NT since at
least 1996 (that means NT 3.51). NT was also used for server end, too, with
a healthy mix of VMS for legacy stuff. I think Corning counts as the real
world.
NT may not be without problems, but it
makes the perfect desktop, IMHO, given the right hardware. 95/98 only
create maintenance and security nightmares in the corporate environment.
Arguments that NT is not really fit for high-end server stuff I could believe,
but not fit to be a workstation? You've got to be kidding.
> in article [EMAIL PROTECTED], laugh at [EMAIL PROTECTED] wrote on
> 4/16/00 1:07 AM:
>
> > Robert,
>
> > And with Linux growing to 35% of all servers and 10% of desktops this year
> > alone
> > (half of those being NT replacements), there won't be much of an audience
> > for any future releases of windows when and if they do make it out.
>
> If its a "NT replacement" is not on the desktop. In the real world, NT is
> not a desktop OS.
------------------------------
** 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
******************************