repo.or.cz
/
pfinal.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
initial commit
[pfinal.git]
/
Routix
/
tareas
/
ush
/
my_trap.c
blob
00c4c1a3fcddc1b6e821c1a388694ecfb983c17c
1
#include <signal.h>
2
char
cmd
[
100
];
3
4
main
(
int
argc
,
char
*
argv
[])
5
{
6
void
sighandler
();
7
int
i
,
offset
=
0
;
8
9
signal
(
SIGQUIT
,
sighandler
);
10
for
(
i
=
1
;
i
<
argc
;
i
++) {
11
strcpy
(
cmd
+
offset
,
argv
[
i
]);
12
offset
+=
strlen
(
argv
[
i
]);
13
cmd
[
offset
++] =
' '
;
14
}
15
cmd
[
offset
] =
'\0'
;
16
pause
();
17
}
18
19
void
sighandler
()
20
{
21
system
(
cmd
);
22
}