Linux-Development-Sys Digest #961, Volume #7 Mon, 19 Jun 00 15:13:18 EDT
Contents:
Re: Add 4inches in length to your penis now!!! 4950 (Lew Pitcher)
how to make a RPM? ("Harold")
Re: Problem with compiling glibc... (Andreas Jaeger)
Linux for AMD SC400 resource links? (Kang Tin LAI)
Packaging for Release (Avi Shmidman)
GO Hot-Swap for Compact PCI (Jungo Ltd.)
Re: A strange problem using poll() systemcall (Alan Donovan)
Re: HELP: Debugging Kernel Drivers (Alan Donovan)
Re: NVIDIA GLX Driver & XFree 4.0 (Toby Haynes)
Re: How to check the remained disk size in Linux (Alan Donovan)
Re: R: syscall (Michael F Gordon)
Poll on /proc files (Mathias Waack)
Re: Poll on /proc files (Alan Donovan)
Re: Poll on /proc files (Mathias Waack)
Socket functions in kernel space ("Jan Lund Kristensen")
Raw Keyboard Scancode (Yogesh Sharma)
Re: polling the keyboard (Mario Klebsch)
ctime ... Linux Bug ??? (David)
----------------------------------------------------------------------------
From: Lew Pitcher <[EMAIL PROTECTED]>
Crossposted-To:
comp.games.development.programming.misc,comp.org.user-groups.management,comp.os.linux.development.apps
Subject: Re: Add 4inches in length to your penis now!!! 4950
Date: Sun, 18 Jun 2000 09:47:41 -0400
[EMAIL PROTECTED] wrote:
> you to can have the huge dick of your dreams!!!
My guess is that the OP is a huge dick himself
--
Lew Pitcher
Master Codewright and JOAT-in-training
------------------------------
From: "Harold" <[EMAIL PROTECTED]>
Subject: how to make a RPM?
Date: Mon, 19 Jun 2000 14:32:01 +0800
This is a multi-part message in MIME format.
=======_NextPart_000_000D_01BFD9FB.22016A40
Content-Type: text/plain;
charset="gb2312"
Content-Transfer-Encoding: quoted-printable
Untitled DocumentIs there some downloadable tools?
Thanks!
==========================================================================
=======
Welcome to my linux page:
Linux Paradise (under construction)
BTW: Because my job is so busy, I=20
want some friend to maintain this=20
site with me together, please give=20
me some suggestion.
Thanks.=20
=======_NextPart_000_000D_01BFD9FB.22016A40
Content-Type: text/html;
charset="gb2312"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Untitled Document</TITLE>
<META content=3D"text/html; charset=3Dgb2312" =
http-equiv=3DContent-Type><BASE=20
href=3Dfile://C:\WIN98\Desktop\>
<META content=3D"MSHTML 5.00.2314.1000" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV>
<DIV>Is there some downloadable tools?</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>Thanks!</DIV>
<DIV>
<HR>
<BR></DIV></DIV>
<P>Welcome to my linux page:<BR><A href=3D"http://hyang.uhome.net"=20
target=3D_blank>Linux Paradise</A> (under construction)<BR>BTW: Because =
my job is=20
so busy, I <BR>want some friend to maintain this <BR>site with me =
together,=20
please give <BR>me some suggestion.<BR>Thanks. </P></BODY></HTML>
=======_NextPart_000_000D_01BFD9FB.22016A40==
------------------------------
From: Andreas Jaeger <[EMAIL PROTECTED]>
Subject: Re: Problem with compiling glibc...
Date: 19 Jun 2000 08:51:47 +0200
>>>>> Neelima Mehta writes:
> Hi,
> I am new at working with glibc - I want to compile glibc-2.0.6 as a test
The current version is 2.1.3, I advise to you this version.
> library. I've been following the instructions on :
[...]
> I then checked:
> http://www.imaxx.net/~thrytis/glibc/glibc-FAQ.html
> where they have recommended using make-3.75. I had used make-3.76.1, so I
That document is outdated.
> downgraded it. Yet, I ran into the same problem.
Andreas
--
Andreas Jaeger
SuSE Labs [EMAIL PROTECTED]
private [EMAIL PROTECTED]
------------------------------
From: Kang Tin LAI <[EMAIL PROTECTED]>
Subject: Linux for AMD SC400 resource links?
Date: Mon, 19 Jun 2000 08:27:36 -0100
Reply-To: [EMAIL PROTECTED]
Any resource links for AMD SC400 port?
------------------------------
From: Avi Shmidman <[EMAIL PROTECTED]>
Subject: Packaging for Release
Date: Mon, 19 Jun 2000 10:01:29 GMT
Hello,
We have compeleted development of a Linux device driver for our PCI
hardware (an avionics simulator), as well as a user mode API for
interfacing with the card.
The question now is, how should we distribute this? Should we use the
redhat RPM scheme, or will that help only redhat users? Should we
provide the source of the device driver, or just of the user mode API?
Should we provide executable examples programs, or just source?
My current thought is to distribute a zip with the following structure;
Please let me know how we can/should improve this:
/API/ In this directory we will put the files needed to build programs
with our API, along with example programs (source, makefiles, and
executables)
/Driver/ In this directory, we will put the device driver itself
(compiled) and a few shell scripts for easy loading and unloading of
the driver.
/Driver/Source/ Source and makefile for the device driver
In the root directory, we will place a readme which provides the
following:
1] Explanation of location of files
2] Explanation of loading/unloading the device driver
3] Specification of which kernel the device driver is built for
(2.2.x), and a list of considerations for rebuilding and using the
device driver under other kernels.
Thank You,
Avi Shmidman
Excalibur Systems
Jerusalem, Israel
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
From: Jungo Ltd. <[EMAIL PROTECTED]>
Subject: GO Hot-Swap for Compact PCI
Date: 19 Jun 2000 04:13:40 -0700
Jungo Ltd. Adds Hot Swap Capabilities to The Solaris Operating System
The GO Hot-Swap tools enable users to easily develop hot-swappable drivers from
scratch, or immediately add Hot-Swap capabilities to their existing PCI drivers.
The �GO Hot-Swap� is a generic solution, i.e. it is not dependant on the
hardware configuration on which it is running, or the host PCI controller it is
using. The same drivers written by the hardware vendor using the �GO Hot-Swap�
solution will compile and run on all supported operating systems, and on all
CompactPCI systems.
For more information regarding the Hot-Swap technology and a free evaluation
version, please visit: http://www.jungo.com/cpci.html
Amir Inbar, cPCI product manager
Web: www.jungo.com, Email: [EMAIL PROTECTED]
Phone: 1-877-514-0537 (USA) +972-9-8859365 (Worldwide), Ext. 103
Fax: 1-877-514-0538 (USA) +972-9-8859366 (Worldwide)
------------------------------
From: Alan Donovan <[EMAIL PROTECTED]>
Subject: Re: A strange problem using poll() systemcall
Date: Mon, 19 Jun 2000 15:17:18 +0100
"Roman A. Stepanov" wrote:
> > You are invoking poll every millisecond, which is very inefficient.
> > Consider what value of the third argument you really want, bearing in
> > mind that it's in milliseconds not seconds.
>
> Yes, I have to check if there any incoming data _every_ millisecond
> because it's very important to me to check some particular device
> connected to the serial port at least 100 times per second. I'd be
> grateful if anybody tells me how to do it as much faster as possible!
As pointed out, if the hardware writes bytes synchronously (i.e. without
being prompted) then you can block in poll() forever (or until you need
to do something else). If the hardware requires "polling" (here used
in a slightly different sense to poll()), you will need to wait, send a
command, try and receive a reply, wait again, etc etc. This is very
inefficient and is the motivation for hardware that interrupts
(synchronous serial HW _is_ in fact interrupting).
> > are using signals as you may need to restart the system call. If poll
> > returns 0, it means timeout. If it returns negative, you should call
> > perror() to inform yourself of what's going on. If it's EINTR, you
> > might want to restart the call.
> >
> As far as I understand if I get EINTR next call to poll() must return
> non-negative value, isn't it?
No: EINTR means poll was signalled before it completed. It does not
signify anything about the next poll.
> Yes, this isn't looking very efficient, I'll try to think how to
> re-wrtite this part. But I still don't understand why it's not working...
Nor do I. From what you've said, blocking in poll() for long periods
should be ok.
alan
--
========================================================================
Alan Donovan [EMAIL PROTECTED] http://www.imerge.co.uk
Imerge Ltd. +44 1223 875265
------------------------------
From: Alan Donovan <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: Re: HELP: Debugging Kernel Drivers
Date: Mon, 19 Jun 2000 15:25:07 +0100
Tod Daniels wrote:
>
> I am in the process of writing a linux 2.2.6 device driver for a specific
> card I need. I have run into an issue where I can successfully register
> the cards interrupt, but when the interrupt goes active, the entire system
> hangs -- no keyboard, no network, no console, no ctl-alt-del, nothing.
>
> I believe I have conclusively eliminated hardware conflicts as a source of
> problem. I have stripped out all extra hardware and I have tried two
> different irqs.
>
> In my request handler, I have the following:
>
> void dcpIrqHandler(int irq, void *dev_id, struct pt_regs *regs)
> {
> printk(KERN_INFO "test irq %d\n", irq);
> ..code to ack the interrupt...
> }
>
> Unfortunately, I never get to see this in the logs, so I assume the system
> freeze happens prior to this.
>
> Does anyone have any good URLs or other information on debugging
> techniques for device drivers???? Any code snippets I can include which
> may help me to understand why and when this driver freezes???
Just a couple of tips:
Direct all kern.* messages to the console: you are much more likely to
see them this way.
If you ever *need* to see a message, use printk followed by cli();
for(;;); which will hang the machine: this is useful if the screen gets
scrolled or obliterated shortly after your message.
Stick an scope probe (you do have one?) on the INTA# line (number 6 on
the left looking from the backplane inwards). [I assume you using PCI].
If it goes low, that's your interrupt. Ensure that you see it get reset
(high) or else your interrupt handler will be entered again and again.
Ensure you have programmed the card's interrupt routing pin & line
correctly to use INTA -- trying to use the others is disastrous (I fell
in this trap recently :-). How to do this will depend on your PCI
hardware.
HTH
alan
(let me know how you get on and send me mail directly if you like)
--
========================================================================
Alan Donovan [EMAIL PROTECTED] http://www.imerge.co.uk
Imerge Ltd. +44 1223 875265
------------------------------
From: Toby Haynes <[EMAIL PROTECTED]>
Crossposted-To: uk.comp.os.linux,comp.os.linux.x
Subject: Re: NVIDIA GLX Driver & XFree 4.0
Date: 19 Jun 2000 10:19:22 -0400
!! "Tony" == Me <[EMAIL PROTECTED]> writes:
Tony> Hi, I am having some problems getting the Accerlearted GL code
Tony> working on my Linux box. I am running kernel 2.2.15 with
Tony> glibc 2.0 (an upgrading SuSE 6.1 distribution). I have
Tony> successfully installed XFree 4.0 and got everything working.
Tony> I then installed Mesa 3.2 and got the libraries compiled and
Tony> all the demos running. I then downloaded the NVIDIA kernel
Tony> module and GLX drivers version 0.9-3 to run on my diamond
Tony> viper 550 (TNT) card. I installed all the kernel modules and
Tony> the GL libs from the tarball distribution (taking care to
Tony> rename old GL files). The X server works fine. The problems
Tony> start when I try to compile the Mesa xdemo "glxinfo" with
Tony> these libraries. I get the following output;
[snip]
Tony> Does anyone recognise the mistake Im making? Anymore info
Tony> needed?
Yes - your Mesa Libs are almost certainly conflicting with your NVidia
GLX libs. So you are running a half-and-half situation and it's not
happy!
If you take a look in the NVidia FAQ (available from the NVidia
drivers page) you'll see the list of critical Mesa files which cause
contention. The recommended procedure is to either rename or remove
the listed files. The FAQ also gives some other useful hints on
getting the accelerated OpenGL going and is probably worth getting as
hard copy to have on hand as you install.
Good luck!
Toby
--
Toby Haynes
The views and opinions expressed in this message are my own, and do
not necessarily reflect those of IBM Canada.
------------------------------
From: Alan Donovan <[EMAIL PROTECTED]>
Subject: Re: How to check the remained disk size in Linux
Date: Mon, 19 Jun 2000 15:29:29 +0100
Alexander Viro wrote:
>
> In article <8ihkeh$30r$[EMAIL PROTECTED]>,
> Nera <[EMAIL PROTECTED]> wrote:
> >Dear all
> >
> > How to check the remained disk size in Linux, like under DOS?
>
> Dunno about DOS, under any UNIX it's df.
The system call is statfs/fstatfs.
alan
--
========================================================================
Alan Donovan [EMAIL PROTECTED] http://www.imerge.co.uk
Imerge Ltd. +44 1223 875265
------------------------------
From: [EMAIL PROTECTED] (Michael F Gordon)
Subject: Re: R: syscall
Date: 19 Jun 2000 14:40:57 GMT
In <FNs25.210619$[EMAIL PROTECTED]> "@LeX" <aleefaby*NOSPAM*@libero.it>
writes:
>But now, may you tell me how I must use that syscall() ??
Here's a small example. syscall() is calling write() (system call number 4)
rather than an added system call but the idea is the same.
Michael
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
int
main(int argc,char **argv)
{
char c;
while (read(0,&c,1)>0) {
syscall(4,1,&c,1);
}
return 0;
}
--
Quidquid latine dictum sit, altum viditur.
------------------------------
From: Mathias Waack <[EMAIL PROTECTED]>
Subject: Poll on /proc files
Date: 19 Jun 2000 17:00:46 +0200
Hi all,
I have a driver which delegates most of the work to a
user space process. Its necessary for the driver to
inform the daemon about some events which may occur
asynchronously. My idea was it to implement a /proc
file and a poll method for it, so the daemon can
wait in a call to poll() on this file and the driver
can be notified. But it seems like the poll method of the
driver will never get called. Is this right? If so,
what else could I use as communication channel between
driver and daemon?
Mathias
PS: I'm using Linux kernel 2.2.14-SMP
------------------------------
From: Alan Donovan <[EMAIL PROTECTED]>
Subject: Re: Poll on /proc files
Date: Mon, 19 Jun 2000 17:21:58 +0100
Mathias Waack wrote:
>
> Hi all,
>
> I have a driver which delegates most of the work to a
> user space process. Its necessary for the driver to
> inform the daemon about some events which may occur
> asynchronously. My idea was it to implement a /proc
> file and a poll method for it, so the daemon can
> wait in a call to poll() on this file and the driver
> can be notified. But it seems like the poll method of the
> driver will never get called. Is this right? If so,
> what else could I use as communication channel between
> driver and daemon?
Canonical answer for this sort of problem is to spawn a thread in the
daemon that calls an ioctl that blocks in sleep_on() until the driver
wants to make the "callback". Then driver calls wake_up() and the daemon
thread continues and does the notification work.
This is such a common question, it should be in the FAQ... er, that is,
if we had a FAQ :-)
HTH
alan
--
========================================================================
Alan Donovan [EMAIL PROTECTED] http://www.imerge.co.uk
Imerge Ltd. +44 1223 875265
------------------------------
From: Mathias Waack <[EMAIL PROTECTED]>
Subject: Re: Poll on /proc files
Date: 19 Jun 2000 18:04:48 +0200
Alan Donovan <[EMAIL PROTECTED]> writes:
> Mathias Waack wrote:
[user process waits for a msg from a kernel driver]
> > Canonical answer for this sort of problem is to spawn a thread in the
> daemon that calls an ioctl that blocks in sleep_on() until the driver
> wants to make the "callback". Then driver calls wake_up() and the
> daemon thread continues and does the notification work.
I know this solution, but my daemon sleep most time in a poll, so it
would be nice to simply add another fd to the list of fd it polls on.
> This is such a common question, it should be in the FAQ... er, that
> is, if we had a FAQ :-)
Oh, I've got a deja vu ;)
IIRC we've talked about this some weeks ago. If you want a faq, you must
write a faq. Shall we start it? Maybe some poeple join us...
BTW it was not an answer to my first question: is it possible to poll
a /proc file?
Mathias
------------------------------
From: "Jan Lund Kristensen" <[EMAIL PROTECTED]>
Crossposted-To: linux.dev.c-programming
Subject: Socket functions in kernel space
Date: Mon, 19 Jun 2000 17:20:14 GMT
Hi,
Which socket functions can I use in a device driver? I've looked at
fucktions lik sock_no_connect but these functions seems not to be in use.
Thanks in advance!
greetings,
Jan
------------------------------
From: Yogesh Sharma <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: Raw Keyboard Scancode
Date: Mon, 19 Jun 2000 12:59:24 -0500
Hi,
I have a compaq system that comes with compaq keyboard with
some special keys on the top for cd/dvd control as well as
volume control.
I am planning to write a panel applet to utilize these keys.
Any help in retieving raw keyboard codes ?
Thanks
Yogesh
Please remove NOSPAM from email address while replying.
------------------------------
From: [EMAIL PROTECTED] (Mario Klebsch)
Subject: Re: polling the keyboard
Date: Mon, 19 Jun 2000 19:31:20 +0200
Bertil Stroberg <[EMAIL PROTECTED]> writes:
>I've used the select() on serial and network stuff and it might work fine
>on the keyboard, so give it a try.
It should be fine for the keyboard. If it is not, you should look for
a bug.
73, Mario
--
Mario Klebsch [EMAIL PROTECTED]
------------------------------
From: David <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: ctime ... Linux Bug ???
Date: Mon, 19 Jun 2000 21:55:12 +0200
This is a multi-part message in MIME format.
==============659B8BA5075EF867C06A4ACF
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
I have compile a dummy program. I have attached it.
All is normal, excep for it generates a segmentation fault.
The program wait for SIGUSR1, cause by SIGALRM, and then call time( NULL
) and fails
in ctime.
Any idea ?
There is some probes:
bash-2.03# ctime
Segmentation fault
bash-2.03# gdb ctime
GNU gdb 4.18
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for
details.
This GDB was configured as "i386-suse-linux-gnu"...
(gdb) run
Starting program: /TRASH/BUGS/CTIME/ctime
warning: Cannot determine thread signal number; GDB may report spurious
signals.
Program received signal SIGSEGV, Segmentation fault.
0x0 in ?? ()
(gdb) bt
#0 0x0 in ?? ()
#1 0x40079954 in _IO_init (fp=0x80514c8, flags=0) at genops.c:556
#2 0x40074881 in _IO_new_fopen (filename=0x4010d5d1 "/etc/localtime",
mode=0x4010d642 "r") at iofopen.c:49
#3 0x400ade12 in __tzfile_read (file=0x4010d5d1 "/etc/localtime",
extra=0, extrap=0x0) at tzfile.c:149
#4 0x400acd13 in tzset_internal (always=-72548352) at tzset.c:172
#5 0x400adb8b in __tz_convert (timer=0xbffff698, use_localtime=1,
tp=0x4011a240) at tzset.c:582
#6 0x400a9d92 in localtime (t=0xbffff698) at localtime.c:43
#7 0x400a9c69 in ctime (t=0xbffff698) at ctime.c:32
#8 0x8049a02 in Tarea_A () at ctime-bug.c:52
#9 0x8049b0b in main () at ctime-bug.c:97
(gdb) q
The program is running. Exit anyway? (y or n) y
bash-2.03# strace ctime
execve("./ctime", ["ctime"], [/* 46 vars */]) = 0
brk(0) = 0x80514a8
open("/etc/ld.so.preload", O_RDONLY) = -1 ENOENT (No such file or
directory)
open("/opt/kde/lib/i686/mmx/libc.so.6", O_RDONLY) = -1 ENOENT (No such
file or directory)
stat("/opt/kde/lib/i686/mmx", 0xbffff1d8) = -1 ENOENT (No such file or
directory)
open("/opt/kde/lib/i686/libc.so.6", O_RDONLY) = -1 ENOENT (No such file
or directory)
stat("/opt/kde/lib/i686", 0xbffff1d8) = -1 ENOENT (No such file or
directory)
open("/opt/kde/lib/mmx/libc.so.6", O_RDONLY) = -1 ENOENT (No such file
or directory)
stat("/opt/kde/lib/mmx", 0xbffff1d8) = -1 ENOENT (No such file or
directory)
open("/opt/kde/lib/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or
directory)
stat("/opt/kde/lib", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=41117, ...}) = 0
mmap(NULL, 41117, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40015000
close(3) = 0
open("/lib/libc.so.6", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0755, st_size=4223971, ...}) = 0
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\200\204"...,
4096) = 4096
mmap(NULL, 1025596, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x40020000
mprotect(0x40113000, 30268, PROT_NONE) = 0
mmap(0x40113000, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3,
0xf2000) = 0x40113000
mmap(0x40117000, 13884, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x40117000
close(3) = 0
mprotect(0x40020000, 995328, PROT_READ|PROT_WRITE) = 0
mprotect(0x40020000, 995328, PROT_READ|PROT_EXEC) = 0
munmap(0x40015000, 41117) = 0
personality(PER_LINUX) = 0
getpid() = 642
getpid() = 642
rt_sigaction(SIGUSR1, {0x804a490, [], SA_RESTART|0x4000000}, NULL, 8) =
0
rt_sigaction(SIGUSR2, {0x804a520, [], 0x4000000}, NULL, 8) = 0
rt_sigprocmask(SIG_BLOCK, [USR1], NULL, 8) = 0
rt_sigaction(SIGALRM, {0x804996c, ~[INT QUIT ILL TRAP ABRT BUS FPE KILL
USR1 SEGV USR2 PIPE ALRM TERM STKFLT CHLD CONT STOP TSTP TTIN TTOU URG
XCPU XFSZ VTALRM PROF WINCH IO PWR UNUSED RT_0 RT_1 RT_2 RT_3 RT_4 RT_6
RT_7 RT_8 RT_9 RT_12], SA_RESTART|SA_NOMASK|0x4000000}, NULL, 8) = 0
rt_sigprocmask(SIG_BLOCK, [ALRM], NULL, 8) = 0
setitimer(ITIMER_REAL, {it_interval={10, 0}, it_value={1, 0}}, NULL) = 0
rt_sigaction(SIG_0, {0x804a490, ~[], 0x4000000}, {0x280005, [HUP INT
QUIT BUS STKFLT UNUSED RT_3 RT_4 RT_6 RT_8 RT_11 RT_13 RT_17 RT_18],
0x2}, 8) = -1 EINVAL (Invalid argument)
rt_sigaction(SIGALRM, {0x804a490, ~[], 0x4000000}, {0x804996c, ~[INT
QUIT ILL TRAP ABRT BUS FPE KILL USR1 SEGV USR2 PIPE ALRM TERM STKFLT
CHLD CONT STOP TSTP TTIN TTOU URG XCPU XFSZ VTALRM PROF WINCH IO PWR
UNUSED RT_0 RT_1 RT_2 RT_3 RT_4 RT_6 RT_7 RT_8 RT_9 RT_12],
SA_RESTART|SA_NOMASK|0x4000000}, 8) = 0
rt_sigprocmask(SIG_BLOCK, NULL, [USR1 ALRM], 8) = 0
rt_sigsuspend(~[USR2 ALRM] <unfinished ...>
--- SIGALRM (Alarm clock) ---
<... rt_sigsuspend resumed> ) = -1 EINTR (Interrupted system
call)
sigreturn() = ? (mask now [USR1 ALRM])
rt_sigaction(SIG_0, {0x33d, [HUP ILL ABRT BUS FPE USR1 RT_1 RT_2 RT_4
RT_5 RT_6 RT_11], 0x4000000}, NULL, 8) = -1 EINVAL (Invalid argument)
rt_sigaction(SIGALRM, {0x804996c, ~[INT QUIT ILL TRAP ABRT BUS FPE KILL
USR1 SEGV USR2 PIPE ALRM TERM STKFLT CHLD CONT STOP TSTP TTIN TTOU URG
XCPU XFSZ VTALRM PROF WINCH IO PWR UNUSED RT_0 RT_1 RT_2 RT_3 RT_4 RT_6
RT_7 RT_8 RT_9 RT_12], SA_RESTART|SA_NOMASK|0x4000000}, NULL, 8) = 0
time(NULL) = 961444363
brk(0) = 0x80514a8
brk(0x80514d0) = 0x80514d0
brk(0x8052000) = 0x8052000
--- SIGSEGV (Segmentation fault) ---
+++ killed by SIGSEGV +++
bash-2.03#
==============659B8BA5075EF867C06A4ACF
Content-Type: text/plain; charset=iso-8859-1;
name="ctime-bug.c"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline;
filename="ctime-bug.c"
// gcc -D_REENTRANT -DPOSIX_C_SOURCE=3D4 -D_POSIX_PTHREAD_SEMANTICS cicli=
co3.c -o ciclico -lpthread -lposix4 -g
#include <sys/types.h>
#include <sys/time.h>
#include <time.h>
#include <signal.h>
#include <pthread.h>
#include <stdio.h>
#include <unistd.h>
const numero_de_ciclos =3D 2 ;
#define CLOCK_REALTIME ITIMER_REAL
void timer_create( int , struct sigevent * , time_t * ) ;
static struct itimerval timerdata ;
static time_t timer_id ;
int redirect_signal ;
void alarm_signal ( int s )
{
kill( getpid( ) , redirect_signal ) ;
}
void timer_create( int no_uso , struct sigevent *event , time_t *tampoco_=
uso )
{
struct sigaction new_signal ;
redirect_signal =3D event -> sigev_signo ;
new_signal.sa_handler =3D alarm_signal ;
new_signal.sa_flags =3D SA_RESTART | SA_NODEFER ;
sigaction( SIGALRM , &new_signal , NULL ) ;
}
void timer_settime( time_t no_uso , char *tampoco_lo_uso , struct itimerv=
al *timerdata , char *ni_lo_miro )
{
setitimer( CLOCK_REALTIME , timerdata , NULL ) ;
}
void Tarea_A ( void )
{
time_t reloj ;
reloj =3D time( NULL ) ;
ctime( &reloj ) ;
printf( "Tarea A %s\n" , ctime( &reloj ) ) ;
sleep( 3 ) ;
}
void signal_handler ( int sig )
{
printf( "SEGNALLL \n" ) ;
// signal( SIGUSR1 , signal_handler ) ;
}
int main ( )
{
struct sigevent event ;
int i =3D 0 ;
sigset_t set ;
int received_sig ;
struct sigaction new_signal ;
/* crear el temporizador */
event.sigev_notify =3D SIGEV_SIGNAL ;
event.sigev_signo =3D SIGUSR1 ;
timer_create( CLOCK_REALTIME , &event , &timer_id ) ;
=
/* preparar el conjunto de se=F1ales usado por la llamada sigwait */
sigemptyset( &set ) ;
sigaddset( &set , SIGUSR1 | SIGALRM ) ;
pthread_sigmask( SIG_BLOCK , &set , NULL ) ;
/* armar el temporizador en modo peri=F3dico con periodo X seg */
timerdata.it_interval.tv_sec =3D 10 ;
timerdata.it_value.tv_sec =3D 1 ;
timerdata.it_interval.tv_usec =3D 0 ;
timerdata.it_value.tv_usec =3D 0 ;
timer_settime( timer_id , 0 , &timerdata , NULL ) ;
=
while(1)
{
/* esperar la se=F1al */
sigwait( &set , &received_sig ) ;
=
Tarea_A( ) ;
}
}
==============659B8BA5075EF867C06A4ACF==
------------------------------
** 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
******************************