Linux-Development-Sys Digest #434, Volume #8     Sun, 21 Jan 01 20:13:13 EST

Contents:
  Re: 4A58834B8 About software standards. (Erik de Castro Lopo)
  Re: module kernel version problem (Allin Cottrell)
  Re: Problems compiling programs with new 2.4 kernel (Allin Cottrell)
  Re: Difference between echo an cat (Kaz Kylheku)
  Re: 3A58834B8 About software standards. ([EMAIL PROTECTED])
  Re: 3A58834B8 About software standards. ([EMAIL PROTECTED])
  How to change a directory in a program? ("Alan Po")
  Re: How to change a directory in a program? (Donovan Rebbechi)
  Re: How to change a directory in a program? (Glenn Hutchings)
  Re: How to change a directory in a program? (Christoph 
=?iso-8859-1?Q?Hinterm=FCller?=)
  Re: How to change a directory in a program? ("Karl Heyes")
  Kernel mailing list, CDROMPLAYTRKIND (BERECZ Szabolcs)
  Re: Parse /proc/xxx or are there direct kernel structures? (Juha Laiho)
  Specifying libraries with gcc and/or ld ([EMAIL PROTECTED])
  Re: How to change a directory in a program? (Donovan Rebbechi)

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

From: Erik de Castro Lopo <[EMAIL PROTECTED]>
Subject: Re: 4A58834B8 About software standards.
Date: Sun, 21 Jan 2001 03:25:24 GMT

[EMAIL PROTECTED] wrote:
> 
>   WHAT IS LINUX ?:  NEW ADVANCED OPERATING SYSTEM FOR BUSINESSES , THAT PROVIDES
>    ALL KINDS OF NETWORKING, PRINTING AND THOUSANDS OF OTHER APPLICATIONS,
>     TYPICAL LINUX APPLICATIONS ARE LESS EXPENSIVE AND HIGHER QUALITY THAN THE
>    ONES FOR MICROSOFT WINDOWS , LINUX RAPIDLY SPREADING AND ABOUT TO BECOME
>    SINGLE UNIFIED OPERATING SYSTEM FOR ALL PERSONAL COMPUTERS BY YEAR 2003.
> 
>   NOW NEW TECHNICAL ILLUSTRATION AND DIAGRAMMING PROGRAM FOR LINUX IS AVAILABLE !!!
> ===================================================================================
> 
>                w  w  w . l i n u x c a d .  c o m


For the truth about this product have a look at:

        http://www.zip.com.au/~erikd/lcad.html

Erik


-- 
+----------------------------------------------------------+
  Erik de Castro Lopo  [EMAIL PROTECTED] (Yes its valid)
+----------------------------------------------------------+
"Having a firewall that allows NFS to the Internet is like having a 
seat belt that lets your head touch the dashboard." -- Marcus Ranum

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

From: Allin Cottrell <[EMAIL PROTECTED]>
Subject: Re: module kernel version problem
Date: Sat, 20 Jan 2001 22:15:29 -0500

KPG wrote:

> I'd like to make a module usable on more than one kernel version, so if it
> is compiled on say 2.2.11 it still runs on 2.2.17 et al.
> 
> How can this be done?

CONFIG_MODVERSIONS=y

-- 
Allin Cottrell
Department of Economics
Wake Forest University, NC

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

From: Allin Cottrell <[EMAIL PROTECTED]>
Subject: Re: Problems compiling programs with new 2.4 kernel
Date: Sat, 20 Jan 2001 22:13:40 -0500

Josh Liechty wrote:

> > > /usr/src/linux/include/linux/modversions.h and serial_compat.h . 
> a) These files do not exist.

modversions.h should be there.  It may be that you have to enable
module versioning symbols (in configuring the kernel source) before 
this file appears.  serial_compat.h seems to be obsolete.

> I got the driver that was supposed to work with 2.4, but maybe they've
> made a patch to it since then. I'll check this out.

You should use the ltmodem-5.78D package with 2.4.0.

http://walbran.org/sean/linux/stodolsk/

-- 
Allin Cottrell
Department of Economics
Wake Forest University, NC

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

From: [EMAIL PROTECTED] (Kaz Kylheku)
Subject: Re: Difference between echo an cat
Reply-To: [EMAIL PROTECTED]
Date: Sun, 21 Jan 2001 05:02:37 GMT

On Sat, 20 Jan 2001 23:55:31 +0100, Joachim Rosskopf
<[EMAIL PROTECTED]> wrote:
>Hello,
>
>what's the difference of the output between echo and cat ??? My Problem
>is that I've written a kernel dirver for a lcd display ( that is not the
>problem ) but if I cat something to this device the kernel crashes. If
>the same text is echoed everything runs well.

The difference is that echo is a command that is built into your shell
and cat is a binary in /bin. When you use echo, your shell opens the
device, dumps data to it and closes it. When you use cat, your shell
opens the device, forks off the process which inherits a duplicate of
the file descriptor, that process then dumps data to it, closes its
duplicate of the descriptor and then your shell reaps the process and
also closes its descriptor. Quite a few more things happen, obviously.
So perhaps there is some some sensitivity in your to being opened by
one process and being written by another.

By the way, try using /bin/echo instead of echo. 

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

From: [EMAIL PROTECTED]
Subject: Re: 3A58834B8 About software standards.
Date: Sun, 21 Jan 2001 05:21:31 GMT

[EMAIL PROTECTED] writes:

>    LINUX CAD IS THE AUTO CAD AND THE VISIO FOR LINUX FOR ALL
> PRACTICAL PURPOSES IT IMPLEMENTS ALL MAJOR FEATURES OF AUTOCAD AND
> VISIO IN SUCH A WAY THAT NEW USERS (WHO HAD ACAD EXPERIENCE BEFORE)
> DO NOT NEED ANY ADDITIONAL TRAINING TO START WORKING WITH LINUX CAD
> ).

Oh, goodie.  The spam-meisters from "LinuxCAD" have gotten a new email
account.

> One more thing: there is a scum bug out there who is contstantly
> hacking our web site, so consider yourself lucky if you have the
> opportunity actually see the web site and use that opportunity to
> order LinuxCAD immediately.

Based on the quality of spelling/grammar, I find it completely
unsurprising that they would configure their web site with such potent
'scum bugs' that the site would go down regularly.

-- 
(concatenate 'string "cbbrowne" "@ntlug.org")
http://vip.hex.net/~cbbrowne/rdbms.html
Rules of  the Evil Overlord #139. "If  I'm sitting in my  camp, hear a
twig  snap, start  to  investigate, then  encounter  a small  woodland
creature, I  will send out some scouts  anyway just to be  on the safe
side. (If they disappear into the foliage, I will not send out another
patrol; I will break out napalm and Agent Orange.)"
<http://www.eviloverlord.com/>

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

From: [EMAIL PROTECTED]
Subject: Re: 3A58834B8 About software standards.
Date: Sun, 21 Jan 2001 05:21:59 GMT

[EMAIL PROTECTED] writes:

>    LINUX CAD IS THE AUTO CAD AND THE VISIO FOR LINUX FOR ALL
> PRACTICAL PURPOSES IT IMPLEMENTS ALL MAJOR FEATURES OF AUTOCAD AND
> VISIO IN SUCH A WAY THAT NEW USERS (WHO HAD ACAD EXPERIENCE BEFORE)
> DO NOT NEED ANY ADDITIONAL TRAINING TO START WORKING WITH LINUX CAD
> ).

Oh, goodie.  The spam-meisters from "LinuxCAD" have gotten a new email
account.

> One more thing: there is a scum bug out there who is contstantly
> hacking our web site, so consider yourself lucky if you have the
> opportunity actually see the web site and use that opportunity to
> order LinuxCAD immediately.

Based on the quality of spelling/grammar, I find it completely
unsurprising that they would configure their web site with such potent
'scum bugs' that the site would go down regularly.

-- 
(concatenate 'string "cbbrowne" "@ntlug.org")
http://vip.hex.net/~cbbrowne/rdbms.html
Rules of  the Evil Overlord #139. "If  I'm sitting in my  camp, hear a
twig  snap, start  to  investigate, then  encounter  a small  woodland
creature, I  will send out some scouts  anyway just to be  on the safe
side. (If they disappear into the foliage, I will not send out another
patrol; I will break out napalm and Agent Orange.)"
<http://www.eviloverlord.com/>

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

From: "Alan Po" <[EMAIL PROTECTED]>
Crossposted-To: 
comp.os.linux.development,comp.os.linux.development.apps,linux.dev.c-programming
Subject: How to change a directory in a program?
Date: Sun, 21 Jan 2001 23:28:12 +0800

Dear all

I have tried to write an application which can let the user to change the
current directory, I use a system function "chdir" but it doesn't work.

Part of my programme is:

printf("Please input a directory name:");
scanf(cp);

if (chdir(cp))
    printf("no such directory %s", cp);

It doesn't work. I am also try to use system("cd xyz") but also fail. Please
give me some advices.

Thanks for any idea or comment.

Alan Po

[EMAIL PROTECTED]





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

From: [EMAIL PROTECTED] (Donovan Rebbechi)
Crossposted-To: 
comp.os.linux.development,comp.os.linux.development.apps,linux.dev.c-programming
Subject: Re: How to change a directory in a program?
Date: 21 Jan 2001 16:21:35 GMT

On Sun, 21 Jan 2001 23:28:12 +0800, Alan Po wrote:
>Dear all
>
>I have tried to write an application which can let the user to change the
>current directory, I use a system function "chdir" but it doesn't work.

The problem is that your program runs in a subshell. The subshell changes
directory, then the program exits, and you're back to the current shell
(which hasn't changed directory). I believe cd  has to be a shell
built in to work.

If you *really* want to test that your program is working, use opendir()
and readdir() to check what files are in the directory you've changed to.


-- 
Donovan Rebbechi * http://pegasus.rutgers.edu/~elflord/ * 
elflord at panix dot com

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

From: Glenn Hutchings <[EMAIL PROTECTED]>
Crossposted-To: 
comp.os.linux.development,comp.os.linux.development.apps,linux.dev.c-programming
Subject: Re: How to change a directory in a program?
Date: Sun, 21 Jan 2001 16:36:32 GMT

On Sun, 21 Jan 2001 23:28:12 +0800, "Alan Po" <[EMAIL PROTECTED]> wrote:
> I have tried to write an application which can let the user to change the
> current directory, I use a system function "chdir" but it doesn't work.
> 
> Part of my programme is:
> 
> printf("Please input a directory name:");
> scanf(cp);
> 
> if (chdir(cp))
>     printf("no such directory %s", cp);
> 
> It doesn't work. I am also try to use system("cd xyz") but also fail. Please
> give me some advices.

The chdir() command should work fine.  Try something like:

    chdir("/");
    system("ls");

It should list the contents of the root directory.  Your problem is the scanf() call 
to read
the directory in.  The first argument should be a template indicating what to read in, 
not
the thing itself -- try scanf("%s", string), where the string is declared as: char 
string[80].

Regards,

Glenn



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

From: Christoph =?iso-8859-1?Q?Hinterm=FCller?= <[EMAIL PROTECTED]>
Crossposted-To: 
comp.os.linux.development,comp.os.linux.development.apps,linux.dev.c-programming
Subject: Re: How to change a directory in a program?
Date: Sun, 21 Jan 2001 17:21:31 GMT

Glenn Hutchings wrote:
> 
> On Sun, 21 Jan 2001 23:28:12 +0800, "Alan Po" <[EMAIL PROTECTED]> wrote:
> > I have tried to write an application which can let the user to change the
> > current directory, I use a system function "chdir" but it doesn't work.
> >
> > Part of my programme is:
> >
> > printf("Please input a directory name:");
> > scanf(cp);
> >
> > if (chdir(cp))
> >     printf("no such directory %s", cp);
> >
> > It doesn't work. I am also try to use system("cd xyz") but also fail. Please
> > give me some advices.
> 
> The chdir() command should work fine.  Try something like:
> 
>     chdir("/");
>     system("ls");
> 
Hi
This is the same as above as the chdir does not affect the shell it selve at all it 
only changes directory,
lists it and exits back to the place it was started before.
The only working way is to make something like that


alias 'spcd'='runme=`specialcd`;eval $runme;'

and the program istselve contains at least the following lines:

char direct[80];
direct[0]='l';
direct[1]='\0';
while(!chdir(&direct)&&!strncmp(&direct,"q",1)){
  if(strncmp(&direct,"l",1)){
    system("ls");
  }
  printf('enter directoryname or enter l for listing or q for abbort:');
  scanf("%s",&direct);
}
if(strncmp(&direct,"q",1)){
  printf("pwd");
  return /**whatever you want or have to return; or exit here**/
}
printf("cd %s",direct);
return /**whatever you want or have to return; or exit here**/

so what happens now if you dont have a verry crap porting to windows shell like 
nutcracker
the alias will call the specialcd program which asks for a new directory until the use 
either enters a valid one or calls quit via q and saves the outcome to the runme 
variable.
Next shell tries to evalueate the content of rume and either finds the cd command and 
changes dirs or
displays as goody the name of the actual directory.
But if your program shall really be used as a DAU cd for the shell you should think of 
writng it as a shell script.

the only way to shorten it is to make the alias something like that:
alias 'spcd'='eval `specialcd`'

If your program is just the start of something speciall not interfeering with the 
shell at all it is better to check within the program instead of making shell do it 
for you.
cu
Christoph
-- 
THESIS:     God is alive
PROOVE:     Who else would have scheduled the mankind and world first
            recommendation of resurch????
CONCLUSION: Scientist do what he wants, willing or not:)

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

From: "Karl Heyes" <[EMAIL PROTECTED]>
Crossposted-To: 
comp.os.linux.development,comp.os.linux.development.apps,linux.dev.c-programming
Subject: Re: How to change a directory in a program?
Date: Sun, 21 Jan 2001 20:34:29 +0000

In article <94evaj$[EMAIL PROTECTED]>, "Alan Po"
<[EMAIL PROTECTED]> wrote:

> Dear all
> 
> I have tried to write an application which can let the user to
> change the current directory, I use a system function "chdir" but it
> doesn't work.
> 
> Part of my programme is:
> 
> printf("Please input a directory name:"); scanf(cp);
> 
> if (chdir(cp))
>     printf("no such directory %s", cp);
> 

I would check what cp contains, nul chars etc.  I think you are
not getting the correct info into cp.   check the errno value as
well.


> It doesn't work. I am also try to use system("cd xyz") but also
> fail. Please give me some advices.
> 

it won't work.  system invokes a shell which run the cd command then
terminates.  so you did change directory but it had no effect on
anything else.

karl.

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

Date: Sun, 21 Jan 2001 23:55:41 +0100
From: BERECZ Szabolcs <[EMAIL PROTECTED]>
Subject: Kernel mailing list, CDROMPLAYTRKIND


Hello!

Where can I subscribe to a kernel mailing list?

I have a Sanyo CDROM, and a HP CD-RW. Both of them use the ATAPI protocol,
and neither of them support the CDROMPLAYTRKIND command. Until the version
3.11 of the cdrom.c in the kernel source came out, it worked for me,
becouse it was emulated through the CDROMPLAYMSF. Now it's not emulated.
so why do you think it has been changed, if this command is _not_ 
supported by some (a lot of?) drive?

Bye,
Szabi

PS: I know, I have to ask the maintainer about this. (I will... :) )


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

From: Juha Laiho <[EMAIL PROTECTED]>
Subject: Re: Parse /proc/xxx or are there direct kernel structures?
Date: 21 Jan 2001 22:45:19 +0200

[EMAIL PROTECTED] said:
>Not trying to reinvent the wheel, but I need to capture some of the system
>status and export them periodically to a remote machine. Should this be done by
>parsing the various /proc files or is there some direct access api? I've been
>looking at top source code, and source code for libproc. These are not exactly
>clear to the un-initiated.

I'd recommend /proc; that's provided as the primary API to use.
Unfortunately I cannot answer the rest of your questions, except

>Guess I'll head off to the Microcenter and pick up a book if necessary--any
>recommendations?

Look out for outdated books. /proc appears still to be a moving target,
i.e. is developing at least in some parts at a rate too fast for any
paper media to keep up with.

As you're looking for per-process I/O statistics, though, I'd assume these
are collected to the per-process statistis (/proc/PID/?), if anywhere. My
guess would've been /proc/PID/stat, but I went digging through the kernel
code and found (function get_stat in fs/proc/array.c) that the guess was
wrong. Now I'm beginning to suspect that per-process I/O isn't summarized
anywhere.
-- 
Wolf  a.k.a.  Juha Laiho     Espoo, Finland
(GC 3.0) GIT d- s+: a- C++ UH++++$ UL++++ P+@ L+++ E(-) W+$@ N++ !K w !O
         !M V PS(+) PE Y+ PGP(+) t- 5? !X R tv--- b+ DI? D G e+ h--- r+++ y+
"...cancel my subscription to the resurrection!" (Jim Morrison)

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

From: [EMAIL PROTECTED]
Crossposted-To: comp.os.linux.development.apps
Subject: Specifying libraries with gcc and/or ld
Date: Sun, 21 Jan 2001 23:41:50 GMT

There may be a simple answer to this question, but hours of searching
have not revealed it. Basically, what I'm trying to do is compile a
program with precise library specification. I do not want any default
system libraries or include files to be used. I have tried using

make CFLAGS="-v -nostdlib -nostdinc -I/my/include/directory
-L/my/library/directory -lsomelib"

which seems to do ok until it gets to the linker, at which point I get
the following (this example tries to compile "sed"):


/usr/lib/gcc-lib/i386-redhat-linux/2.96/collect2 -m elf_i386
-dynamic-linker /lib/ld-linux.so.2 -o sed -L/usr/lib
-L/usr/lib/gcc-lib/i386-redhat-linux/2.96
-L/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../.. /usr/lib/libc.so
sed.o compile.o execute.o utils.o ../lib/libsed.a
/usr/bin/ld: warning: cannot find entry symbol _start; defaulting to
08048d10
sed.o: In function `map_file':
sed.o(.text+0x26f): undefined reference to `fstat64'
collect2: ld returned 1 exit status

=====================================================


Without the "-nostdlib" and "-nostdinc" flags in CFLAGS, everything
works and the verbose output from the link stage is:


 /usr/lib/gcc-lib/i386-redhat-linux/2.96/collect2 -m elf_i386
-dynamic-linker /lib/ld-linux.so.2 -o sed
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../crt1.o
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../crti.o
/usr/lib/gcc-lib/i386-redhat-linux/2.96/crtbegin.o -L/usr/lib
-L/usr/lib/gcc-lib/i386-redhat-linux/2.96
-L/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../.. /usr/lib/libc.so
sed.o compile.o execute.o utils.o ../lib/libsed.a -lgcc -lc -lgcc
/usr/lib/gcc-lib/i386-redhat-linux/2.96/crtend.o
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../crtn.o

=====================================================


Testing has revealed that if I run my original make (the one with the
CFLAGS="..."), watch the linker bomb, then manually type in the above
(adding "/usr/lib/libc.so") a "sed" is generated, but running ldd on it
shows:

user$ ldd sed
        libc.so.6 => /lib/libc.so.6 (0x4001e000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

I don't know where it's picking up libc.so.6... If I add "-nostdlib" and
"-nostdinc" to the command, a "sed" is generated, but running it results
in a segmentation fault and ldd returns:

user$ ldd sed
        not a dynamic executable


Any suggestions?



Sent via Deja.com
http://www.deja.com/

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

From: [EMAIL PROTECTED] (Donovan Rebbechi)
Crossposted-To: 
comp.os.linux.development,comp.os.linux.development.apps,linux.dev.c-programming
Subject: Re: How to change a directory in a program?
Date: 22 Jan 2001 00:36:22 GMT

On Sun, 21 Jan 2001 16:36:32 GMT, Glenn Hutchings wrote:
>On Sun, 21 Jan 2001 23:28:12 +0800, "Alan Po" <[EMAIL PROTECTED]> wrote:

>It should list the contents of the root directory.  Your problem is the
>scanf() call to read the directory in.  The first argument should be a
>template indicating what to read in, not the thing itself -- try scanf("%s",
>string), where the string is declared as: char string[80].

What if the input string is longer than 79 characters ? Better to use 
fgets() instead.


-- 
Donovan Rebbechi * http://pegasus.rutgers.edu/~elflord/ * 
elflord at panix dot 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 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