Implements Process.
Process Linuximpl | Implements Process. |
Copyright | This program is free software. |
Files | |
C-kern/ | Header file of Process. |
C-kern/ | Implementation file Process Linuximpl. |
process_stdfd2_t | |
lifetime | |
init_processstdio2 | Initializes process_stdfd2_t with process_stdio_t and opens devnull. |
free_processstdio2 | Closes if devnull if necessary. |
redirectstdfd_processstdio2 | Redirects one standard channel to read/write from/to a file. |
redirectstdio_processstdio2 | Redirects all 3 standard io channels to read/write from/to a file. |
process_t | |
helper | |
lifetime | |
fork_process | This function call returns twice. |
query | |
change | |
test |
This program is free software. You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
© 2011 Jörg Seebohn
Header file of Process.
Implementation file Process Linuximpl.
lifetime | |
init_processstdio2 | Initializes process_stdfd2_t with process_stdio_t and opens devnull. |
free_processstdio2 | Closes if devnull if necessary. |
redirectstdfd_processstdio2 | Redirects one standard channel to read/write from/to a file. |
redirectstdio_processstdio2 | Redirects all 3 standard io channels to read/write from/to a file. |
static int init_processstdio2( /*out*/process_stdfd2_t * stdfd2, process_stdio_t * stdfd )
Initializes process_stdfd2_t with process_stdio_t and opens devnull. The device null is only opened if stdfd is 0 or at least one file descriptor is set to <iochannel_FREE>.
static int redirectstdfd_processstdio2( const process_stdfd2_t * stdfd2, int stdfd, int redirectto_file )
Redirects one standard channel to read/write from/to a file.
stdfd | The file descriptor of the standard io channel. Set this value to one of STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO |
redirectto_file | The file descriptor of the file which now becomes the new standard io channel. Use value <iochannel_FREE> to redirect to devnull. Use same value as stdfd if the standard channel should be inherited between processes. |
static int redirectstdio_processstdio2( const process_stdfd2_t * stdfd2 )
Redirects all 3 standard io channels to read/write from/to a file.
If the new file descriptors have the same values as the standard channels then no redirection is done but they are inherited.
Uses redirectstdfd_processstdio2 to implement its functionality.
helper | |
lifetime | |
fork_process | This function call returns twice. |
query | |
change |
Initializes process_stdfd2_t with process_stdio_t and opens devnull.
static int init_processstdio2( /*out*/process_stdfd2_t * stdfd2, process_stdio_t * stdfd )
The process standard io channel redirections.
struct process_stdio_t
Closes if devnull if necessary.
static int free_processstdio2( process_stdfd2_t * stdfd2 )
Redirects one standard channel to read/write from/to a file.
static int redirectstdfd_processstdio2( const process_stdfd2_t * stdfd2, int stdfd, int redirectto_file )
Redirects all 3 standard io channels to read/write from/to a file.
static int redirectstdio_processstdio2( const process_stdfd2_t * stdfd2 )
This function call returns twice.
static int fork_process( /*out*/pid_t * pid )