Linux-Development-Sys Digest #318, Volume #8      Sun, 3 Dec 00 10:13:07 EST

Contents:
  Re: front ending libraries (even libc) ([EMAIL PROTECTED])
  Secret to depmod / modprobe ??? (Kaelin Colclasure)
  Re: Database in Redhat Linux (Victor Wagner)
  Re: front ending libraries (even libc) (Paul Kimoto)
  Kernel modules and Daemons - architecture question (Rui Antunes)
  Need help understanding /proc/pid/stat file ([EMAIL PROTECTED])
  Re: Deamons (Lew Pitcher)
  Need library reference (Mark Healey)
  Anyone know what is SKB Allocation Failed on Kernel Syslog? ("Leyland Chui")
  Re: Need library reference ("Robert J. Hansen")
  Re: Need library reference (Friedrich Dominicus)

----------------------------------------------------------------------------

From: [EMAIL PROTECTED]
Crossposted-To: comp.os.linux.development.apps
Subject: Re: front ending libraries (even libc)
Date: Sun, 03 Dec 2000 00:14:54 -0000

In comp.os.linux.development.system Paul Kimoto <[EMAIL PROTECTED]> wrote:

| This is not a c.o.l.d.system (i.e., kernel) matter.  Followups redirected.

The copy I got of your article had both comp.os.linux.development.system
and comp.os.linux.development.apps.  So it didn't do as you wanted for
some reason.  OTOH, this doesn't seem to be an apps matter to me, so I
just left it alone.  If c.o.l.d.system is for only kernel issues, and not
all system issues, then that leaves a gap in subject coverage.


| In article <[EMAIL PROTECTED]>,
| [EMAIL PROTECTED] wrote:
|> I'm starting to take a look at what might be needed to do library front
|> ending.  What I mean by that term is this.  An existing library, such as
|> libc, will have a complete set of its own functions.  The front ending
|> library will have a subset of the functions (possibly just a few, maybe
|> even just one).  I want to have, AT RUN TIME, for the front end library
|> to be preferred over the back end library for dynamic linkage.  If the
|> symbol is defined in the first library found, use that.  But if it is
|> found not in the first, but in the second, use that.  There needs to be
|> [no] conflict with respect to the fact that the second library also has
|> the same symbols found in the first.  I'm thinking of the first library
|> as a sort of mask layed over the second, hiding some symbols and having
|> its own versions of them instead.
|>
|> The above I think is easy.  Here's where it get's tricky.
|
| I believe that you can just LD_PRELOAD the first library, as long as the
| second library's (duplicated) functions are "weak".

And if they aren't "weak"?  Or how can I make them "weak" without relinking
that library?  It's certainly important that functions I don't replace
still get resolved from the library they are in, but that functions I do
replace get resolved to my library if they are references from the program
(but I believe inter-calls within the original library still need to call
only within that library, and not call mine).

The first of these I intend to test out is making readdir() get file names
in sorted order.  Of course that means my code will have to read the whole
directory at the first application readdir() call.  I think I can do this
with just readdir() and closedir() being interposed.  My readdir() would
lookup an array indexed by the pointer to find where it keeps all of the
names (building it the first time).  At closedir() it would free anything
that was not read.

So is readdir or closedir one of the "weak" ones?


|> The first library needs to be able to call the second library, even with
|> symbols the first library is exporting to the programs being linked to it.
|
| You should be able to call some libc functions by their alternate names,
| e.g., open() => __open(), if you want to replace the default open().  It
| appears that most libc functions aren't available in the way, however.  But
| because the common Linux libraries are LGPL, you could just rewrite the
| desired functions and put them in your first library, eliminating the need
| to call the second library's affected functions.

Possibly.  It does mean my library gets bigger and bigger doing this for
some things.

-- 
=================================================================
| Phil Howard - KA9WGN |   Dallas   | http://linuxhomepage.com/ |
| [EMAIL PROTECTED] | Texas, USA | http://phil.ipal.org/     |
=================================================================

------------------------------

From: Kaelin Colclasure <[EMAIL PROTECTED]>
Subject: Secret to depmod / modprobe ???
Date: 02 Dec 2000 17:29:16 -0800

Okay, this is *really* frustrating. It seems like it took less time to
conceive of, design and write my first loadable kernel module than
I've already spent trying to figure out how to have depmod index and
modprobe load the damn thing!

I've read the relevant man pages several times. It *seems*
straightforward enough -- depmod creates a list of inter-module
dependencies and modprobe uses it to figure out what insmod commands
to run in what order. Okay, simple enough. Except that no matter what
permutation of options I try depmod does *not* index my new module in
the relevant modules.dep. It does touch the file, so *something* is
going on! (No doubt I'll learn what next time I have to reboot my
system.)

And what exactly is supposed to be in /etc/modules.conf? Some of the
docs reference it having a list of paths to search, some say there's a
list of modules -- and the one on my system doesn't look like *either*.
---8<---
[kaelin@soyuz tnf]$ cat /etc/modules.conf
alias scsi_hostadapter ncr53c8xx
alias eth0 eepro100
alias parport_lowlevel parport_pc
alias usb-controller usb-uhci
--->8---
Oh, and of course there's no modules.conf man page. And there are
cross references to a modules(2) man page -- but it doesn't exist on
my system either. Sigh.

If someone could enlighten me on this one I'd really appreciate it.

-- Kaelin

------------------------------

From: [EMAIL PROTECTED] (Victor Wagner)
Crossposted-To: 
comp.os.linux.development.apps,comp.os.linux.apps,comp.os.linux.misc,comp.lang.java.databases,comp.databases.informix,comp.databases.oracle.server,comp.databases.sybase,comp.databases.pick,comp.databases.ibm-db2,comp.databases.oracle.misc
Subject: Re: Database in Redhat Linux
Date: 2 Dec 2000 23:16:51 +0300

In comp.os.linux.misc Anthony W. Youngman <[EMAIL PROTECTED]> wrote:
:>: And it's a real pity that there are so many people who think that the
:>: only valid type of database is a SQL database.
:>
:>Sincerely, I never seen any other kind of database which is usable
:>without writing special program for any query. SQL is only practical
:>solution've seen, which allows you to type queries in interactively.
:>There is also QBE, but it doesn't count, becouse it is
:>a) relational
:>b) if fully implementted is functionally equivalent to SQL.
:>
: Ask an END USER to run a query over four entities. Oh, by the way,
: there's a many-to-many relationship in there somewhere...

Using QBE? Just easy - draw a line by mouse here, there and elsewhere
and you've four entities linked together.

Using SQL? a bit more difficult. You have to tell stupid machine that
value of TYPE_ID is this table should be equal to TYPE_ID in that table,
but tell on almost plain English.



:>Restriction which mySQL places on the programmers are worst of all - they
:>causes them to PROGRAM, instead of to DESIGN.
:>
: I don't know mySQL that well, but you need some programming for
: anything. If you mean triggers, data integrity etc, I gather mySQL was
: designed for fast extraction, and it sounds like you're using the wrong
: tool for the job...

I don't use it, and probably never would. Becouse I cannot imagine a
problem which wouldn't benefit from good decomposition. If it is tabular
by nature, it would need something more relational than mySQL. 

If not, it is better to use something ENTIRELY different.

Even if it is not possible to decompose tables, program might benefit
from distributing data between different schemas with different access
rights and grant appropriate permission. Oracle allows to access
different schemas from same connection, mySQL doesn't.

And if you have about 50 simulateously connected copies of Apache (not
mention interactive applications) mySQL begins to crawl.

:>SQL + storage manager behind them. Nothing more. Even OS is not always
:>neccessary.
:>May be FORTRAN
:>preprocessor. Clients should be written on normal using
:>jdbc, odbc, dbi or some other kind of standartized interface.
:>
:>Of course good interactive shell is good, but I always have dbish.
:>
: A good interactive shell makes life easy...


Of course. And in this field psql is much better than sqlplus.
May be I should find time to write "GNU Oracle Shell" - something which
is distributed OpenSource and uses GNU readline, but works with Oracle
database.

:>:>So, only free database is PostgreSQL. But PostgreSQL start to
:>:>
:>: I think you mean the only free *relational* database - which is not the
:>: same thing at all. There are much better databases out there. While I
:>
:>Please name _free_ non-relational database which is comparable with
:>commercial ones. As far as I know, most free non-relational things are
:>compared with say Adabas, like mySQL to Oracle or worse.

: I don't know of any _free_ ones that are currently usable. I'm working
: on MaVerick...


So, we are back to my point - PostgreSQL is only free database. It is
relational (what's pity), but no non-relational one exists.

:>Guys who wrote mySQL think same way. Unfortunately, they was wrong.
:>Becouse there is nothing more practical then good theory.
:>
:>Theoretical purity gives flexibility, scalability and tunability.
:>This is why people don't write on CODASIL anymore.
:>
: Rules are for the guidance of wise men, and the obedience of fools. The
: real world is not amenable to forcing into a relational mould. For some
: things it works fine, but trying to force non-relational data into a
: relational straitjacket can (will?) make life difficult later on. Why

Of course. But it only means that somebody picks wrong theory.
And if you want something better, you'll have to find branch of
mathematics which describe your problem better than relational algebra.

Probably, I've found one for my problem. Now some people from MSU
work by the contract with our firm on the graph-based database.



: are people now throwing so much effort at object databases? Try running
: a data warehouse on a relational db - a big warehouse will bring a Cray
: to its knees...

It seems that objects is an universal solution for problems where no
special theory exists. That is why all OO languages are so bloated.

-- 
Randal can write one-liners again.  Everyone is happy, and peace spreads
over the whole Earth.
             -- Larry Wall in <[EMAIL PROTECTED]>

------------------------------

From: [EMAIL PROTECTED] (Paul Kimoto)
Crossposted-To: comp.os.linux.development.apps
Subject: Re: front ending libraries (even libc)
Date: 2 Dec 2000 22:02:35 -0500
Reply-To: [EMAIL PROTECTED]

In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] wrote:
> In comp.os.linux.development.system Paul Kimoto <[EMAIL PROTECTED]> wrote:
>| This is not a c.o.l.d.system (i.e., kernel) matter.  Followups redirected.
> The copy I got of your article had both comp.os.linux.development.system
> and comp.os.linux.development.apps.  So it didn't do as you wanted for
> some reason.

(Of course it went to c.o.l.d.s.  If I posted only to c.o.l.d.a, how would
I expect you to find it?  Followups reset, again.)

>                OTOH, this doesn't seem to be an apps matter to me, so I
> just left it alone.  If c.o.l.d.system is for only kernel issues, and not
> all system issues, then that leaves a gap in subject coverage.

(By convention, development of the kernel goes to .system, and other
development goes to .apps.  Remember anyway, Linux is just a kernel.)

>| I believe that you can just LD_PRELOAD the first library, as long as the
>| second library's (duplicated) functions are "weak".

> And if they aren't "weak"?  Or how can I make them "weak" without relinking
> that library?  It's certainly important that functions I don't replace
> still get resolved from the library they are in, but that functions I do
> replace get resolved to my library if they are references from the program

I've never tried this, but you will probably lose because of duplicated
symbols (unless you want to rewrite the dynamic linker).

In March Kaz Kylheku (who knows much more about unixy programming than I)
posted a (somewhat off-topic) comp.lang.c article describing weak symbols:
<[EMAIL PROTECTED]>.  (You can get it through deja.com
or the like.)

> So is readdir or closedir one of the "weak" ones?

nm(1) will tell you.  Perhaps objdump(1) will, too.

>| because the common Linux libraries are LGPL, you could just rewrite the
>| desired functions and put them in your first library, eliminating the need
>| to call the second library's affected functions.

> Possibly.  It does mean my library gets bigger and bigger doing this for
> some things.

Naturally, but it should still be much smaller than libc itself ...

-- 
Paul Kimoto
This message was originally posted on Usenet in plain text.  Any images, 
hyperlinks, or the like shown here have been added without my consent,
and may be a violation of international copyright law.

------------------------------

From: [EMAIL PROTECTED] (Rui Antunes)
Crossposted-To: comp.os.linux.questions
Subject: Kernel modules and Daemons - architecture question
Date: Tue, 28 Nov 2000 16:01:21 GMT

        I need to develop a kernel module that intercepts and improves a
few system calls. Since the enhancement of those system calls need a
little bit of code - and since kernel-code has much more restrictions
that user-code -, I was thinking of having a (user-space) daemon to
complement the kernel-module.
        However, I don't know much about daemons and their relation with
the kernel (and with other user-programs). Where can I find
documentation about it?

        Some of things that I wanted to know are:

        1) How do kernel and daemons interact (or communicate)?
        - using (new) system calls - the daemon calls the 
module system call?
        - using device driver operations - the daemon uses read(), write()
and ioctl() on the module (like a device driver)?
        - using /proc/ control files (how?)

        2) How do user-programs use the daemon facilities?
        - through the kernel (using a system call) that in turn contacts
the daemon?

        Is it possible for the kernel module to schedule its daemon so it
would run as soon as possible - to improve performance?

        Any help would be appreciated,
                                                                                Rui 
Antunes

[EMAIL PROTECTED]

------------------------------

From: [EMAIL PROTECTED]
Subject: Need help understanding /proc/pid/stat file
Date: Sun, 03 Dec 2000 05:31:47 GMT

Could someone tell me where I can find a precise explanation of what's
what in /proc/pid/stat?

The man page doesn't correspond numerically to what I see. Or I am
misunderstanding. Here's a cat that shows 39 items, more than the man
page for proc appears to describe:

1 (init) S 0 0 0 0 -1 256 72 80556 491 197030 0 41 1531 693 0 0 0 0 29
1089536 19 2147483647
134512640 134540936 3221225232 3221223172 1074494590 0 0 1475401980
671819267 3222354922
13 1857 0 0

I'm trying to understand which among these corresponds to cmajflt. Is
there any documentation that describes this exactly?



Sent via Deja.com http://www.deja.com/
Before you buy.

------------------------------

From: Lew Pitcher <[EMAIL PROTECTED]>
Subject: Re: Deamons
Date: Sat, 02 Dec 2000 19:34:28 -0500

Richard Fabian wrote:
> 
> whoops, I didn't read the group thouroughly enough ;-)
> 
> found this:
> anyone got any other comments on daemons?

First off, fork() _can_ fail, so add some error management logic.

Next, don't forget to chdir to the root directory, so that you don't
busy the load directory
 
> #v+
> void
> become_daemon()
> {
>         int i;
> 
    /*
>   **    if(fork()) {
>   **            /* Parent */
>   **            exit(0);
>   **    }
    /*

         /* fork with error checking */
          switch(fork())
          {
            case 0:  /* child */
                     break;

            case -1: /* error */
                     fprintf(stderr,"out of tune and can't fork\n");
                     exit(1);

            default: /* parent */
                     exit(0);
          }


>         /* Start new session */
>         setsid();
> 
>         /* Close low fd's and reopen as /dev/null */
>         for(i=0; i < 3; i++) {
>                 close(i);
>                 open("/dev/null", O_RDWR, 0);
>         }

          /* move to root directory */
          chdir("/");

> }
> #v-

-- 
Lew Pitcher

Master Codewright and JOAT-in-training

------------------------------

From: [EMAIL PROTECTED] (Mark Healey)
Crossposted-To: comp.os.linux.development.apps
Subject: Need library reference
Date: Sun, 03 Dec 2000 08:27:06 GMT

I'm really new to linux and only marginaly familiar with C.

I probably need a tutorial but for now I'd like a library reference
and for the life of me can't find it.

Where is it?

Also, is there a IDE type front end for GCC?

Mark Healey
marknews(the 'at' thing)healeyonline.com

------------------------------

From: "Leyland Chui" <[EMAIL PROTECTED]>
Crossposted-To: 
alt.os.linux,alt.os.linux.mandrake,comp.os.linux,comp.os.linux.admin,comp.os.linux.help,comp.os.linux.networking
Subject: Anyone know what is SKB Allocation Failed on Kernel Syslog?
Date: Sun, 3 Dec 2000 13:01:24 +0800

Dear Sir,
    I got trouble of this msg last night, it killed all process and let root
to run on /dev/null, why is that? Anyone know what happen?

Best Regards,
Leyland Chui



------------------------------

From: "Robert J. Hansen" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: Re: Need library reference
Date: Sun, 03 Dec 2000 11:03:32 GMT

> I'm really new to linux and only marginaly familiar with C.

Pick up a copy of _The C Programming Language_ if you want to learn C.  It's
a little dense going, but plenty worth it.  Barring that, O'Reilly Press has
some good books on C.  Avoid "C for Dummies" and the like at all costs.

> I probably need a tutorial but for now I'd like a library reference
> and for the life of me can't find it.

You mean electronic or paper?  The electronic version of a library reference
is called `man'.  Type `man <functionname>' and, more often than not, you'll
get a quick overview of it.  Try `man strlen', if you like.

> Also, is there a IDE type front end for GCC?

Try kdevelop.



------------------------------

From: Friedrich Dominicus <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: Re: Need library reference
Date: 03 Dec 2000 15:20:13 +0100
Reply-To: [EMAIL PROTECTED]

"Robert J. Hansen" <[EMAIL PROTECTED]> writes:

> > I probably need a tutorial but for now I'd like a library reference
> > and for the life of me can't find it.

What library are you talking about. The library you need everytime is
libc and you can get the whole sources and documentation somewhere
from www.gnu.org
> 
> > Also, is there a IDE type front end for GCC?
> 
> Try kdevelop.
Or Wedit for Linux
http://www.q-software-solutions.com/weditlinux/

Or Redhats SourceNavigator (somwhere below www.redhat.com

or WipeOut www.softwarebuero.de

Or XEmacs ;-)

Regards
Friedrich

-- 
for e-mail reply remove all after .com 

------------------------------


** 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
******************************

Reply via email to