Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pike
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pikelang
pike
Commits
cf2a15c7
Commit
cf2a15c7
authored
29 years ago
by
Fredrik Hübinette (Hubbe)
Browse files
Options
Downloads
Patches
Plain Diff
alarm() added
Rev: src/lpc_signal.c:1.9
parent
6ff3e90c
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/lpc_signal.c
+21
-0
21 additions, 0 deletions
src/lpc_signal.c
with
21 additions
and
0 deletions
src/lpc_signal.c
+
21
−
0
View file @
cf2a15c7
...
@@ -13,6 +13,10 @@
...
@@ -13,6 +13,10 @@
#include
<signal.h>
#include
<signal.h>
#include
<sys/wait.h>
#include
<sys/wait.h>
#ifdef HAVE_UNISTD_H
#include
<unistd.h>
#endif
#ifdef NSIG
#ifdef NSIG
#define MAX_SIGNALS NSIG
#define MAX_SIGNALS NSIG
#else
#else
...
@@ -369,6 +373,22 @@ static void f_getpid(INT32 args)
...
@@ -369,6 +373,22 @@ static void f_getpid(INT32 args)
push_int
(
getpid
());
push_int
(
getpid
());
}
}
static
void
f_alarm
(
INT32
args
)
{
long
seconds
;
if
(
args
<
1
)
error
(
"Too few arguments to signame()
\n
"
);
if
(
sp
[
-
args
].
type
!=
T_INT
)
error
(
"Bad argument 1 to signame()
\n
"
);
seconds
=
sp
[
-
args
].
u
.
integer
;
pop_n_elems
(
args
);
push_int
(
alarm
(
seconds
));
}
void
init_signals
()
void
init_signals
()
{
{
int
e
;
int
e
;
...
@@ -386,6 +406,7 @@ void init_signals()
...
@@ -386,6 +406,7 @@ void init_signals()
add_efun
(
"signame"
,
f_signame
,
"function(int:string)"
,
0
);
add_efun
(
"signame"
,
f_signame
,
"function(int:string)"
,
0
);
add_efun
(
"signum"
,
f_signum
,
"function(string:int)"
,
0
);
add_efun
(
"signum"
,
f_signum
,
"function(string:int)"
,
0
);
add_efun
(
"getpid"
,
f_getpid
,
"function(:int)"
,
0
);
add_efun
(
"getpid"
,
f_getpid
,
"function(:int)"
,
0
);
add_efun
(
"alarm"
,
f_alarm
,
"function(int:int)"
,
OPT_SIDE_EFFECT
);
}
}
void
exit_signals
()
void
exit_signals
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment