xref: /openbsd/gnu/usr.bin/perl/amigaos4/amigaio.h (revision 4cfece93)
1 #ifndef _AMIGAIO_H
2 #define _AMIGAIO_H
3 
4 #ifndef H_PERL
5 #include "../perl.h"
6 #endif
7 
8 struct StdioStore
9 {
10 	/* astdin...astderr are the amigaos file descriptors */
11 	long astdin;
12 	long astdout;
13 	long astderr;
14 	/* oldstdin...oldstderr are the amigados file handles */
15 	long oldstdin;
16 	long oldstdout;
17 	long oldstderr;
18 };
19 
20 typedef struct StdioStore StdioStore;
21 
22 /* get the amigaos file descriptors */
23 void amigaos_stdio_get(pTHX_ StdioStore *store);
24 
25 /* save the amigados file handles (calls amigaos_stdio_get) */
26 void amigaos_stdio_save(pTHX_ StdioStore *store);
27 
28 /* restore the amigados file handles stored with amigaos_stdio_save */
29 void amigaos_stdio_restore(pTHX_ const StdioStore *store);
30 
31 /* everything the child needs from the parent is in UserData,
32  * then pass it through task->tc_UserData or as arg to new pthread */
33 struct UserData
34 {
35 	struct Task *parent;
36 	I32 did_pipes;
37 	int pp;
38 	SV **sp;
39 	SV **mark;
40 	PerlInterpreter *my_perl;
41 };
42 
43 void amigaos_fork_set_userdata(
44     pTHX_ struct UserData *userdata, I32 did_pipes, int pp, SV **sp, SV **mark);
45 
46 void *amigaos_system_child(void *userdata);
47 
48 void amigaos_post_exec(int fd, int do_report);
49 
50 Pid_t amigaos_fork();
51 Pid_t amigaos_waitpid(pTHX_ int optype, Pid_t pid, void *argflags);
52 
53 #endif
54