17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 #include <dirent.h>
27 #include <errno.h>
28 #include <fcntl.h>
29 #include <stdio.h>
30 #include <stdlib.h>
31 #include <string.h>
32 #include <unistd.h>
33 #include <limits.h>
34
35 #include "childproc.h"
36
37
38 ssize_t
39 restartableWrite(int fd, const void *buf, size_t count)
40 {
41 ssize_t result;
42 RESTARTABLE(write(fd, buf, count), result);
43 return result;
44 }
45
46 int
47 restartableDup2(int fd_from, int fd_to)
48 {
49 int err;
50 RESTARTABLE(dup2(fd_from, fd_to), err);
51 return err;
52 }
53
54 int
55 closeSafely(int fd)
56 {
|
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 #include <dirent.h>
27 #include <errno.h>
28 #include <fcntl.h>
29 #include <stdio.h>
30 #include <stdlib.h>
31 #include <string.h>
32 #include <unistd.h>
33 #include <limits.h>
34
35 #include "childproc.h"
36
37 const char * const *parentPathv;
38
39 ssize_t
40 restartableWrite(int fd, const void *buf, size_t count)
41 {
42 ssize_t result;
43 RESTARTABLE(write(fd, buf, count), result);
44 return result;
45 }
46
47 int
48 restartableDup2(int fd_from, int fd_to)
49 {
50 int err;
51 RESTARTABLE(dup2(fd_from, fd_to), err);
52 return err;
53 }
54
55 int
56 closeSafely(int fd)
57 {
|