| #include <unistd.h> | |
| //#include <errno.h> | |
| static int stdout_fd = -1; | |
| static int stderr_fd = -1; | |
| int _get_stdout_fd() { | |
| return stdout_fd; | |
| } | |
| int _get_stderr_fd() { | |
| return stderr_fd; | |
| } | |
| int _set_stdout_fd(int fd) { | |
| if(fd == 0 || fd == 1 || fd == 2) { | |
| //errno = EBADF; | |
| return -1; | |
| } | |
| stdout_fd = fd; | |
| return 0; | |
| } | |
| int _set_stderr_fd(int fd) { | |
| if(fd == 0 || fd == 1 || fd == 2) { | |
| //errno = EBADF; | |
| return -1; | |
| } | |
| stderr_fd = fd; | |
| return 0; | |
| } |