-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD8DBQE9RQa8tTveLPAHcDIRAsLEAJ4mxJ1lbAmoDWJ1RAENR5hJ8im+qwCfe610
tdpdKoekeLP78xKR2rOWWaI=
=CcD/
-----END PGP SIGNATURE-----
Then set yourself up to 'catch' the signal, somewhere in the code:Quote:}
There are other system calls to use in place of signal, but this is the
simplest way to do it I know. You run a program with that piece
of code, note its process id, and issue the command 'kill -1 <pid>'
CAUTION: I didn't actually try this exact code, so there me be a typo
or other oversight, but it's pretty close to something I wrote recently
that does work.
--
Replace ragwind.loc or bluemouth.loc with rahul for my real email address
> Then set yourself up to 'catch' the signal, somewhere in the code:
> signal(1,handleit);
> if (setjmp(env))
> {
> printf("got a signal 1\n");
> goto skip;
> }
> for (;;) /* forever, waiting for the signal */
> {
> sleep(1);
> } /* end forever */
> skip:
> printf("Escaped the forever loop\n");
--
Paul Evans
ICQ# 4135350 | Registered Linux# 179460
>> void
>> handleit(int x)
[snip]
>> printf("Escaped the forever loop\n");
> Is it just me, or do others find this setjmp/longjmp functions very messy?
> It seems to me that it's a rather dodgy hack at adding exception handling
> to C... are there not neater alternatives to implement exceptions?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD8DBQE9RjWHtTveLPAHcDIRAnXlAJ0aPiy0dC+VL9ESxSUwFDZ4/PJb3ACeM0Q2
nWa6ycByP6PzxnpKjKrZ1oo=
=iN8u
-----END PGP SIGNATURE-----
| -----BEGIN PGP SIGNED MESSAGE-----
| Hash: SHA1
| NotDashEscaped: You need GnuPG to verify this message
|
|
|>
|>
|>>void
|>>handleit(int x)
|>
| [snip]
|
|>> printf("Escaped the forever loop\n");
|>
|>Is it just me, or do others find this setjmp/longjmp functions very messy?
|>It seems to me that it's a rather dodgy hack at adding exception handling
|>to C... are there not neater alternatives to implement exceptions?
|
|
| ... i'm with you Paul ... set/long-jump has it's place, but for
| proper signal handling, you're better off using the POSIX signal
| handling funcs, the "sig*" family. start at, "man sigaction"
You sometimes need setjump and longjump, but they have been a pain ever
since they were introduced. When I was working on optimizers for C and
C++, the ambiguities in their definitions were a curse, since the
optimized code was required to be logically equivalent to the
unoptimized code (of course). But the definitions were not such as to
make it possible to know.
It was not sufficient to merely test the code, since the code to be
tested may have been invalid, and an optimizer is not required to return
the same undefined values from wrong code as unoptimized code. But when
you do not even know what the requirements mean, it is really
impossible. I stopped working on optimizers at the end of 1989, so they
may have fixed the definitions since then, but I doubt it.
- --
~ .~. Jean-David Beyer Registered Linux User 85642.
~ /V\ Registered Machine 73926.
~ /( )\ Shrewsbury, New Jersey http://counter.li.org
~ ^^-^^ 7:50am up 5 days, 18:26, 2 users, load average: 2.08, 2.20, 2.18
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQE9Rn7MPtu2XpovyZoRAqt7AKC1kCuflZc+CTJ8cA3iNlyce50qWgCgwcpb
1e9oiJQ64KvmMQ+BBYTZ+fg=
=mSaY
-----END PGP SIGNATURE-----
1. How to generate/handle software interrupt on alpha/linux?
Hi, all:
I am in the process porting a software from i386/linux to
Alpha-linux. In the code software interrupt (0x81)
is used to allow transition from user mode to kernel mode. I have
some ideas how all these work on an intel
based platform (IDT and so on). I wonder whether I can (how) do the
very same thing on alpha linux platform.
Do I have to do this by calling PAL code? Any examples,
documentation? Thanks in advance.
--
#####################################################
Jie Chen
Thomas Jefferson National Accelerator Facility
12000, Jefferson Ave.
Newport News, VA 23606
(757)269-5046 (office) (757)269-5279 (fax)
#####################################################
3. Handling Interrupts on LINUX
5. Hardware interrupt handling in Linux
6. linux dymo labelwriter 320/330
7. hardware interrupt handling in linux
8. clean up directory structure
10. Interrupt handling with linux (robotics application)
11. Interrupt handling in Linux
12. interrupt handling in linux driver programming
13. linux and interrupt handling - ??