Linux-Development-Sys Digest #760, Volume #8 Wed, 30 May 01 17:13:11 EDT
Contents:
Re: environment variable confusion ([EMAIL PROTECTED])
gdb message when debuging (Charles Wilkins)
/usr/local/include is a file not directory (Bob Glauser)
Re: chainge in struct sk_buff doesn't quite work ([EMAIL PROTECTED])
Low cost timer-counter pci board w/Linux driver? (Chris)
Re: /usr/local/include is a file not directory ("Karl Heyes")
Re: C++ linux server to java client: connection problem ("Somkith Chai")
Re: GNU_SOURCE (Martin von Loewis)
/proc/sys/vm/freepages read-only (bill davidsen)
Re: linux smp/RT development question. (bill davidsen)
Re: environment variable confusion (Eric Taylor)
BSD signal (Derek Viljoen)
Re:Where can I get a PCI Card (k)
Re: Timed Loop in Kernel Module ("Norm Dresner")
Re: /usr/local/include is a file not directory (Bob Glauser)
----------------------------------------------------------------------------
From: [EMAIL PROTECTED]
Subject: Re: environment variable confusion
Date: 30 May 2001 03:05:32 -0700
In article <[EMAIL PROTECTED]>,
Eric Taylor <[EMAIL PROTECTED]> wrote:
>I am debugging code (written by others) that restore a program
>to a prior state by reading in saved areas of memory including
>the stack. It works fine, except for problems with environment
>variables.
>
>Some questions:
>
>1. How is the variable environ set up. It appears to be
>located at different addresses depending on the program.
>Where does it get it's "initial" value. Can't this value be
>at different locations?
See 3. below. The environment strings and array are on the stack at
the time the program begins. Some code in the libc setup apparently
sets the array address into the "environ" variable.
>2. Do all routines that support environment variables find
>variables using environ? What happens if the base code (non
>library) does not include environ, and a dll gets called which
>does need this? How is this accomplished?
If the environ variable is referenced in the non-library code, it is
somehow assigned to "common" during the linking phase. If you build
something with "-Wl,-M" you can see it. In any case there is a "weak"
environ variable inside libc.so, which can be found by other shared
libraries.
>3. Does the shell set these up when it forks off to a new process?
The actual environment strings and the associated array of pointers are
set up by the kernel during exec() processing. (Take a look at the code
for execve() in fs/exec.c and create_elf_tables() in fs/binfmt_elf.c.)
Given a shared library which references environ, test cases work both
for linking with that library and calling it via dlopen().
--
B. D. Elliott [EMAIL PROTECTED]
------------------------------
From: [EMAIL PROTECTED] (Charles Wilkins)
Subject: gdb message when debuging
Date: Wed, 30 May 2001 13:01:38 GMT
Reply-To: [EMAIL PROTECTED]
When i run gdb, I get warning: unable to find dynamic linker
breakpoint function.
GDB will be unable to debug shared library initializers and track
explicitly loaded dynamic code.
Any ideas why this comes up?
Here is my config.status:
#!/bin/sh
# This file was generated automatically by configure. Do not edit.
# This directory was configured as follows:
./configure --host=i686-pc-linux-gnu --norecursion
# using "mt-frag"
the target and host are one and the same
Best regards,
Charles
------------------------------
From: [EMAIL PROTECTED] (Bob Glauser)
Subject: /usr/local/include is a file not directory
Date: 30 May 2001 06:40:55 -0700
When I try to compile any files, I get the error that
/usr/local/include is not a directory. I have checked for the
directory, and in the /usr/local directory, is a file named include.
I do not know what this file is or why I have it in place of the
directory.
I cannot compile many of the programs I would like to run, and need a
solution to this problem.
I am running RedHat Linux on a P166 with 32M Ram.
------------------------------
From: [EMAIL PROTECTED]
Subject: Re: chainge in struct sk_buff doesn't quite work
Date: Wed, 30 May 2001 13:57:45 GMT
On Wed, 30 May 2001 10:18:19 +0400, Vyacheslav Burdjanadze
<[EMAIL PROTECTED]> wrote:
>> Because it oopses everytime (shortly or directly after the login
>Did you rebuild entire kernel and all modules?
yes, I did
make mrproper dep bzImage modules modules_install
------------------------------
From: [EMAIL PROTECTED] (Chris)
Crossposted-To:
comp.hardware,comp.os.linux.hardware,comp.os.linux.embedded,comp.os.linux.misc
Subject: Low cost timer-counter pci board w/Linux driver?
Date: 30 May 2001 07:00:34 -0700
Hi,
We are looking for a low cost PCI timer/counter boards, that there are
linux drivers for.
Thus far, the only one we have been able to find is an ISA board
(CIO-CTR05) (http://www.measurementcomputing.com) and the driver at
the Linux Lab Project (http://www.llp.fu-berlin.de)
We have found several DAC boards with timers and Linux drivers but we
are looking for low cost counter/timer board.
The timers must have at least microsecond if not nanosecond
resolution.
Does anyone have any suggestions where we can find one other than the
PCI-CTR05 (which would need to have the CIO driver modified for)?
Thanks
C.
------------------------------
From: "Karl Heyes" <[EMAIL PROTECTED]>
Subject: Re: /usr/local/include is a file not directory
Date: Wed, 30 May 2001 15:32:51 +0100
In article <[EMAIL PROTECTED]>, "Bob Glauser"
<[EMAIL PROTECTED]> wrote:
> When I try to compile any files, I get the error that /usr/local/include is
> not a directory. I have checked for the directory, and in the /usr/local
> directory, is a file named include. I do not know what this file is or why I
> have it in place of the directory.
> I cannot compile many of the programs I would like to run, and need a
> solution to this problem.
> I am running RedHat Linux on a P166 with 32M Ram.
It should be a directory, don't know how it has become a file. Check it's
contents with either cat or use file /usr/local/include. If it's empty or
you cannot determine was it is try
rpm -qf /usr/local/include
to find if a dodgy rpm has installed it.
then either move it out of the way or delete it.
karl.
------------------------------
From: "Somkith Chai" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: Re: C++ linux server to java client: connection problem
Date: Wed, 30 May 2001 11:27:45 -0400
Mike Hebert wrote ...
> Somkith Chai wrote:
>
> > Hello,
> >
> > I'm running into problems sending data between my server and client. My
> > server is compiled using Linux C++ and my client is on java. I'm
getting a
> > Connection refused on the java side. I've also seen situations with the
> > error Connection reset by peer. Similar server code compiled on Solaris
> > works fine. It looks like the close() is terminating the connection
> > prematurely on Linux. If I put a sleep just before the close()
statement,
> > the data is sent. Can anyone tell me what is going on? I've copied my
> > code below.
>
> > ret = write(sd_out, buf, 50000);
> > printf("write returned %d...\n", ret);
>
> I wonder: does it work if you use a "send" here rather than a "write"?
>
> Another thing to try is a fflush(sd_out) just before you close the
> connection.
>
> Let me know if these work!
>
The same problem occurs when using send(...) and the fflush(...) doesn't
seem to work at all.
Anyhow, I ended up just delaying the close statement to keep the connection
open for as long as possible.
Thanks,
Somkith
------------------------------
From: Martin von Loewis <[EMAIL PROTECTED]>
Subject: Re: GNU_SOURCE
Date: 30 May 2001 17:50:25 +0200
Nix <$}xinix{[email protected]> writes:
> ,----
> | We recommend you use `_GNU_SOURCE' in new programs. If you don't
> | specify the `-ansi' option to GCC and don't define any of these macros
> | explicitly, the effect is the same as defining `_POSIX_C_SOURCE' to 2
> | and `_POSIX_SOURCE', `_SVID_SOURCE', and `_BSD_SOURCE' to 1.
> `----
>
> (Not _GNU_SOURCE.)
>
> > The default is _GNU_SOURCE if no option is given to gcc, and
>
> What makes you think this?
I was confused. I remembered it would define "many" functions, but
mistook this that it would define everything it has.
Regards,
Martin
------------------------------
From: [EMAIL PROTECTED] (bill davidsen)
Subject: /proc/sys/vm/freepages read-only
Date: Wed, 30 May 2001 15:53:11 +0000 (UTC)
I am trying to upgrade a system and find that with 2.4 kernels there
seems to be a problem tuning memory using /proc/sys/vm/freepages. Since
I really need to tune this to force a resonable number of free pages to
be available, this recent change prevents upgrading the system. I hope
this is just some option which both Redhat and I have set wrong, I
really want to upgrade to 2.4 on this machine.
Because the algorithm may suddenly need 16-24MB of addition memory
space, and performance is really grim if that requires waiting for
physical disk i/o, I have to force Linux to keep space available "right
now." Adding memory is not an option, no matter how much RAM is
available, w/o freepages there are not always clean buffers unless the
o/s makes an effort to get them. On a 2GB machine the system has 1.7GB
buffers + cached and <2MB free. The malloc and init can take hundreds of
ms on 2.4, indicating (I believe) that the pages in memory are dirty.
Is there an option to set in the kernel build to make this work properly
again? I can hack the kernel to always give me more, or play with
buffermem and other settings trying to get around this, but Linux has
never taken the "I know better than you, do it my way" approach, that's
the way that other o/s works.
Before I start grinding through that part of the kernel code I thought
I'd ask,
--
bill davidsen <[EMAIL PROTECTED]> CTO, TMR Associates, Inc
At LinuxExpo Sun was showing Linux applications running on Solaris.
They don't get it, the arrow points the other way. There's a reason why
there's no SolarisExpo, Solaris is a tool; Linux is a philosophy, a
religion, a way of life, and only incidentally an operating system.
------------------------------
From: [EMAIL PROTECTED] (bill davidsen)
Subject: Re: linux smp/RT development question.
Date: Wed, 30 May 2001 16:11:36 +0000 (UTC)
In article <[EMAIL PROTECTED]>, khz <[EMAIL PROTECTED]> wrote:
| to portabillity issues i could say that i plan to change the less
| possible on the linux kernel. the rt-process should only communicate
| (shared memory) and do i/o on the parallel port (just for testing
| purposes). it's planed to go from parallel to some fast network
| connection or bus system. but as said i think it's much harder to
| implement drivers from scratch for rtlinux than to alter one of the
| numerous existing ones for linux. and if it's just adding a new driver
| and syscall, derived from existing ones, and not changing existing
| syscalls it should be 'easy' to port since it is just the one syscall.
| my rt processes should definetly not use all possible i/o or
| communication methods.
I think you missed what I said, let me try one more time. Your rt
process does whatever it is doing, and puts requests in shared memory,
and gets return info from shared memory. It does not do i/o, it does not
do system calls, it just does whatever you want done rt, and leaves all
of the non-deterministic operations to a Linux process.
I'm not at all clear what the rt process actually does, why it can only
run on one CPU, any why SetPriorityClass() wouldn't do as well. It
sounds as if you are dedicating one CPU per system to doing something
very important, but I don't quite see what it is, some totally
CPU-bouncd application, perhaps? I would think that running the
application on all CPUs would be faster, but I don't know your needs.
Perhaps you will be generating so many support calls in the distributed
memory that you will ned them for overhead?
In any case, having the rt process do slow operations like i/o and
systems calls seems to defeat the objective of being rt unless the i/o
is so vast that it actually ties up a whole CPU.
--
bill davidsen <[EMAIL PROTECTED]> CTO, TMR Associates, Inc
At LinuxExpo Sun was showing Linux applications running on Solaris.
They don't get it, the arrow points the other way. There's a reason why
there's no SolarisExpo, Solaris is a tool; Linux is a philosophy, a
religion, a way of life, and only incidentally an operating system.
------------------------------
From: Eric Taylor <[EMAIL PROTECTED]>
Subject: Re: environment variable confusion
Date: Wed, 30 May 2001 17:41:04 GMT
[EMAIL PROTECTED] wrote:
I looked at exec.c and I see calls to copy_string, which
copies (i think) the environment up into kernel space. Then,
later, I guess it copies it back into the new process (is this
right?).
Since environ is a pointer to an array of pointers, I take it that
this same procedure must re-create this pointer array. Is this
array also at the top of the stack, and do these 2 items (the
strings themselves and the pointer array) both end up at the top
of the stack?
Is there anything on the stack below this that has to point to
something in the environment, since my restore is failing
if I change the environment and then try to restore the program
stack.
Are there any guard pages that might cause a segment fault
if I go messing around here?
And lastly, when I add an environment variable, how and who
determines where these go; is memory moved up/down to make room,
or recover room.
sorry for so many questions
thanks
eric
> In article <[EMAIL PROTECTED]>,
> Eric Taylor <[EMAIL PROTECTED]> wrote:
> >I am debugging code (written by others) that restore a program
> >to a prior state by reading in saved areas of memory including
> >the stack. It works fine, except for problems with environment
> >variables.
> >
> >Some questions:
> >
> >1. How is the variable environ set up. It appears to be
> >located at different addresses depending on the program.
> >Where does it get it's "initial" value. Can't this value be
> >at different locations?
>
> See 3. below. The environment strings and array are on the stack at
> the time the program begins. Some code in the libc setup apparently
> sets the array address into the "environ" variable.
>
> >2. Do all routines that support environment variables find
> >variables using environ? What happens if the base code (non
> >library) does not include environ, and a dll gets called which
> >does need this? How is this accomplished?
>
> If the environ variable is referenced in the non-library code, it is
> somehow assigned to "common" during the linking phase. If you build
> something with "-Wl,-M" you can see it. In any case there is a "weak"
> environ variable inside libc.so, which can be found by other shared
> libraries.
>
> >3. Does the shell set these up when it forks off to a new process?
>
> The actual environment strings and the associated array of pointers are
> set up by the kernel during exec() processing. (Take a look at the code
> for execve() in fs/exec.c and create_elf_tables() in fs/binfmt_elf.c.)
>
> Given a shared library which references environ, test cases work both
> for linking with that library and calling it via dlopen().
> --
> B. D. Elliott [EMAIL PROTECTED]
------------------------------
From: Derek Viljoen <[EMAIL PROTECTED]>
Subject: BSD signal
Date: Wed, 30 May 2001 13:40:31 -0400
Reply-To: [EMAIL PROTECTED]
Does anyone know where the bsd/signal.h file went?
I'm using RedHat 6.2. The man page for signal() says that if you want
bsd semantics (I'm assuming this means reliable signals...) then include
<bsd/signal.h> instead of <signal.h>. But this is not anywhere on my
system... (well there is one in bcc ...)
I've already surmised that it's not included in bsd-compat. Anyone?
--
___ __ _ * [EMAIL PROTECTED]
/ ) _ _ _ / / / . / . _ _ _ * (609) 734-3061 (W)
(_/__/ (/_/__(/__/< (_/ /_/_/_(_)_(/_( )__ * ICBM Addr: 39N 58' 21"
_/ * 74W 47' 49"
------------------------------
From: k <[EMAIL PROTECTED]>
Subject: Re:Where can I get a PCI Card
Date: Wed, 30 May 2001 18:33:51 GMT
>I have a request. Do You know from where i may be able to get a PCI
>demo
>card which is 64/66Mhz, and has memory in it or fpga.
>thanks,
>Divyadeep Wadhwa
PLX Technologies->www.plxtech.com has PCI Demo cards.
later,
k
------------------------------
From: "Norm Dresner" <[EMAIL PROTECTED]>
Subject: Re: Timed Loop in Kernel Module
Date: Wed, 30 May 2001 19:19:38 GMT
Somya <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> Hi!
> I am writing a kernel module which requires to poll the SCSI
disk
> at regular intervals to look for data. I just wanted to know
the way
> so as to execute this interval ..Is there something like
timed
> loop..I am working in Linux Red hat(6.2) kernel(2.2.14)..
> Kindly help me out.
> Thanks in advance,
> somya
There's a simple way to execute kernel code at the same rate as the "system
clock". It's defined in /usr/include/asm/param.h as HZ which is the
frequency of the basic clock interrupt. If you have an unmodified x86
system, it's 100 Hz; alpha's run at 1024 Hz IIRC. There are several ways of
creating a timer-task to be called each interrupt (or once every N
interrupts) of this clock. Rubini's book on Linux Device Drivers has a good
discussion of this.
If you need something faster than the HZ rate, you have to do something
special. The two solutions I know about are:
1. Change HZ to a higher value and recompile the entire kernel; I've
heard that some utility programs may have to be recompiled too.
2. Use a Real-Time Operating System (RTOS). The one closest to Linux is
Real-Time Linux. You can specify the rate at which you want a real-time
task to run as any fraction of the underlying motherboard oscillator
(1.19... MHz).
http://www.rtlinux.org
Norm
------------------------------
From: [EMAIL PROTECTED] (Bob Glauser)
Subject: Re: /usr/local/include is a file not directory
Date: 30 May 2001 13:33:53 -0700
"Karl Heyes" <[EMAIL PROTECTED]> wrote in message
news:<[EMAIL PROTECTED]>...
> In article <[EMAIL PROTECTED]>, "Bob Glauser"
> <[EMAIL PROTECTED]> wrote:
>
>
> > When I try to compile any files, I get the error that /usr/local/include is
> > not a directory. I have checked for the directory, and in the /usr/local
> > directory, is a file named include. I do not know what this file is or why I
> > have it in place of the directory.
>
> It should be a directory, don't know how it has become a file. Check it's
> contents with either cat or use file /usr/local/include. If it's empty or
> you cannot determine was it is try
>
> rpm -qf /usr/local/include
>
> to find if a dodgy rpm has installed it.
>
> then either move it out of the way or delete it.
>
> karl.
The file contains code, I'm pretty sure it is c.
I have put the file here: http://www.angelfire.com/goth/rwg1226/include.txt , if
anyone can help me figure out what it is, how it got there, and what I need to
do with it to make my apps work, I would be very grateful.
------------------------------
** 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 by posting to the
comp.os.linux.development.system newsgroup.
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
******************************