Linux-Development-Sys Digest #919, Volume #7 Wed, 31 May 00 04:13:14 EDT
Contents:
Re: LDFLAGS doesn't work as expected w/ GNU Make ("Arthur H. Gold")
Increase the priority of a thread... how? (Tom Thorne)
Re: coredump files ("David E. Fox")
Re: Increase the priority of a thread... how? ("Norman Black")
pages from get_free_page swappable? (Grant Edwards)
Killing a thread created by kernel_thread() ("Soumyendu Sarkar")
How do I GET Linux (Firepole803)
killing thread created by kernel_thread() ("Sean Bose")
Re: LDFLAGS doesn't work as expected w/ GNU Make (H. Peter Anvin)
Re: How do I GET Linux ("Frank")
Re: How do I GET Linux (Joe Pfeiffer)
Re: Linker does not find libs in some cases (Daniel Kiracofe)
Re: assembler problems (Robert Redelmeier)
Re: Technical advantages/disadvantages of Linux (Warren Young)
linking problem ("Duke Lee")
Re: Beginner Question. (Lew Pitcher)
Re: assembler problems (Josef Moellers)
Re: System integrity check (was Re: ps does not show all processes) (Neal Tucker)
Re: linking problem ([EMAIL PROTECTED])
Re: linking problem ("Jerome Tollet")
----------------------------------------------------------------------------
Date: Tue, 30 May 2000 11:16:44 -0500
From: "Arthur H. Gold" <[EMAIL PROTECTED]>
Subject: Re: LDFLAGS doesn't work as expected w/ GNU Make
"William D. Ezell" wrote:
>
> I'm venturing into Liunx development for the first time and am
> encountering unexpected behavior from GNU Make 3.77. Essentially, the
> following Makefile target links as expected:
>
> collapse: collapse.o spropcase.o
> gcc -o collapse collapse.o spropcase.o
> -L/usr/local/mysql/lib/mysql \
> -lmysqlclient -lnsl
>
> (actual Makefile has all gcc options on same line, e.g., no '\' )
>
> However, the following construction yields series of 'undefined
> reference to function xxx' error messages (which appear to result from
> link failures):
>
> LDFLAGS = -L/usr/local/mysql/lib/mysql -lmysqlclient -lnsl
> collapse: collapse.o spropcase.o
> gcc -o collapse collapse.o spropcase.o
>
> Shouldn't the LDFLAGS Make variable serve the same purpose as inline
> linker parameters (as in the first syntax)? I'm sure I'm overlooking
> something simple but can't seem to make this work.
>
> My environment:
>
> Red Hat 6.1 (2.2.12-20)
> GNU Make 3.77
> gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
>
> Advice and/or enlightenment appreciated. Please reply via e-mail if
> possible (note the anti-spam instructions below).
>
> Thanks,
> William D. Ezell
>
> ****** To reply, remove the "~" from "wd~[EMAIL PROTECTED]" ******
>
> ----------------------------------------------------------------------
> Proud Member, US Federal Witness Protection Program
> ----------------------------------------------------------------------
There's nothing magic about the LDFLAGS variable; it's merely a
convention.
In order to use it, you need to mention it, i.e.:
LDFLAGS = -L/usr/local/mysql/lib/mysql -lmysqlclient -lnsl
collapse: collapse.o spropcase.o
gcc -o collapse collapse.o spropcase.o ${LDFLAGS}
HTH,
--ag
--
Artie Gold, Austin, TX (finger the cs.utexas.edu account for more info)
mailto:[EMAIL PROTECTED] or mailto:[EMAIL PROTECTED]
--
"I've had a perfectly wonderful evening. But this wasn't it." - G. Marx
------------------------------
From: [EMAIL PROTECTED] (Tom Thorne)
Subject: Increase the priority of a thread... how?
Date: Tue, 30 May 2000 16:31:10 GMT
I have an application where I want to increase the priority of one
thread of a process.
>From my reading of the man pages, I can only do that if the process
has superuser privileges. Unfortunately, it doesn't.
That leaves me to decrease the priority of all the other threads...
but that means that my App will run at lower priority than other apps
on the system... not good.
Am I missing something here? Designating a thread as higher priority
to others in the same process I thought would be a useful thing to do.
Tom Thorne <tomt at flyingpig dot com>
------------------------------
From: "David E. Fox" <[EMAIL PROTECTED]>
Subject: Re: coredump files
Date: Tue, 30 May 2000 10:52:14 -0800
In article <[EMAIL PROTECTED]>, John Gluck
<[EMAIL PROTECTED]> wrote:
>
> I have never really looked at the mechanism for producing coredumps. I
> think it's in the kernel somewhere. I suppose it would be possible to
> change it so that it does something like append the date and time to the
Sure it's in the kernel (somewhere) :).
ISTR that early versions of Linux added the process name to the
core - like 'core.ls' for instance. However, that functionality was
removed fairly quickly.
------------------------------
From: "Norman Black" <[EMAIL PROTECTED]>
Subject: Re: Increase the priority of a thread... how?
Date: Tue, 30 May 2000 12:46:03 -0700
Reply-To: "Norman Black" <[EMAIL PROTECTED]>
In Linux only real time threads (SCHED_RR, SCHED_FIFO) have a priority.
Applications start as SCHED_OTHER. In Linux if you look at the min and max
values for priorities for SCHED_OTHER threads you see that (min = 0) and
(max = 0). Other Unix systems may differ. I believe that only super user
processes can be real time processes, therefore the super user priority
change restriction.
Be careful of real time threads since they can starve all other threads in
the system of CPU time. Most of the kernel threads are running as
SCHED_OTHER processes these days. If it is good enough for them it may be
good enough for your app.
What problems are you seeing in your app to need a priority change.
--
Norman Black
Stony Brook Software
the reply, fubar => ix.netcom
"Tom Thorne" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> I have an application where I want to increase the priority of one
> thread of a process.
>
> From my reading of the man pages, I can only do that if the process
> has superuser privileges. Unfortunately, it doesn't.
>
> That leaves me to decrease the priority of all the other threads...
> but that means that my App will run at lower priority than other apps
> on the system... not good.
>
> Am I missing something here? Designating a thread as higher priority
> to others in the same process I thought would be a useful thing to do.
>
>
> Tom Thorne <tomt at flyingpig dot com>
------------------------------
From: [EMAIL PROTECTED] (Grant Edwards)
Subject: pages from get_free_page swappable?
Date: Tue, 30 May 2000 20:17:48 GMT
Are the pages allocated by get_free_page(GFP_KERNEL) swappable?
I need to allocate a large buffer (256K) to hold microcode to
be download to a device by a kernel module (a daemon reads the
microcode from disk and passes it to the module via an ioctl()
during system initialization).
The microcode is required at startup and possibly later if the
device gets reset. If the buffer is swappable, I'm going to
allocate it at startup and then just leave it there. If it's
not swappable, then I'll proabably do it anyway, but I'll feel
guilty about it.
(And plan on someday implementing a scheme where the module can
request the data from the daemon each time it is needed.)
--
Grant Edwards grante Yow! I wonder if I should
at put myself in ESCROW!!
visi.com
------------------------------
From: "Soumyendu Sarkar" <[EMAIL PROTECTED]>
Subject: Killing a thread created by kernel_thread()
Date: Tue, 30 May 2000 16:30:11 -0400
Hi
Can someone please help me by suggesting the cleanest method
to kill a forked thread that I created using the function kernel_thread().
The thread was created during init_module().
Sean Bose
------------------------------
From: Firepole803 <[EMAIL PROTECTED]>
Subject: How do I GET Linux
Date: Tue, 30 May 2000 20:30:11 GMT
I've been reading all about Linux for days, but nowhere does it say "click
here to get Linux". Do I download kernels, or what? A little help,
please?
--
Posted via CNET Help.com
http://www.help.com/
------------------------------
From: "Sean Bose" <[EMAIL PROTECTED]>
Subject: killing thread created by kernel_thread()
Date: Tue, 30 May 2000 16:46:43 -0400
Hi
Can someone please suggest me the cleanest way to kill
a thread created by forking using the kernel_thread() function.
The thread was created in init_module().
Sean Bose
________________________________
email: [EMAIL PROTECTED]
------------------------------
From: H. Peter Anvin <[EMAIL PROTECTED]>
Subject: Re: LDFLAGS doesn't work as expected w/ GNU Make
Date: 30 May 2000 13:52:52 -0700
Followup to: <[EMAIL PROTECTED]>
By author: wd~[EMAIL PROTECTED]
In newsgroup: comp.os.linux.development.system
>
> I'm venturing into Liunx development for the first time and am
> encountering unexpected behavior from GNU Make 3.77. Essentially, the
> following Makefile target links as expected:
>
> collapse: collapse.o spropcase.o
> gcc -o collapse collapse.o spropcase.o
> -L/usr/local/mysql/lib/mysql \
> -lmysqlclient -lnsl
>
> (actual Makefile has all gcc options on same line, e.g., no '\' )
>
>
> However, the following construction yields series of 'undefined
> reference to function xxx' error messages (which appear to result from
> link failures):
>
> LDFLAGS = -L/usr/local/mysql/lib/mysql -lmysqlclient -lnsl
> collapse: collapse.o spropcase.o
> gcc -o collapse collapse.o spropcase.o
>
>
> Shouldn't the LDFLAGS Make variable serve the same purpose as inline
> linker parameters (as in the first syntax)? I'm sure I'm overlooking
> something simple but can't seem to make this work.
>
LDFLAGS, by convention, comes *before* the .o files. You want to set
the variable LIBS.
program: $(OBJS)
$(CC) $(LDFLAGS) -o program $(OBJS) $(LIBS)
-hpa
--
<[EMAIL PROTECTED]> at work, <[EMAIL PROTECTED]> in private!
"Unix gives you enough rope to shoot yourself in the foot."
------------------------------
From: "Frank" <[EMAIL PROTECTED]>
Subject: Re: How do I GET Linux
Date: Tue, 30 May 2000 21:23:36 GMT
Firepole803 <[EMAIL PROTECTED]>...
^
^ I've been reading all about Linux for days, but nowhere does it say "click
^ here to get Linux". Do I download kernels, or what? A little help,
^ please?
It depends. Start here: <http://www.linux.org/>.
Frank
------------------------------
From: Joe Pfeiffer <[EMAIL PROTECTED]>
Subject: Re: How do I GET Linux
Date: 30 May 2000 15:26:18 -0600
Firepole803 <[EMAIL PROTECTED]> writes:
> I've been reading all about Linux for days, but nowhere does it say "click
> here to get Linux". Do I download kernels, or what? A little help,
> please?
The most convenient way is to go down to a book- or software-store,
and a buy a distribution like RedHat, SuSE, Mandrake, or any of the
others you come across.
Which distributions are best is a matter of religious fervor; I'm
happy with my RedHat 6.2.
--
Joseph J. Pfeiffer, Jr., Ph.D. Phone -- (505) 646-1605
Department of Computer Science FAX -- (505) 646-1002
New Mexico State University http://www.cs.nmsu.edu/~pfeiffer
VL 2000 Homepage: http://www.cs.orst.edu/~burnett/vl2000/
------------------------------
From: Daniel Kiracofe <[EMAIL PROTECTED]>
Subject: Re: Linker does not find libs in some cases
Date: Tue, 30 May 2000 19:24:26 -0400
> I am not an advanced user and I am having problems linking some of my C++
> programs.
> I use SuSE-Linux 6.2 and g++ (egcs 2.91.66). The linker does often not find
> libraries which are
> accessed via a softlink. For example:
>
> Linker command:
>
> g++ -Wl,shared -L/usr/oracle/V8.0.5/lib -lclntsh ...
>
> The error-message says "clntsh: no such file or directory ..."
>
> When I look into the directory I can find the following:
>
> lrwxrwxrwx 1 root root 16 Feb 7 20:00 libclntsh.so ->
> libclntsh.so.1.0*
> -rwxr-xr-x 1 oracle dba 4381924 Feb 7 19:48 libclntsh.so.1.0*
>
> When I change the linker command to the following:
>
> -Wl,-static -L/usr/oracle/V8.0.5/lib /usr/oracle/V8.0.5/lib/libclntsh.so
>
> then it works.
>
> What can the problem be? I have this kind of problem experienced with many
> different libs and also while I was trying to include some header-files. I
> am a kind of deserted here ...
Perhaps you need to add /usr/oracle/V8.0.5/lib to /etc/ld.so.conf and
re-run ldconfig.
--
/* Daniel */
E-mail: [EMAIL PROTECTED]
Webpage: http://www.cis.ohio-state.edu/~kiracofe
"Fear is only afraid of the absence of itself" - Mediocrates
------------------------------
From: Robert Redelmeier <[EMAIL PROTECTED]>
Subject: Re: assembler problems
Date: Tue, 30 May 2000 19:18:43 -0500
frank sinner wrote:
> i've got an assembler programm which was written for windows NT. I would
> like to port it to LINUX. Which programm should i use? NSAM has serious
> problems with the code!!
Well, I presume you're using NASM to get Intel syntax (instead
of the AT&T syntax used by gcc/gas) and there aren't any MASM
specific macros included. (If there are, you have to translate them).
Your major problem will be with OS calls. Things like `call
GetCurrentProcess`, or worse yet, `invoke SetPriority`. These
things have to be translated to something Linux understands,
like `libc` calls [`call printf`] or the corresponding bare-metal
Linux syscalls (`int 0x80`). This is not a trivial effort.
AFAIK, WINE has been laboring at just this.
If your ASM is full of I/O boxes and such, you are in for a world
of pain, because you will also have to learn `X` programming
if WINE won't work for you. OTOH if the ASM is just what it
should be: some fast bashing on memory or ports without syscalls,
then the porting is easy. My `cpuburn` package was almost trivial
to port to MS-Win32, and vice versa would have been even easier.
-- Robert author `cpuburn` http://users.ev1.net/~redelm
------------------------------
Date: Tue, 30 May 2000 20:28:09 -0600
From: Warren Young <[EMAIL PROTECTED]>
Subject: Re: Technical advantages/disadvantages of Linux
Josef Moellers wrote:
>
> I was asked to present a paper on the technical advantages and
> disadvantages of Linux (compared to other Unices). Is there a website
> that I could tap for information?
The link below will direct you to my Linux/UnixWare comparisons.
They're in the process of being changed right now, but for the most part
they're accurate.
--
= Warren -- See the *ix pages at http://www.cyberport.com/~tangent/ix/
=
= ICBM Address: 36.8274040 N, 108.0204086 W, alt. 1714m
------------------------------
From: "Duke Lee" <[EMAIL PROTECTED]>
Subject: linking problem
Date: Tue, 30 May 2000 19:41:16 -0700
I am trying to learn how to write kernel module. I have copied section of
code from "Linux Kernel Module Programming Guide" by Ori Pomerantz,
specifically procfs.c. When I tried to compile in RedHat 6.2 Distribution
with the suggested Makefile from the guide. I get the following when I
compile
procfs.c:80: warning: implicit declaration of function 'sprintf_R3c2c5af5'
and when I do "insmod procfs.c" I get
procfs.o: unresolved symbol __put_user_X
procfs.o: unresolved symbol __get_user_X
I already checked to I see that uaccess.h is included in the procfs.c file.
I can't think of anything else I can do to make this work. Can someone
help?
duke
------------------------------
From: Lew Pitcher <[EMAIL PROTECTED]>
Subject: Re: Beginner Question.
Date: Wed, 31 May 2000 04:09:09 GMT
"Steven M. Duhaime" wrote:
>
> I'm learning C out of books for now, or at least I'm going to try. My
> problem is very basic. How can I use 'cout'? I haven't been able to find
> reference to 'printf', and my books don't work with it. I found the
> 'iostream.h' header file in another directory, but I still can't compile
> my beginner programs.
>
> any solutions?
> steve....
Your confusion stems from the fact that you seem to be trying to learn
how to program in C by reading a book on programming in C++. They are
two different languages, and trying to learn one from a book written
about the other is a mistake. Get a good book on C, and learn from it
instead.
BTW: cout and iostream aren't C constructs; they belong to C++. C uses
printf(), and <stdio.h>
--
Lew Pitcher
Master Codewright and JOAT-in-training
------------------------------
From: Josef Moellers <[EMAIL PROTECTED]>
Subject: Re: assembler problems
Date: Wed, 31 May 2000 08:12:50 +0200
Robert Redelmeier wrote:
> Your major problem will be with OS calls. Things like `call
> GetCurrentProcess`, or worse yet, `invoke SetPriority`. These
> things have to be translated to something Linux understands,
> like `libc` calls [`call printf`] or the corresponding bare-metal
> Linux syscalls (`int 0x80`). This is not a trivial effort.
Never ever do "INT"s in an assembler program. You are much better off
using the appropriate wrapper from libc. They don't cost that much and
they guard you against future changes in the system call interface as
well as make your program moderately portable to other Unix derivates.
> AFAIK, WINE has been laboring at just this.
-- =
Josef M=F6llers
Fujitsu Siemens Computers
SHV Server DS 1
------------------------------
From: [EMAIL PROTECTED] (Neal Tucker)
Subject: Re: System integrity check (was Re: ps does not show all processes)
Date: 31 May 2000 00:30:48 -0700
Josef Moellers <[EMAIL PROTECTED]> wrote:
>Since you mention this ... is there a 100% secure method of checking the
>integrity of a set of installed files?
>I mean: even given the algorithm and a sample installation, a cracker
>cannot hide his presence?
>
>I have given this some thought recently and have not come up with a
>system that does not require external assistance. I.e. a system that can
>run on-line and produce a warning if anything suspicious is found.
How about this:
For each critical file, get the checksum after running the file through
crypt, and store the checksums somewhere. To check validity, do the
same and compare the results.In order to modify the checksum files so
that the validity check passes, the hacker would need your passphrase
for the crypt stage.
You still need to protect the validity checker program, such as by
storing it on read-only media.
-Neal Tucker
------------------------------
From: [EMAIL PROTECTED]
Subject: Re: linking problem
Date: 30 May 2000 23:55:31 -0700
In article <8h1u18$eu7$[EMAIL PROTECTED]>, "Duke says...
>
>I am trying to learn how to write kernel module. I have copied section of
>code from "Linux Kernel Module Programming Guide" by Ori Pomerantz,
>specifically procfs.c. When I tried to compile in RedHat 6.2 Distribution
>with the suggested Makefile from the guide. I get the following when I
>compile
>
>procfs.c:80: warning: implicit declaration of function 'sprintf_R3c2c5af5'
>
Well, some of us do not have the book, so was can't see the Makefile you
are using. Are we suppose to guess? ;)
>and when I do "insmod procfs.c" I get
>
humm, are you sure youy did the above? You are trying to load a C file as
a module??
>procfs.o: unresolved symbol __put_user_X
>procfs.o: unresolved symbol __get_user_X
>
>I already checked to I see that uaccess.h is included in the procfs.c file.
>I can't think of anything else I can do to make this work. Can someone
>help?
It would imagine it will be hard to load a source file into the kernel.
Nasser
------------------------------
From: "Jerome Tollet" <[EMAIL PROTECTED]>
Subject: Re: linking problem
Date: Wed, 31 May 2000 09:56:09 +0100
Reply-To: "Jerome Tollet" <[EMAIL PROTECTED]>
I wrote severals modules and i already got this message (unresolved symbol).
I resolved this problem by adding in my makefile the gcc option -O2. If you
don't enable this option, inlined functions are not inlined.
Jerome Tollet
[EMAIL PROTECTED]
Duke Lee <[EMAIL PROTECTED]> wrote in message
news:8h1u18$eu7$[EMAIL PROTECTED]...
>
------------------------------
** 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
******************************