Linux-Development-Sys Digest #771, Volume #8      Mon, 4 Jun 01 21:13:15 EDT

Contents:
  mlock suggestions (Paul Rubin)
  Re: problem with compiling as a module ("Lee Ho")
  Re: problem with compiling as a module (Wil Taphoorn)
  terminal question (tony)
  core dump with -static ("Alex Ho")
  Re: terminal question ("Karl Heyes")
  tabstops (Charles Wilkins)
  Re: tabstops ("Neil Butterworth")
  Re: terminal question (tony)
  Warning: Kernel 2.4.x + knfsd + reiserfs (Juergen Sauer)
  /usr/bin/time always gives 0 mem usage? (Mad Programmer)
  Re: terminal question ("Karl Heyes")
  Re: How to access argc,argv,envp without glibc (Oleg Krivosheev)
  Need help accessing the Rx packet queue (Jason Clarke Lear)
  Re: flush() system call? ("wang yin")
  where can I find information for kernel hackers? ("wang yin")
  Re: Problems With Dynamic Linking (Nix)
  Re: flush() system call? (Juergen Heinzl)
  Re: flush() system call? ("Karl Heyes")
  Re: Patching the original RH (7.1) kernel (?) (Peter Holm)
  Re: Patching the original RH (7.1) kernel (?) ("Peter T. Breuer")
  Rescuing an e2fs with damaged superblocks? (Florian Kirstein)

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

From: Paul Rubin <[EMAIL PROTECTED]>
Subject: mlock suggestions
Date: 03 Jun 2001 23:47:19 -0700

1) I'd like to request that the mlock system call always return
success (even for non-root processes) when asked to lock writeable
pages, if the system has paging/swapping disabled.  After all, if
there's no paging, mlock guarantee that the relevant block won't be
paged.  All such pages are already automatically locked.  This avoids
annoying warning messages from programs like GnuPG.  I guess some
read-only executable code pages might still not be locked in such an
environment, but it's ok for mlock to return failure for those pages.

2) A more controversial change that might require some design
examination would be to allow non-root processes to lock a few pages
despite being non-root.  GnuPG (again) and similar programs could make
use of that.  There could be some per-user limit on the number of
simultaneous locked pages, as well as a per-process limit, to stop
unprivileged users from grabbing infinite RAM.  I'd like to request
that this idea be considered, but I'm not sure what the exact outcome
I'd favor.

Thanks

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

From: "Lee Ho" <[EMAIL PROTECTED]>
Subject: Re: problem with compiling as a module
Date: Mon, 04 Jun 2001 08:27:54 GMT


If your system is RedHat 7.x, try kgcc instead of gcc.
And check if /usr/include/linux is symbolic linked to
/usr/src/linux/include/linux.

*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
Lee, Ho. Software Engineer, Embedded Linux Dep, LinuxOne
Mail : [EMAIL PROTECTED] (work), [EMAIL PROTECTED] (personal)
Homepage : http://flyduck.com, http://linuxkernel.to

Srinivas Vedula Wrote:
>The following are the errors I am getting.
>gcc -Wall -DMODULE -D__KERNEL__ -DLINUX -c addToProc.c
>In file included from /usr/include/linux/sched.h:13,
>/usr/include/linux/times.h:5: parse error before `clock_t'
>/usr/include/linux/times.h:5: warning: no semicolon at end of struct or
>union
>/usr/include/linux/times.h:6: warning: data definition has no type or
>storage class




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

From: Wil Taphoorn <[EMAIL PROTECTED]>
Subject: Re: problem with compiling as a module
Date: Mon, 04 Jun 2001 10:12:50 +0100

Srinivas Vedula wrote:

> len = sprintf(buffer, "Call %05d %1d %1d \n",count,
> t.tv_sec, t.tv_usec);

There is a typo here, the "1" (one) in %1d should be "l" (small L)

Wil.

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

From: tony <[EMAIL PROTECTED]>
Subject: terminal question
Date: Mon, 4 Jun 2001 10:40:01 -0400

Is there a way I can direct messages (eg echo outputs) to a terminal other 
than the one the script is running on? For example if I have a shell script 
running on /dev/pts/5 but I want to direct that script messages to the 
console /dev/pts/3, how would I do this?.

Any help would be greatly appreciated.

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

From: "Alex Ho" <[EMAIL PROTECTED]>
Subject: core dump with -static
Date: 04 Jun 2001 15:18:04 GMT

Hi,

 I am using g++ version egcs-2.91.66 on Redhat 6.2.  When my app is linked
 with -static, it core dumps as soon as it starts.

Here is the stack trace display in gdb:

#0  0x8132c29 in __syscall_error_1 () at herrno.c:34
#1  0x8123643 in fcntl (fd=1, cmd=1) at wrapsyscall.c:77
#2  0x8132b10 in check_standard_fds () at
../sysdeps/generic/libc-start.c:110
#3  0x8132bc4 in __libc_start_main (main=0x80481d4 <main>,
argc=1,argv=0xbffffcc4,
             init=0x80480b4 <_init>, fini=0x8192e48 <_fini>, rtld_fini=0,
stack_end=0xbffffcbc)
            at ../sysdeps/generic/libc-start.c:60
Current language:  auto; currently c


Without linking with -static, everything is fine.

 Does anyone know why?

 Thanks in advance.





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

From: "Karl Heyes" <[EMAIL PROTECTED]>
Subject: Re: terminal question
Date: Mon, 04 Jun 2001 16:56:00 +0100

In article <x0NS6.1957$[EMAIL PROTECTED]>, "tony"
<[EMAIL PROTECTED]> wrote:


> Is there a way I can direct messages (eg echo outputs) to a terminal other
> than the one the script is running on? For example if I have a shell script
> running on /dev/pts/5 but I want to direct that script messages to the
> console /dev/pts/3, how would I do this?.  Any help would be greatly
> appreciated.

use 

script > /dev/pts/3

If you want to send to the virtual console as well then use tee in a pipe'd
command.

karl.

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

From: [EMAIL PROTECTED] (Charles Wilkins)
Subject: tabstops
Date: Mon, 04 Jun 2001 16:14:20 GMT
Reply-To: [EMAIL PROTECTED]

I am not sure this pertains to vi or bash, but when i write scripts,
the tabstops are set at 8 spaces.  How can I reset the tab stops to a
lower number? 

Thanks in advance for any replies.
Charles Wilkins


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

From: "Neil Butterworth" <[EMAIL PROTECTED]>
Subject: Re: tabstops
Date: Mon, 4 Jun 2001 17:27:17 +0100

"Charles Wilkins" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> I am not sure this pertains to vi or bash, but when i write scripts,
> the tabstops are set at 8 spaces.  How can I reset the tab stops to a
> lower number?

Edit your .exrc file and add these lines:

set ts=4
set sw=4

or you can type them in as commands at the vi colon prompt.

NeilB





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

From: tony <[EMAIL PROTECTED]>
Subject: Re: terminal question
Date: Mon, 4 Jun 2001 12:48:34 -0400

Karl Heyes wrote:

> In article <x0NS6.1957$[EMAIL PROTECTED]>, "tony"
> <[EMAIL PROTECTED]> wrote:
> 
> 
>> Is there a way I can direct messages (eg echo outputs) to a terminal
>> other than the one the script is running on? For example if I have a
>> shell script running on /dev/pts/5 but I want to direct that script
>> messages to the
>> console /dev/pts/3, how would I do this?.  Any help would be greatly
>> appreciated.
> 
> use
> 
> script > /dev/pts/3
> 
> If you want to send to the virtual console as well then use tee in a
> pipe'd command.
> 
> karl.

Thanks, that worked. I have a script starting another script and I just 
wanted a confimation message sent to the console with started the first 
script. I dont undersand your second statement. Can you give me an example 
command?

Again thanks for your time
> 


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

From: Juergen Sauer <[EMAIL PROTECTED]>
Subject: Warning: Kernel 2.4.x + knfsd + reiserfs
Date: Mon, 4 Jun 2001 15:43:57 +0000 (UTC)

Moin, Moin,
inspired by the journaled FS article on freshmeat, I installed
reiserfs (3.6.x) on our Kernel-NFS-based server. (v2.4.x). The nfs Tools and
patches (reiserfs+knfsd) were current. (variuos Clients 2.2.18,19 and 2.4.x)

The system worked about 3 Weeks correctly and then ...

During the production of this server the reiserfs-/home Filessystem showed
up some cazy problems.
The some clients were reporting 'stale nfs handle', other kept working right.
If a client reported the 'stale nfs handle', the access to the file|dir
was denied on the server for erveryone, including root; but some
other clients were able to access the problem files, dirs.

This problemstate was clearable with a 'exportfs -r', but only for
a few minutes til hours. This problem were araising really often.

The "permission denied" bug reached the Arkeia backup circle and the
Backups. Arkeia didn't mention the problem and could not backup some files.

So the problem caused data-loss.

Summary: Do not use reiferfs V3.6.x + knfsd in Linux Kernel 2.4.[0,1,2,3,4,5].

It looks right, Linux Thorvalds and Alan Cox were right in their opinion
of reiserfs.

I switched the server home filesystem to xfs-1.0. The Problems are 
solved this way.

Good Luck!
        J. Sauer

-- 
Jürgen Sauer - AutomatiX GmbH, +49-4209-4699, [EMAIL PROTECTED] **
** Das Linux Systemhaus - Service - Support - Server - Lösungen **
http://www.automatix.de to Mail me: remove: -not-for-spawm-     **

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

From: [EMAIL PROTECTED] (Mad Programmer)
Subject: /usr/bin/time always gives 0 mem usage?
Date: Mon, 4 Jun 2001 17:27:03 +0000 (UTC)

cant figure this out. thought that the
/usr/bin/time command and also the tcsh
builtin should be able to report "max memory"
used by a command. however they always
report 0 on my linux redhat 7.0 system.
what gives?

according to some info I turned up, the process
accounting package (psacct) 
not being installed may be a factor; so
I installed it & get the same results.

it would be very nice to get this to work
& use it as a rudimentary command profiler.

following command "x" sorts a large text file


# /usr/bin/time -v x
        Command being timed: "x"
        User time (seconds): 2.21
        System time (seconds): 0.24
        Percent of CPU this job got: 92%
        Elapsed (wall clock) time (h:mm:ss or m:ss):
0:02.64
        Average shared text size (kbytes): 0
        Average unshared data size (kbytes): 0
        Average stack size (kbytes): 0
        Average total size (kbytes): 0
        Maximum resident set size (kbytes): 0
        Average resident set size (kbytes): 0
        Major (requiring I/O) page faults: 631
        Minor (reclaiming a frame) page faults: 1508
        Voluntary context switches: 0
        Involuntary context switches: 0
        Swaps: 0
        File system inputs: 0
        File system outputs: 0
        Socket messages sent: 0
        Socket messages received: 0
        Signals delivered: 0
        Page size (bytes): 4096
        Exit status: 0



__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/


-- 
Posted from web10405.mail.yahoo.com [216.136.130.97] 
via Mailgate.ORG Server - http://www.Mailgate.ORG

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

From: "Karl Heyes" <[EMAIL PROTECTED]>
Subject: Re: terminal question
Date: Mon, 04 Jun 2001 18:53:09 +0100

In article <IYOS6.14525$[EMAIL PROTECTED]>, "tony"
<[EMAIL PROTECTED]> wrote:


> Thanks, that worked. I have a script starting another script and I just
> wanted a confimation message sent to the console with started the first
> script. I dont undersand your second statement. Can you give me an example
> command?  Again thanks for your time

if you do something like

ls | tee /tmp/file.list

you get the normal file listing on screen but also you get a duplicate in a file
/tmp/file.list.   I only mentioned it as you mentioned console as well as
/dev/pts/xx

karl.

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

From: Oleg Krivosheev <[EMAIL PROTECTED]>
Subject: Re: How to access argc,argv,envp without glibc
Date: 04 Jun 2001 14:18:40 -0500

[EMAIL PROTECTED] (Eric Buddington) writes:

> I am trying to write minimalist programs for use on
> boot floppies. I have found that by stealing the assembler
> syscall macros from glibc, I can write miniscule (about 2k)
> and functional programs to do the basics of mount, swapon,
> execve, all that.
> 
> I can't, however, figure out how to access command-line
> arguments or environment without using glibc (which is a beast)
> Can someone point me to the relevant sources in glibc or gcc?
> 
> (ObDisclaimer: yes, I know this will not be portable)
> 
> -Eric
> [EMAIL PROTECTED]

there is diet libc project somewhere

OK

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

From: Jason Clarke Lear <[EMAIL PROTECTED]>
Subject: Need help accessing the Rx packet queue
Date: Mon, 04 Jun 2001 13:24:56 -0600

  I'm doing a routing project for school and have a PC with Linux and
five network cards installed.  I want to write some fairly simple code
to analyze the incoming packets and forward them to the port that the
destination machine is attached to.
   I have been going through the source code trying to figure out where
the packets are stored and have found that the driver calls the function
netif_rx in dev.c to place the received packets in queue.  My problem is
I have never had to write code to access the receive queue before.  Can
someone give me some sample code on how to access the list?

Thanks, 

Cliffy

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

From: "wang yin" <[EMAIL PROTECTED]>
Subject: Re: flush() system call?
Date: Tue, 5 Jun 2001 15:06:15 +0800

  I don't mean fflush(), fflush() is a stdio libary function. I know. I mean
flush().
  I just don't know what's the use of "flush" in kernel file_operations
struct in <linux/fs.h>. I don't know if I should implement that function for
my device driver.

Wang Yin



Juergen Heinzl <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> In article <9f9vg6$278o$[EMAIL PROTECTED]>, wangyin wrote:
> >I see there is a "flush" in file_operations, but there seems not a
flush()
> >system call in Linux. What's this entry for?
> [-]
> fflush() is not a system call, it's part of stdio. See fflush(3) for
> what it is for,
> Juergen
>
> --
> \ Real name     : Juergen Heinzl                \       no flames      /
>  \ EMail Private : [EMAIL PROTECTED] \ send money instead /



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

From: "wang yin" <[EMAIL PROTECTED]>
Subject: where can I find information for kernel hackers?
Date: Tue, 5 Jun 2001 15:28:28 +0800

Hi,
  I'm looking for "Linux kernel hacker's guide". But it seems it's not on
the Internet anymore! Only very old mirrors. And where's Michael Johnson?
www.redhat.com:8080 can't be visited anymore.
  The kernel change too much these days. Where can I find all the
information I need?



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

From: Nix <$}xinix{$@esperi.demon.co.uk>
Subject: Re: Problems With Dynamic Linking
Date: 04 Jun 2001 21:28:15 +0100

On Sun, 3 Jun 2001, K. yowled:
> Can anyone inform me as to how to produce dynamically linked executables for
> ARM linux?  I used what I considered to be the normal method for producing
> such executables, i.e.
> 
> arm-linux-gcc filename -o executable -Xlinker -Bdynamic -L. -ldl -llib

Try adding `-shared'; this is the cross-platform way of making shared
objects with GCC.

(The -Xlinker stuff should do no harm, but should not be necessary.)

-- 
`"This code is gross!"  meaning "This code has over 144 compilation errors."'
                                     --- Correct use of English, from jer

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

From: [EMAIL PROTECTED] (Juergen Heinzl)
Subject: Re: flush() system call?
Date: Mon, 04 Jun 2001 22:12:50 GMT

In article <9ffcbp$2j2b$[EMAIL PROTECTED]>, wang yin wrote:
>I don't mean fflush(), fflush() is a stdio libary function. I know. I mean
>flush().
[-]
Oops ... sorry sorry sorry 8-}
[-]
My bad,
Juergen

-- 
\ Real name     : Juergen Heinzl                \       no flames      /
 \ EMail Private : [EMAIL PROTECTED] \ send money instead /

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

From: "Karl Heyes" <[EMAIL PROTECTED]>
Subject: Re: flush() system call?
Date: Mon, 04 Jun 2001 23:19:44 +0100

In article <9ffcbp$2j2b$[EMAIL PROTECTED]>, "wang yin" 
<[EMAIL PROTECTED]>
wrote:


> I don't mean fflush(), fflush() is a stdio libary function. I know. I mean
> flush().
>   I just don't know what's the use of "flush" in kernel file_operations
> struct in <linux/fs.h>. I don't know if I should implement that function for
> my device driver.

its called when a file is closed.  It's not a system call, it's an optional
filesystem specific function call (eg nfs/file.c), invoked from filp_close as
far as I can see.

karl.

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

From: Peter Holm <[EMAIL PROTECTED]>
Subject: Re: Patching the original RH (7.1) kernel (?)
Date: Tue, 05 Jun 2001 00:39:01 +0200

Hi!

[EMAIL PROTECTED] (David Konerding) wrote:

>Yes.  Be aware that Red Hat understandably has patched the 2.4.2 kernel rather 
>heavily,
>to add features and bug fixes.  This is more or less necessary when you want to 
>produce
Is there somewhere documentation about that? What exactly did they do?
Is it possible for a "normal" user to apply these patches to a newer
kernel?

>a reliable and self-consistent holistic distribution.  For example I've had no end of
>hassles using NFS from very recent versions of the kernels that I've compiled myself.
>2.4 isn't yet in a stable state yet (and the kernel developers are still dickering
>over what the problems are and how to fix them).
Where can I get information about bugs in newer kernel versions?
Is there a central kernel-bugs-database?

I asked some days ago if redhat has a "clean" kernel or if they do
patches to it. No answers. 

Are there redhat-people reading here to clarify?

Thanks!




Have a nice thread,
Peter

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

From: "Peter T. Breuer" <[EMAIL PROTECTED]>
Subject: Re: Patching the original RH (7.1) kernel (?)
Date: Tue, 5 Jun 2001 01:16:26 +0200

Peter Holm <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] (David Konerding) wrote:

>>Yes.  Be aware that Red Hat understandably has patched the 2.4.2 kernel rather 
>heavily,
>>to add features and bug fixes.  This is more or less necessary when you want to 
>produce
> Is there somewhere documentation about that? What exactly did they do?

Look at their src.rpm. It'll have the patches separate.

> Is it possible for a "normal" user to apply these patches to a newer
> kernel?

What's a "normal" user? Any user can do it, as far as I understand what
you mean. But I suspect you don't understand that you are talking about
source code, and you need to read the Kernel HOWTO.

> I asked some days ago if redhat has a "clean" kernel or if they do
> patches to it. No answers. 

Because it's a nonsensical question, if it means anything at all.
They have a clean kernel and they patch it.

> Are there redhat-people reading here to clarify?

There's nothing to clarify. You know they patch the kernel. Their
numbering indicates so. And the src.rpm contains their patches.

Peter

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

From: [EMAIL PROTECTED] (Florian Kirstein)
Subject: Rescuing an e2fs with damaged superblocks?
Date: 4 Jun 2001 23:09:10 GMT

Hi,

something silly happened (a broken IDE cable) and stupid me thought it
would be best to shut down and fix it. But on shutdown the e2fs driver
obviously tried to update the superblock (marking the fs as cleanly
unmounted) and doing so obviousle severely damaged it, when trying to
mount the fs now I get
 mount: you must specify the filesystem type
and using -t e2fs
 mount: wrong fs type, bad option, bad superblock on /dev/hdc

and even using standard locations for superblock backups doesn't help.
I then found the findsuper tool, which also didn't help really (it
shows somewhat strange values and the found superblocks also don't
help), and in the sourcecode there's a hint that linux updates all
superblock backups on unmount, so I think all my superblocks
are damaged. 

Besides the superblocks I'm quite sure the filesystems should be
completely OK, because I didn't write to them the days before the
crash.

So my question: does anyone here see any chance to get my data back?
I searched the net for tools doing ext2 rescues (like scanning the whole
disk and rebuilding the data from there), but didn't find anything
so far :/ I can't be the first one needing something like that?

Thanx & (:ul8er, r@y

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


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

Reply via email to