Linux-Development-Sys Digest #599, Volume #8     Fri, 30 Mar 01 10:13:17 EST

Contents:
  Re: Anyone looking for a Linux developer job in FL? Please don't flame
  Re: The differences between Ash and Bash (Erik Max Francis)
  Linux-2.4.2 doesn't compile for MIPS R5K (C.G.Senthilkumar.)
  about cramfs filesystem? ("Leo Naboro")
  Re: How does Linux implement the time calls and what's the resolution? (Florian 
=?iso-8859-1?Q?Gro=DFe=2DCoosmann?=)
  Linux module install error ("Jason K. Leong")
  Re: what means pgrp in the task struct ? (Benjamin Lussier)
  Re: How to handle newline character(s) in a TCP server (Lew Pitcher)
  Re: RTC - What's the value? (Kasper Dupont)
  Re: Linux module install error (Kasper Dupont)
  Re: Kernel panic! (Simonz)
  Re: Shared libs and memory usage (Giuliano Pochini)
  8200 Tape drive problems (Manoj Patil)
  C-Programming, getchar(), console ("Jakub Orb�n")
  Re: Kernel panic! (Kasper Dupont)
  setsockopt() return "protcol not available" please help ("FREDRIK LINDSTR�M")
  Re: C-Programming, getchar(), console (Josef Moellers)
  Re: C-Programming, getchar(), console (Kasper Dupont)

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

From: [EMAIL PROTECTED] ()
Subject: Re: Anyone looking for a Linux developer job in FL? Please don't flame
Date: Fri, 30 Mar 2001 05:04:10 -0000

In article <ZGRw6.110183$[EMAIL PROTECTED]>,
 <[EMAIL PROTECTED]> wrote:

>> $40-53,000.

>I would find it very surprising if you got many takers, unless the
>salary is augmented with really substantial additional valuata; for
>instance, options, that, even in the present "bearish" market for tech
>stocks, would be reasonably expected to provide returns on the order
>of another $40-53K.
>
>Someone who knows C, C++, Warp, and Linux device drivers well enough
>to satisfy those requirements can probably command a _lot_ more than
>$40K.

I was thinking the same thing.  That's *way* too low to get anyone
that's actually got some experience.

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

From: Erik Max Francis <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.admin,comp.os.linux.help,comp.os.linux.misc
Subject: Re: The differences between Ash and Bash
Date: Thu, 29 Mar 2001 21:05:03 -0800

Toby Haynes wrote:

> Mainly because tcsh has smart completion (i.e. totally customizable,
> so if you
> have a program which has long wordy switches, you can add completion
> for the
> switches as well as the command name, subsequent arguments (be they
> files,
> numbers, process IDs, etc.). I never found a version of bash which did
> this -
> completion in bash is based on filename, hostname, username,
> variables,
> dependent on leading characters or direct request for a particular
> style of
> completion.

But other bashalikes do, such as ksh and zsh.  zsh, it could be argued,
has the most powerful command completion capabilities of any shell.

-- 
 Erik Max Francis / [EMAIL PROTECTED] / http://www.alcyone.com/max/
 __ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
/  \ He who can, does.  He who cannot, teaches.
\__/ George Bernard Shaw
    Maths reference / http://www.alcyone.com/max/reference/maths/
 A mathematics reference.

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

From: C.G.Senthilkumar. <[EMAIL PROTECTED]>
Subject: Linux-2.4.2 doesn't compile for MIPS R5K
Date: Fri, 30 Mar 2001 05:30:09 -0000

Hi,
        I downloaded a Linux-2.4.2 and did the following:

make menuconfig ARCH=mips
make dep ARCH=mips
make vmlinux ARCH=mips

But the last step doesn't complete. It comes out with lots of errors like
undefined symbols and things like that. The more confounding thing is
Linux-2.4-test6 compiled even along with my patches for a new board. Yes,
I'm using a cross complier environment mips on a pentium m/c.

Can someone help please?

Thanks in advance.

Regards,
C.G.Senthilkumar.

--
Posted via CNET Help.com
http://www.help.com/

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

From: "Leo Naboro" <[EMAIL PROTECTED]>
Subject: about cramfs filesystem?
Date: Fri, 30 Mar 2001 14:20:47 +0800

The 2.4 kernel series has a compressed read-only filesystem (cramfs) aimed
at embedded systems, which can be back-ported to 2.2 kernels. how can i add
cramfs filesystem into my 2.2.16 kernel?





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

From: Florian =?iso-8859-1?Q?Gro=DFe=2DCoosmann?= <[EMAIL PROTECTED]>
Subject: Re: How does Linux implement the time calls and what's the resolution?
Date: Fri, 30 Mar 2001 08:43:20 +0200

Rafa Faus wrote:
> 
> As you know, the time resolution in Windows is 1ms, so if you want to do a
> for loop and wait by software, the minimum time you can wait is 1ms.
> I would like to know how Linux implements the time calls, and what the
> resolution is.

gettimeofday() gives microsecond resolution. You may decide to sleep
within your code with nanosleep(). Keep in mind that only root will sleep
short periods without rescheduling. Others must wait a minimum time
and that's a longer time than a rescheduling time slice under normal
circumstances.

Cheers, Florian

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

From: "Jason K. Leong" <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Subject: Linux module install error
Date: Thu, 29 Mar 2001 22:46:37 -0800

I have ported a device driver from SCO to Linux and was able to compile
it.  However when I was trying to install it into the kernel using the
command, "insmod driver.o", I get
the following three errors:

unable to resolve symbol register_chrdev()
unable to resolve symbol printk()
unable to resolve symbol do_exit()

Now I thought these three functions are standard Linux kernel functions
that are supposed to link correctly.  What am I doing wrong?  I did
include the compile flags in my makefile of "-D__KERNEL__" and "
-DMODULE".  Am I missing a path, forgetting to include something?

Please email me at   [EMAIL PROTECTED]  if anyone can offer me of some
help.
I really appreciate it.  Thanks.

Jason


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

From: Benjamin Lussier <[EMAIL PROTECTED]>
Subject: Re: what means pgrp in the task struct ?
Date: Fri, 30 Mar 2001 09:19:49 +0200
Reply-To: [EMAIL PROTECTED]

Kasper Dupont wrote:
> OK, so it looks like it is possible for other processes
> than init to inherit children. Under what circumstances
> does this happen, I have not been able to make it happen.

I'm studiyng the source code of linux 2.4, and this piece of code is
part of the function forget_original_parent, which is called by
exit_notify, which is called itself by do_exit (phew...)
All functions in kernel/exit.c

Methink that this should be done every time a process dies : reparent
its still living childs to another living thread in its process group.
(but maybe I'm wrong : much stranger things happen)

Benjamin Lussier wrote:
> 
> Kasper Dupont wrote:
> > It is always the init task who inherrits children
> > of dead tasks.
> What then of the following comment (and code) in kernel/exit.c ?
> 
> 148  * When we die, we re-parent all our children.
> 149  * Try to give them to another thread in our process
> 150  * group, and if no such member exists, give it to
> 151  * the global child reaper process (ie "init")
> 152  */
> 153 static inline void forget_original_parent(struct task_struct *
> father)
> 154 {
> 155         struct task_struct * p, *reaper;
> 156
> 157         read_lock(&tasklist_lock);
> 158
> 159         /* Next in our thread group */
> 160         reaper = next_thread(father);
> 161         if (reaper == father)
> 162                 reaper = child_reaper;
> (child_reaper = init)

-- 

> `Have you guessed the riddle yet?' the Hatter said, turning to Alice again. 
> `No, I give it up,' Alice replied: `what's the answer?' 
> `I haven't the slightest idea,' said the Hatter.

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

From: Lew Pitcher <[EMAIL PROTECTED]>
Crossposted-To: comp.unix.programmer,comp.os.linux.development.apps
Subject: Re: How to handle newline character(s) in a TCP server
Date: Thu, 29 Mar 2001 22:14:59 -0500

InterFan wrote:
> 
> I want to design a TCP server. It just receives a line from client and
> handles it. Then, it sends the response back to the client. The
> problem is that a line of message may end with ASCII characeter 13, 10
> or 13+10. I use blocking I/O function. How can I handle these
> conditions smoothly.

Well, why don't you
a) treat both <cr> and <lf> as end-of-line characters.
   That way lines that end with <cr> only will be
   handled correctly, as will lines that end with <lf>
   only.

b) as a special case, if <lf> was preceeded by <cr>,
   don't count the <lf> as a line, but silently discard it
   That way, <cr><lf> is treated as a special <cr>
   terminated line, and not as a <cr> terminated line
   followed by an empty <lf> terminated line.

Of course, this will take a bit of state programming.
        
-- 
Lew Pitcher

Master Codewright and JOAT-in-training
Registered Linux User #112576

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

From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: RTC - What's the value?
Date: Fri, 30 Mar 2001 08:15:49 +0000

John Kelly wrote:
> 
> I have a high priority daemon to write that needs to ping an external
> server every second, or else my platform will be gracelessly reset.  I
> see 2 candidate options for timing the interval:
> 
> 1) Use /dev/rtc at 2 Hz
> 
> 2) use select() with a timeout
> 
> With select(), I seem to get finer interval control.  Is there any value
> to using the /dev/rtc approach instead (I mean, if not, why have it?)
> 
> -jk

The arguments for select() does specify microseconds,
but the precision is not better than the system timer
runing at 100Hz. (1000Hz on a few architectures)

Since your requirement is far less than 100Hz, and
since you can tolerate a little inaccuracy I don't
think you would gain anything from using /dev/rtc.

On the other hand it might be a good idea to make
your daemon a realtime process with the
sched_setscheduler call.

Sending only two signals pr. second to the external
device sounds a little risky to me. If just a
single signal got lost for some reason, and if the
delay was not exactly 0.5 second but 0.5001 second
you would get an unwanted shutdown. I suggest you
send five signals pr. second, I don't think that
would take much CPU time anyway.

-- 
Kasper Dupont

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

From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: Linux module install error
Date: Fri, 30 Mar 2001 08:17:24 +0000

Jason K. Leong wrote:
> 
> I have ported a device driver from SCO to Linux and was able to compile
> it.  However when I was trying to install it into the kernel using the
> command, "insmod driver.o", I get
> the following three errors:
> 
> unable to resolve symbol register_chrdev()
> unable to resolve symbol printk()
> unable to resolve symbol do_exit()
> 
> Now I thought these three functions are standard Linux kernel functions
> that are supposed to link correctly.  What am I doing wrong?  I did
> include the compile flags in my makefile of "-D__KERNEL__" and "
> -DMODULE".  Am I missing a path, forgetting to include something?

Did you remember the optimization flag "-O2" ?

> 
> Please email me at   [EMAIL PROTECTED]  if anyone can offer me of some
> help.
> I really appreciate it.  Thanks.
> 
> Jason

-- 
Kasper Dupont

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

From: Simonz <[EMAIL PROTECTED]>
Subject: Re: Kernel panic!
Date: Fri, 30 Mar 2001 16:34:51 +0700

Jukka Valvanne wrote:

> What should I do, when my Linux kernel panics while trying to disable CPUID?
> it gets me error "Kernel panic - trying to kill idle task!", then it just
> locks.
>
> My machine is like
>
> motherboard : Asus A7Pro
> CPU: AMD Duron 650MHz
> memory: 64Mb
> Graphic: Riva TNT2
> Hdd: Quantum Bigfoot 4Gb
>
> -Jukka

the message "Kernel panic - trying to kill idle task!" happenned to me once
when I set up the
wrong bus speed for my SDRAMs. and the message shown when kernel tried to use
swap memory.


Simonz


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

From: Giuliano Pochini <[EMAIL PROTECTED]>
Subject: Re: Shared libs and memory usage
Date: Fri, 30 Mar 2001 11:42:43 +0200

> Run top and watch the total memory usage as you run many copies
> of the program.  You will see that the total memory usage [...]
> Without going into great detail, we see that each instance of the apache
> httpd is sharing ~900k, so each new process requires about 60k.

Yes, yes, httpd processes share a lot of pages, but my cgi refuses to
do it. The difference of shared mem when it's compiled w/ shared libs
is about 20K and the RSS grows of about 80KB. The executable on disk
shrinks from 115K to 48K and ldd shows it actually use share libs.

pochini@titano:/other/sources/cgi-src/shinystat# ldd shinystat
        libdbm.so.1 => /usr/local/lib/libdbm.so.1 (0x40017000)
        libgd-1.8.so.1 => /usr/local/lib/libgd-1.8.so.1 (0x40023000)
        libcrypt.so.1 => /lib/libcrypt.so.1 (0x40051000)
        libpng.so.2 => /usr/lib/libpng.so.2 (0x4007e000)
        libc.so.6 => /lib/libc.so.6 (0x400a5000)
        libz.so.1 => /usr/lib/libz.so.1 (0x4018f000)
        libm.so.6 => /lib/libm.so.6 (0x4019e000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

  PID USER     PRI  NI  SIZE  RSS SHARE STAT  LIB %CPU %MEM   TIME
COMMAND
25045 httpd     10   0  1104 1104   628 S       0  0.8  0.0   0:00
shinystat.cgi

RSS-SHARE remains almost the same when libgd and libdbm are statically
linked.


Bye.

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

From: Manoj Patil <[EMAIL PROTECTED]>
Subject: 8200 Tape drive problems
Date: Fri, 30 Mar 2001 17:45:09 +0530

Hi !
I have IBM PC with Red Hat 6.2 (kernel 2.2.14)
I have connected two SCSI tape drives to this machine
I am not able to change the density and block size for one of the tape
drive

$ cat /proc/scsi/scsi     shows me following
Attached devices
Host: scsi0    Channel:    00    ID:   02    Lun:00
Vendor:    EXABYTE    Model: IBM-8505    Rev: 7J0A
Type:    Sequential-Access                            ANSI SCSI
revision: 02
Host:  scsi0    Channel:   00    ID:   03    LUN:00
Vendor:    EXABYTE    Model: EXB-8200    Rev:2680
Type:    Sequential-Access                            ANSI SCSI
revision: 01 CCS

$mt -f /dev/nst1 status
SCSI 1  tape drive
File number =-1,  block number=-1
Tape block size 0 bytes. Density code 0x0 (default)
Soft error count since last status=0
General status bits on (1010000):
ONLINE IM_REP_EN

On this tape if i try to change the blksize or the density, I get
following error
( mt -f /dev/nst1 setblk  1024   and setdensity 0x14)

st1: Error with sense data: [valid=0] Infofld=0x0 , EOM current
st09:01:sense key Illiegal request
/dev/nst1:  Input/Output Error

However, I am able to do  a  tar cvf and tar tvf on this tape using a
112M cartridge.

Can some one please help me in how to go about changing the blk size .

(I am able to change block size and density on the other tape i.e
/dev/nst0)




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

From: "Jakub Orb�n" <[EMAIL PROTECTED]>
Subject: C-Programming, getchar(), console
Date: Fri, 30 Mar 2001 14:15:17 GMT

Hi,

I'm new to linux, but i already c-programming (compiling progs with gcc,
starting on the console (bash))
now i have a simple small question:
wenn i use getchar() in my programm, i have always to press <enter>, in
order to "get the attention" of the function
is there a function that reacts on a sigle key-press?
or: what the solution to this prob?

thx, bye, Jakub



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

From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: Kernel panic!
Date: Fri, 30 Mar 2001 14:27:30 +0000

Simonz wrote:
> 
> Jukka Valvanne wrote:
> 
> > What should I do, when my Linux kernel panics while trying to disable CPUID?
> > it gets me error "Kernel panic - trying to kill idle task!", then it just
> > locks.
> >
> > My machine is like
> >
> > motherboard : Asus A7Pro
> > CPU: AMD Duron 650MHz
> > memory: 64Mb
> > Graphic: Riva TNT2
> > Hdd: Quantum Bigfoot 4Gb
> >
> > -Jukka
> 
> the message "Kernel panic - trying to kill idle task!" happenned to me once
> when I set up the
> wrong bus speed for my SDRAMs. and the message shown when kernel tried to use
> swap memory.
> 
> Simonz

The message "Kernel panic - trying to kill idle task!"
does not tell much about what went wrong, but often
before that message you will get something much more
helpfull.

If the idle task is being killed it is OK for the
kernel to panic, there is not much you can do. Of
course it should not happen, on a properly runing
system the idle task does nothing that would course
it to die, not even sleep.

It might happen if kill is for some reason called
within an interrupt handler, that is not legal but
can happen as the result of problems in the kernel.
If kill is called within an interrupt, there is
nothing else to do than kill the current process,
even if the current process has nothing to do with
the problem.

On a heavily loaded system a problem in an interrupt
handler would just kill the process hapening to be
runing at that moment, on a lightly loaded system it
is most likely that the idle process is runing when
the interrupt arives.

Calling exit within an interrupt is not legal, but
can happen if the interrupt handler does something
illegal like dereferencing an invalid pointer. However
if that is what happens you will get a much more
detailed error mesage, ending with a kernel panic. The
last error message is uninteresting, the first error
message is the one that will tell most about the
reason.

-- 
Kasper Dupont

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

From: "FREDRIK LINDSTR�M" <[EMAIL PROTECTED]>
Subject: setsockopt() return "protcol not available" please help
Date: Fri, 30 Mar 2001 16:31:30 +0200

Hi folks!

I want to port my OS/2 server written in C to Linux. But now I am stuck so I
could really need som help here.

When I try to set the SO_RCVTIMEO and SO_SNDTIMEO setsockopt() return
"protocol not available". When
setting SO_REUSEADDR with setsockopt() the return is 0 = okey.

int sockTime(S_sockInf **s_sockInf)
{
     int rc;
     struct timeval rcvTime,
                          sndTime;

     rcvTime.tv_sec  = readTimeout;
     rcvTime.tv_usec = 0;
     sndTime.tv_sec  = sendTimeout;
     sndTime.tv_usec = 0;

     if(setsockopt((*s_sockInf)->sock, SOL_SOCKET, SO_RCVTIMEO, (char
*)&rcvTime, sizeof(rcvTime))
        || setsockopt((*s_sockInf)->sock, SOL_SOCKET, SO_SNDTIMEO, (char
*)&sndTime, sizeof(sndTime))){
        perror("setsockopt(2)");
        return(1);
     }

 return(0);
}

Using gcc 2.95 and compiling without paramaters "gcc main.c".

Is it something wrong with my network setup or is it somthing in the source?

Thanks in advance.

/Fredrik




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

From: Josef Moellers <[EMAIL PROTECTED]>
Subject: Re: C-Programming, getchar(), console
Date: Fri, 30 Mar 2001 16:40:51 +0200

"Jakub Orb=E1n" wrote:
> =

> Hi,
> =

> I'm new to linux, but i already c-programming (compiling progs with gcc=
,
> starting on the console (bash))
> now i have a simple small question:
> wenn i use getchar() in my programm, i have always to press <enter>, in=

> order to "get the attention" of the function
> is there a function that reacts on a sigle key-press?
> or: what the solution to this prob?

Normally the keyboard input is collected by the kernel and line editing
(backspace, erase) is done by the kernel and the line is only handed
over to the application when it is complete (ie when Enter is pressed).

You can change that by switching the standard input to cbreak mode or
into raw mode (in raw mode you will see ALL keys pressed, in cbreak mode
some keys are processed):

You should use tcgetattr/tcsetattr to change the mode:
raw mode:
    c_lflag &=3D ~(ECHO | ICANON | IEXTEN | ISIG);
    c_iflag &=3D ~(BRKINT | ICRNL | INPCK | ISTRIP | IXON);
    c_cflag &=3D |(CSIZE | PARENB);
    c_cflag |=3D CS8;
    c_oflag &=3D ~(OPOST);
    c_cc[VMIN] =3D 1;
    c_cc[VTIME] =3D 0;

cbreak mode:
    c_lflag &=3D ~(ECHO | ICANON);
    c_cc[VMIN] =3D 1;
    c_cc[VTIME] =3D 0;

HTH,
-- =

Josef M=F6llers (Pinguinpfleger bei FSC)
        If failure had no penalty success would not be a prize
                                                -- T.  Pratchett

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

From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: C-Programming, getchar(), console
Date: Fri, 30 Mar 2001 14:48:35 +0000

Jakub Orb�n wrote:
> 
> Hi,
> 
> I'm new to linux, but i already c-programming (compiling progs with gcc,
> starting on the console (bash))
> now i have a simple small question:
> wenn i use getchar() in my programm, i have always to press <enter>, in
> order to "get the attention" of the function
> is there a function that reacts on a sigle key-press?
> or: what the solution to this prob?
> 
> thx, bye, Jakub

It depends on the tty mode. By default your standard
input is connected to a tty, which is by default in
line editing mode. You have to switch the tty into
raw mode, this piece of code waits for any key to be
pressed.

#include <termios.h>
#include <unistd.h>
#include <stdio.h>

int main()
{
  struct termios ttysetings;
  tcgetattr(fileno(stdin),&ttysetings);
  {
    struct termios modified=ttysetings;
    modified.c_lflag &= ~(ICANON);
    tcsetattr(fileno(stdin),TCSANOW,&modified);
  }
  getchar();
  tcsetattr(fileno(stdin),TCSANOW,&ttysetings);
  return 0;
}

-- 
Kasper Dupont

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


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