Linux-Development-Sys Digest #952, Volume #7 Wed, 14 Jun 00 19:13:20 EDT
Contents:
Re: Problem with kernel module programming... ("Robichaud, Jean-Philippe
[BAN:6S33:EXCH]")
Re: How to mount floppey drive ? (Fabian Gebhardt)
Re: How to mount floppey drive ? (HomerWelch)
Disabling Buffer Cache? (Michael Mesnier)
ansiTime library: mktime() inconsistencies across platforms? (Mark Law)
ansiTime library: mktime() inconsistencies across platforms? (Mark Law)
Re: How to mount floppey drive ? (Michael Nadler)
Re: Disabling Buffer Cache? (Craig Kelley)
Use of insmod ("Ed Hudson")
Re: Disabling Buffer Cache? (Michael Mesnier)
Re: How to mount floppey drive ? (Rudi Sluijtman)
Re: Disabling Buffer Cache? (Kaz Kylheku)
Re: ansiTime library: mktime() inconsistencies across platforms? (Robert J Carter)
HELP!! login stops on new serial driver (robert_dev)
Re: Catch system calls from an apps? (Gautier Fabrice)
----------------------------------------------------------------------------
From: "Robichaud, Jean-Philippe [BAN:6S33:EXCH]" <[EMAIL PROTECTED]>
Crossposted-To:
linux.redhat.development,comp.os.linux.development.apps,comp.os.linux.networking
Subject: Re: Problem with kernel module programming...
Date: Wed, 14 Jun 2000 14:17:37 -0400
Since I've posted the first message, things have changed. what I have
to do is to programm a heart beat program for an ethernet card. The
idea is to ping the network card ip adress and if it fails, activate the
other network adapter and send a log.
Well, for now, what I must do is simply make a module that will ping an
ip adresses (that can be hard coded for now, using /proc is for a future
plan..! Now, my problem is that I need function such as inet_addr,
inet_ntoa, socket, sendto. I can rewrite inet_addr and inet_ntoa, but I
do not have the knoweldge to write socket and sendto !!! I'm new to
linux proramming and to network programming so I have a lot of thing to
learn in the same time !
I can't include socket.h because it cause a lot of redefinition and my
module can't compile
Thank you for your help
--
Jean-Philippe Robichaud
[EMAIL PROTECTED]
(514) 818-7750
(ESN) 888-7750
St-Laurent, Quebec, Canada
------------------------------
From: Fabian Gebhardt <[EMAIL PROTECTED]>
Crossposted-To: linux.help,comp.os.linux.development.apps,comp.os.linux.setup
Subject: Re: How to mount floppey drive ?
Date: Wed, 14 Jun 2000 21:05:54 +0200
Hello!
I don't know if I understood you, but have a look:
Robert schrieb:
>
> Thanks again
>
> I did mkdir �p /mnt/floppy and mount �t msdos dev/fd0 mnt/floppy
^^^^^^^^^^
The Mountpoint
>
> When I do this some thing happening in my floppy and it start blinking.
--> The floppy should be mounted now!
> But when I am writing ( mdir a: or mcopy a:*. ) it is saying cant open
> device, device is beusy, cant initialise A.) In tried from desktop
> navigator to read my floppy using open location in kfm by writing (/dev/fd0)
> I am getting file does not exist or acess denid.
Thats OK! You've already mounted the device. You can now write on the
diskette. Simple copy all you want to write to the disk to the
"mountpoint" (here: /mnt/floppy). The data should be written to the
disk. When you've finished you have to umount the disk.
> Why it is saying file does not exist, I am trying to read my floppy disk.
If you have mounted the floppy you can't use the m-tools (mdir, mcopy
...).
Either mount or use the m-tools!
> I also tried to read my cdrom , it is saying the same answer again. It
> couldnt be possible, because I installed Linux using my floppy disk and
> cdrom.
>
> Please help I have tried every thing
Hope I helped you.
>
> Thanks Million times Robert
No Problem.
--
CU, Fabian Gebhardt
E-Mail: [EMAIL PROTECTED]
Homepage: http://www.ki.tng.de/~gebhardt
Schul-Seite: http://www.ebg.org
------------------------------
From: HomerWelch <[EMAIL PROTECTED]>
Crossposted-To: linux.help,comp.os.linux.development.apps,comp.os.linux.setup
Subject: Re: How to mount floppey drive ?
Date: Wed, 14 Jun 2000 20:05:06 GMT
Robert wrote:
>
> Thanks again
>
> I did mkdir �p /mnt/floppy and mount �t msdos dev/fd0 mnt/floppy
>
> When I do this some thing happening in my floppy and it start blinking.
> But when I am writing ( mdir a: or mcopy a:*. ) it is saying cant open
> device, device is beusy, cant initialise A.) In tried from desktop
> navigator to read my floppy using open location in kfm by writing (/dev/fd0)
> I am getting file does not exist or acess denid.
> Why it is saying file does not exist, I am trying to read my floppy disk.
> I also tried to read my cdrom , it is saying the same answer again. It
> couldnt be possible, because I installed Linux using my floppy disk and
> cdrom.
>
> Please help I have tried every thing
>
Is the floppy formatted?
Do: cd /mnt/floppy
ls -l
and see what you get.
--
Homer J. Welch [EMAIL PROTECTED]
Troy, Michigan
------------------------------
From: Michael Mesnier <[EMAIL PROTECTED]>
Subject: Disabling Buffer Cache?
Date: Wed, 14 Jun 2000 13:28:57 -0700
Hello,
Does anyone know of a way to disable the Linux buffer cache for ext2? or
for a specified block device?
Best regards,
Mike Mesnier
------------------------------
From: Mark Law <[EMAIL PROTECTED]>
Crossposted-To: comp.lang.c,comp.os.linux.misc,comp.os.linux.portable
Subject: ansiTime library: mktime() inconsistencies across platforms?
Date: Wed, 14 Jun 2000 21:14:19 GMT
#### If replying, please cc "[EMAIL PROTECTED]" ###
I'm a software developer whose trying to resolve some issues with
ansiTime library implementations. I've found differences between test
results produced on SunOS 5.7 (using SUN's libs), Linux (using GNU
2.95.2 libs), and Microsoft Win NT 4.0 (using MS Visual C++ 5.0, Dev.
Studio 97).
I'm running some test code that calls mktime() with varying inputs,
where the inputs are predominantly around daylight savings start and end
transitions; ie. the hour before DST starts, the hour DST starts, the
hour after DST started, etc. On all but Win NT 4.0, I'm setting the TZ
environment variable with the DST start and end times so my test results
should be consistent across systems. I'm using strftime() to format
then print the results.
The SunOS and Win NT results are very similar. I also believe they
are the most accurate. The linux results differ widely from the SunOS &
Win NT results.
My first question is more general. Where is a complete description of
how mktime() is supposed to behave? I've read man pages, etc. There's
much documentation that describes mktime(), some of it, even clearly
defines the meaning of the DST flag input parameter. Some of the
mktime() documentation states that it can change members of the input tm
structure. However, what I'm noticing is that different ansiTime lib
implementations on different systems produce different results given the
same inputs. Is there some definitive description that can determine
which implementation is correct?
My second question is about 1 particular difference of the many that
I've discovered.
Between the SunOS and Win NT systems, the only difference between the
results is the following:
Given the following:
TZ=PST8PDT7,92,302 /* SunOS only. I don't know if it's possible
* to set DST start, end in Win NT 4.0 */
time_t time;
struct tm timeptr;
timeptr.tm_sec = 0; /* seconds after the minute [0, 61] */
timeptr.tm_min = 0; /* minutes after the hour [0, 59] */
timeptr.tm_hour = 1; /* hour since midnight [0, 23] */
timeptr.tm_mday = 29; /* day of the month [1, 31] */
timeptr.tm_mon = 9; /* months since January [0, 11] */
timeptr.tm_year = 100; /* years since 1900 */
/* int tm_wday; NOT SET */ /* days since Sunday [0, 6] */
/* int tm_yday; NOT SET */ /* days since January 1 [0, 365] */
timeptr.tm_isdst = -1; /* flag for daylight savings time */
time = mktime(&timeptr);
SunOS produces the following results:
After mktime: day of week: 0 day of year: 302 DST: 1
The time: 972806400 0x39fbd900 is 0 10 29 01:00:00 2000 AM 01 PDT
datesTest: expected: 972810000 got: 972806400
SunOS determined this input time was in daylight savings time.
Win NT 4.0 produces the following results:
After mktime: day of week: 0 day of year: 302 DST: 0
The time: 972810000 0x39fbe710 is 0 10 29 01:00:00 2000 AM 01 PST
Win NT 4.0 determined this input time was in standard time.
Note: strftime is used with the format: "%w %m %d %I:%M:%S %Y %p %H %Z"
There are other test result diffs that follow the same pattern, where
the pattern is for times given on the boundary of transitioning from
daylight savings to standard time, SunOS treats tm_isdst = -1 as if its
a "1" and the resulting time is a daylight savings time and Win NT
treats tm_isdst = -1 as if its a "0" and the resulting time is NOT a
daylight savings time.
Which behavior is correct?
mlaw
--
Mark A. Law Phone: (650) 701-4096
Liberate Technologies Fax: (650) 701-4096
2 Circle Star Way Home: (408) 255-3844
San Carlos, CA 94070-6200 Email: [EMAIL PROTECTED]
------------------------------
From: Mark Law <[EMAIL PROTECTED]>
Crossposted-To: comp.lang.c,comp.os.linux.misc,comp.os.linux.portable
Subject: ansiTime library: mktime() inconsistencies across platforms?
Date: Wed, 14 Jun 2000 21:04:54 GMT
#### If replying, please cc "[EMAIL PROTECTED]" ###
I'm a software developer whose trying to resolve some issues with
ansiTime library implementations. I've found differences between test
results produced on SunOS 5.7 (using SUN's libs), Linux (using GNU
2.95.2 libs), and Microsoft Win NT 4.0 (using MS Visual C++ 5.0, Dev.
Studio 97).
I'm running some test code that calls mktime() with varying inputs,
where the inputs are predominantly around daylight savings start and end
transitions; ie. the hour before DST starts, the hour DST starts, the
hour after DST started, etc. On all but Win NT 4.0, I'm setting the TZ
environment variable with the DST start and end times so my test results
should be consistent across systems. I'm using strftime() to format
then print the results.
The SunOS and Win NT results are very similar. I also believe they
are the most accurate. The linux results differ widely from the SunOS &
Win NT results.
My first question is more general. Where is a complete description of
how mktime() is supposed to behave? I've read man pages, etc. There's
much documentation that describes mktime(), some of it, even clearly
defines the meaning of the DST flag input parameter. Some of the
mktime() documentation states that it can change members of the input tm
structure. However, what I'm noticing is that different ansiTime lib
implementations on different systems produce different results given the
same inputs. Is there some definitive description that can determine
which implementation is correct?
My second question is about 1 particular difference of the many that
I've discovered.
Between the SunOS and Win NT systems, the only difference between the
results is the following:
Given the following:
TZ=PST8PDT7,92,302 /* SunOS only. I don't know if it's possible
* to set DST start, end in Win NT 4.0 */
time_t time;
struct tm timeptr;
timeptr.tm_sec = 0; /* seconds after the minute [0, 61] */
timeptr.tm_min = 0; /* minutes after the hour [0, 59] */
timeptr.tm_hour = 1; /* hour since midnight [0, 23] */
timeptr.tm_mday = 29; /* day of the month [1, 31] */
timeptr.tm_mon = 9; /* months since January [0, 11] */
timeptr.tm_year = 100; /* years since 1900 */
/* int tm_wday; NOT SET */ /* days since Sunday [0, 6] */
/* int tm_yday; NOT SET */ /* days since January 1 [0, 365] */
timeptr.tm_isdst = -1; /* flag for daylight savings time */
time = mktime(&timeptr);
SunOS produces the following results:
After mktime: day of week: 0 day of year: 302 DST: 1
The time: 972806400 0x39fbd900 is 0 10 29 01:00:00 2000 AM 01 PDT
datesTest: expected: 972810000 got: 972806400
SunOS determined this input time was in daylight savings time.
Win NT 4.0 produces the following results:
After mktime: day of week: 0 day of year: 302 DST: 0
The time: 972810000 0x39fbe710 is 0 10 29 01:00:00 2000 AM 01 PST
Win NT 4.0 determined this input time was in standard time.
Note: strftime is used with the format: "%w %m %d %I:%M:%S %Y %p %H %Z"
There are other test result diffs that follow the same pattern, where
the pattern is for times given on the boundary of transitioning from
daylight savings to standard time, SunOS treats tm_isdst = -1 as if its
a "1" and the resulting time is a daylight savings time and Win NT
treats tm_isdst = -1 as if its a "0" and the resulting time is NOT a
daylight savings time.
Which behavior is correct?
mlaw
--
Mark A. Law Phone: (650) 701-4096
Liberate Technologies Fax: (650) 701-4096
2 Circle Star Way Home: (408) 255-3844
San Carlos, CA 94070-6200 Email: [EMAIL PROTECTED]
------------------------------
From: Michael Nadler <[EMAIL PROTECTED]>
Crossposted-To: linux.help,comp.os.linux.development.apps,comp.os.linux.setup
Subject: Re: How to mount floppey drive ?
Date: Wed, 14 Jun 2000 14:17:54 -0700
==============2D806A390AF1C8FCD8E55CC8
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
You are running Linux now, not DOS. The good-old letter-names for devices
don't exist in Unix. Once the floppy (/dev/fd0) is mounted at /mnt/floppy --
all you need to do is "cd" to that mount-point & list the files there, etc.:
cd /mnt/floppy
ls
[whatever else you have to do]
Robert wrote:
> Thanks again
>
> I did mkdir -p /mnt/floppy and mount -t msdos dev/fd0 mnt/floppy
>
> When I do this some thing happening in my floppy and it start blinking.
> But when I am writing ( mdir a: or mcopy a:*. ) it is saying cant open
> device, device is beusy, cant initialise A.) In tried from desktop
> navigator to read my floppy using open location in kfm by writing (/dev/fd0)
> I am getting file does not exist or acess denid.
> Why it is saying file does not exist, I am trying to read my floppy disk.
> I also tried to read my cdrom , it is saying the same answer again. It
> couldnt be possible, because I installed Linux using my floppy disk and
> cdrom.
>
> Please help I have tried every thing
>
> Thanks Million times Robert
--
>
> The American Republic will endure until the day Congress discovers that it
> can bribe the public with the public's money. --Alexis de Toucqueville (~1805)
==============2D806A390AF1C8FCD8E55CC8
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
You are running Linux now, not DOS. The good-old letter-names for
devices don't exist in Unix. Once the floppy (/dev/fd0) is mounted
at /mnt/floppy -- all you need to do is "cd" to that mount-point & list
the files there, etc.:
<p> cd /mnt/floppy
<br> ls
<br> [whatever else you have to do]
<br>
<p>Robert wrote:
<blockquote TYPE=CITE>Thanks again
<p>I did mkdir -p /mnt/floppy and mount -t msdos dev/fd0 mnt/floppy
<p>When I do this some thing happening in my floppy and it start blinking.
<br>But when I am writing ( mdir a: or mcopy a:*. ) it is saying
cant open
<br>device, device is beusy, cant initialise A.) In tried from desktop
<br>navigator to read my floppy using open location in kfm by writing (/dev/fd0)
<br>I am getting file does not exist or acess denid.
<br>Why it is saying file does not exist, I am trying to read my floppy
disk.
<br>I also tried to read my cdrom , it is saying the same answer again.
It
<br>couldnt be possible, because I installed Linux using my floppy disk
and
<br>cdrom.
<p>Please help I have tried every thing
<p>Thanks Million times Robert</blockquote>
<pre>--
>
> The American Republic will endure until the day Congress discovers that it
> can bribe the public with the public's money. --Alexis de Toucqueville
>(~1805)</pre>
</html>
==============2D806A390AF1C8FCD8E55CC8==
------------------------------
Subject: Re: Disabling Buffer Cache?
From: Craig Kelley <[EMAIL PROTECTED]>
Date: 14 Jun 2000 15:35:22 -0600
Michael Mesnier <[EMAIL PROTECTED]> writes:
> Hello,
>
> Does anyone know of a way to disable the Linux buffer cache for ext2? or
> for a specified block device?
>
> Best regards,
You could always mount the filesystem with the sync option.
--
The wheel is turning but the hamster is dead.
Craig Kelley -- [EMAIL PROTECTED]
http://www.isu.edu/~kellcrai finger [EMAIL PROTECTED] for PGP block
------------------------------
From: "Ed Hudson" <[EMAIL PROTECTED]>
Subject: Use of insmod
Date: Wed, 14 Jun 2000 18:07:13 -0500
I am trying to write a modular device driver that crashes on
initialization. If I type lsmod I see that the driver is initilizing. However, I
cannot rmmod it or try to reload
it. If I try to rmmod I get a "device or resource busy" message and if I try
reloading the module I am told
that it is already loaded. Is there a way of forcing the module out other than
rebooting the machine?
Also is there a How-to or other bit of documentation on kernel level debugging using
gdb or some other
debugger?
Thanks for your help
Ed Hudson
[EMAIL PROTECTED]
====== Posted via Newsfeeds.Com, Uncensored Usenet News ======
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
======= Over 80,000 Newsgroups = 16 Different Servers! ======
------------------------------
From: Michael Mesnier <[EMAIL PROTECTED]>
Subject: Re: Disabling Buffer Cache?
Date: Wed, 14 Jun 2000 14:58:27 -0700
I just tried this, with no luck. I put the sync option both in /etc/fstab and
tried it on the command line via -o sync.
What I really need to do is simply avoid the buffer cache altogether. I'm not
even sure if this is possible in linux. I could perhaps accomplish the same
thing by limiting the size of the buffer cache to something small (like 1MB),
but I can't find anywhere in the kernel source to set this size.
Mike
Craig Kelley wrote:
> Michael Mesnier <[EMAIL PROTECTED]> writes:
>
> > Hello,
> >
> > Does anyone know of a way to disable the Linux buffer cache for ext2? or
> > for a specified block device?
> >
> > Best regards,
>
> You could always mount the filesystem with the sync option.
>
> --
> The wheel is turning but the hamster is dead.
> Craig Kelley -- [EMAIL PROTECTED]
> http://www.isu.edu/~kellcrai finger [EMAIL PROTECTED] for PGP block
------------------------------
Crossposted-To: linux.help,comp.os.linux.development.apps,comp.os.linux.setup
Subject: Re: How to mount floppey drive ?
From: Rudi Sluijtman <[EMAIL PROTECTED]>
Date: Wed, 14 Jun 2000 22:11:15 GMT
Hi Robert,
"Robert" <[EMAIL PROTECTED]> writes:
> I did mkdir �p /mnt/floppy and mount �t msdos dev/fd0 mnt/floppy
> When I do this some thing happening in my floppy and it start blinking
If your floppy contains a dos filesystem, you access it through the mounted
filesystem, eg "ls /mnt/floppy"
> But when I am writing ( mdir a: or mcopy a:*. ) it is saying cant open
> device, device is beusy, cant initialise A.) In tried from desktop
If you want to use the mtools like mdir, mcopy etc, you *must not
mount* the floppy!
> navigator to read my floppy using open location in kfm by writing (/dev/fd0)
> I am getting file does not exist or acess denid.
> Why it is saying file does not exist, I am trying to read my floppy disk.
> I also tried to read my cdrom , it is saying the same answer again. It
> couldnt be possible, because I installed Linux using my floppy disk and
> cdrom.
Usually you do not directly access filessytems through the device nodes
like /dev/fd0 or /dev/cdrom.
> Please help I have tried every thing
But not in the right order: you can mount /dev/fd0 and access files
the unix/linux way on directory /mnt/floppy, or, in case of msdos-fs,
you do NOT mount /dev/fd0 but access the floppy by using the mtools
(that do access /dev/fd0 directly themselves).
Have fun,
Rudi Sluijtman.
------------------------------
From: [EMAIL PROTECTED] (Kaz Kylheku)
Subject: Re: Disabling Buffer Cache?
Reply-To: [EMAIL PROTECTED]
Date: Wed, 14 Jun 2000 22:32:25 GMT
On Wed, 14 Jun 2000 14:58:27 -0700, Michael Mesnier <[EMAIL PROTECTED]>
wrote:
>I just tried this, with no luck. I put the sync option both in /etc/fstab and
>tried it on the command line via -o sync.
>
>What I really need to do is simply avoid the buffer cache altogether. I'm not
>even sure if this is possible in linux.
What will this give you? Are you expecting the data on disk to change behind
the operating system's back?
--
#exclude <windows.h>
------------------------------
From: [EMAIL PROTECTED] (Robert J Carter)
Subject: Re: ansiTime library: mktime() inconsistencies across platforms?
Crossposted-To: comp.lang.c,comp.os.linux.misc,comp.os.linux.portable
Date: Wed, 14 Jun 2000 22:41:17 GMT
In article <[EMAIL PROTECTED]>,
Mark Law <[EMAIL PROTECTED]> writes:
>
> There are other test result diffs that follow the same pattern, where
> the pattern is for times given on the boundary of transitioning from
> daylight savings to standard time, SunOS treats tm_isdst = -1 as if its
> a "1" and the resulting time is a daylight savings time and Win NT
> treats tm_isdst = -1 as if its a "0" and the resulting time is NOT a
> daylight savings time.
>
> Which behavior is correct?
>
> mlaw
>
I would tend to go with the SunOS behaviour. tm_isdst is *supposed* to
be a boolean value; non-zero is true, zero if false. The actual value
shouldn't matter.
--
Robert J Carter at Oghma dot on dot ca
Use My initials to reach me via e-mail
------------------------------
From: robert_dev <[EMAIL PROTECTED]>
Subject: HELP!! login stops on new serial driver
Date: Wed, 14 Jun 2000 22:40:59 GMT
I've written a serial driver which seems to perform correctly except
when using as a login terminal. It is set up as /dev/ttyJ0, with
/dev/ttyK0, the major devices numbers are 254 & 253, it is a loadable
module.
Getty runs and produces a login: prompt, this accepts the user name and
as soon as return is hit it goes away. It seems to sit in a loop sending
TCGETA and TCSETA to the driver. Eventually it times out. There is no
Password: prompt. The baud rate is set to 19200,8n1
The login I've tried to investigate is the pam version 3.1, the call to
pam_authenticate (pamh, 0) never returns. What is it looking for on the
serial line? or from the serial driver?
Robert
[EMAIL PROTECTED]
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
From: Gautier Fabrice <[EMAIL PROTECTED]>
Subject: Re: Catch system calls from an apps?
Date: 15 Jun 2000 00:50:31 +0200
"Douglas Kilpatrick" <[EMAIL PROTECTED]> writes:
> > For the moment i'm only looking for system calls but i may want to catch
> > libc calls (in programs dynamically linked with) or any other dynamic
>
> For that, you normally want to use option 1, and override libc symbols. In
> Linux, libc symbols are weak symbols, which means that if the program
> already has a symbol for "read", that will be used instead of the one in
> libc. Combine this with LD_PRELOAD, and you can inject an arbitrary
> library with your definitions of symbols into a process, and override the
> definitions in libc. (For obvious reasons, this does not work with setuid
> programs)
Hum ok, but in my lib, how do i call libc function?
For Example:
I've a modified read() in my lib, and i want it to call the libc
read() how do I make a distinction between both?
What happens if I do
int read(...)
{ int s;
do_whatever();
s=read(...);
do_another_thingor_two();
return s ;
}
Thanks.
A+
--
Fabrice Gautier
[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
******************************