-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Early on, there was a lot of vacillation about the implementation of the tests. This is a squash of 54 commits (mostly prototyping) that represents finally committing to a direction and moving forward.
- Loading branch information
Showing
53 changed files
with
1,319 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# binaries | ||
helpers/echo-signal | ||
helpers/echo-exit | ||
helpers/exit-status-0 | ||
helpers/list-fds | ||
helpers/fd-perms |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/sh | ||
|
||
echo $# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#if 0 | ||
set -x "$(dirname $0)/$(basename $0 .c)" | ||
exec ${CC:-cc} ${CFLAGS:--Wall -Wextra -g} $0 -o $1 | ||
#endif | ||
|
||
/* Exec our args and print the exit status. We originally used a | ||
* shell script for this but I was worried there could be some | ||
* quoting/interpretation issues and figured it would be easier to | ||
* guarantee the behavior of this program. */ | ||
|
||
#include <errno.h> | ||
#include <spawn.h> | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <unistd.h> | ||
#include <sys/types.h> | ||
#include <sys/wait.h> | ||
|
||
static int really_waitpid(pid_t pid) | ||
{ | ||
int status; | ||
pid_t rv; | ||
do { rv = waitpid(pid, &status, 0); } while (-1 == rv && EINTR == errno); | ||
if (rv != pid) abort(); | ||
return status; | ||
} | ||
|
||
|
||
int main(int argc, char **argv, char **envp) | ||
{ | ||
pid_t pid; | ||
if (argc < 2) abort(); | ||
if (posix_spawn(&pid, argv[1], NULL, NULL, argv+1, envp)) abort(); | ||
printf("%d\n", really_waitpid(pid)); | ||
return 0; | ||
} |
Oops, something went wrong.