Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
relibc
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
redox-os
relibc
Commits
9790289a
Commit
9790289a
authored
6 years ago
by
Jeremy Soller
Browse files
Options
Downloads
Patches
Plain Diff
Add execlp
parent
3cc215ca
No related branches found
No related tags found
No related merge requests found
Pipeline
#1876
passed with warnings
6 years ago
Stage: build
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/bits/unistd.h
+1
-0
1 addition, 0 deletions
include/bits/unistd.h
src/c/unistd.c
+23
-0
23 additions, 0 deletions
src/c/unistd.c
with
24 additions
and
0 deletions
include/bits/unistd.h
+
1
−
0
View file @
9790289a
...
...
@@ -9,6 +9,7 @@ extern "C" {
int
execl
(
const
char
*
path
,
const
char
*
argv0
,
...);
int
execle
(
const
char
*
path
,
const
char
*
argv0
,
...);
int
execlp
(
const
char
*
file
,
const
char
*
argv0
,
...);
#ifdef __cplusplus
}
// extern "C"
...
...
This diff is collapsed.
Click to expand it.
src/c/unistd.c
+
23
−
0
View file @
9790289a
...
...
@@ -47,3 +47,26 @@ int execle(const char *path, const char* argv0, ...)
return
execve
(
path
,
argv
,
envp
);
}
}
int
execvp
(
const
char
*
file
,
char
*
const
*
argv
);
int
execlp
(
const
char
*
file
,
const
char
*
argv0
,
...)
{
int
argc
;
va_list
ap
;
va_start
(
ap
,
argv0
);
for
(
argc
=
1
;
va_arg
(
ap
,
const
char
*
);
argc
++
);
va_end
(
ap
);
{
int
i
;
char
*
argv
[
argc
+
1
];
va_start
(
ap
,
argv0
);
argv
[
0
]
=
(
char
*
)
argv0
;
for
(
i
=
1
;
i
<
argc
;
i
++
)
{
argv
[
i
]
=
va_arg
(
ap
,
char
*
);
}
argv
[
i
]
=
NULL
;
va_end
(
ap
);
return
execvp
(
file
,
argv
);
}
}
This diff is collapsed.
Click to expand it.
Nagy Tibor
@xTibor
mentioned in merge request
cookbook!185 (closed)
·
6 years ago
mentioned in merge request
cookbook!185 (closed)
mentioned in merge request cookbook!185
Toggle commit list
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