Files
Chia-Che Tsai b5586bbfc6 release v0.3
- Bugfixes in PAL and SHIM
- Improvement of migration scheme in SHIM, which largely speed up
  forking
- Upgrade glibc to 2.19
- FreeBSD port
- Support OpenJDK, python and R
2015-11-30 08:38:50 -05:00

25 lines
664 B
C

/* -*- mode:c; c-file-style:"k&r"; c-basic-offset: 4; tab-width:4; indent-tabs-mode:nil; mode:auto-fill; fill-column:78; -*- */
/* vim: set ts=4 sw=4 et tw=78 fo=cqt wm=0: */
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char ** argv, const char ** envp)
{
FILE * out = stdout;
if (argc > 1) {
int fd = atoi(argv[argc - 1]);
printf("inherited file descriptor %d\n", fd);
out = fdopen(fd, "a");
if (!out) {
perror("fdopen");
exit(1);
}
}
fprintf(out, "Hello World (%s)!\n", argv[0]);
fprintf(out, "envp[\'IN_EXECVE\'] = %s\n", getenv("IN_EXECVE"));
return 0;
}