1 #ifndef _AMIGAOS_H
2 #define _AMIGAOS_H
3 
4 /* prototypes and defines missing from current OS4 SDK; */
5 
6 /* netinet/in.h */
7 
8 // #define INADDR_LOOPBACK   0x7f00001UL
9 
10 /* unistd.h */
11 
12 #include <stdio.h>
13 
14 #if defined(__CLIB2__)
15 #include <dos.h>
16 #endif
17 #if defined(__NEWLIB__)
18 #include <amiga_platform.h>
19 #endif
20 
21 #if 1
22 int myexecve(bool isperlthread, const char *path, char *argv[], char *env[]);
23 int myexecvp(bool isperlthread, const char *filename, char *argv[]);
24 int myexecv(bool isperlthread, const char *path, char *argv[]);
25 int myexecl(bool isperlthread, const char *path, ...);
26 #endif
27 
28 #define execve(path, argv, env) myexecve(TRUE, path, argv, env)
29 #define execvp(filename, argv) myexecvp(TRUE, filename, argv)
30 #define execv(path, argv) myexecv(TRUE, path, argv)
31 #define execl(path, ...) myexecl(TRUE, path, __VA_ARGS__)
32 
33 int pipe(int filedes[2]);
34 
35 //FILE *amigaos_popen(const char *cmd, const char *mode);
36 //int   amigaos_pclose(FILE *f);
37 
38 void amigaos4_obtain_environ();
39 void amigaos4_release_environ();
40 
41 char *mystrdup(const char *s);
42 
43 char *convert_path_u2a(const char *filename);
44 char *convert_path_a2u(const char *filename);
45 
46 /* Need Pid_t define to make amigaos.c compile without including config.h */
47 #ifndef Pid_t
48 #define Pid_t pid_t
49 #endif
50 
51 int amigaos_kill(Pid_t pid, int  signal);
52 
53 #define kill(a,b) amigaos_kill((a),(b))
54 
55 void ___makeenviron() __attribute__((constructor));
56 void ___freeenviron() __attribute__((destructor));
57 
58 long amigaos_get_file(int fd);
59 
60 void amigaos4_init_fork_array();
61 void amigaos4_dispose_fork_array();
62 void amigaos4_init_environ_sema();
63 
64 /* emulated flock stuff */
65 
66 #define LOCK_SH 1 /* Shared lock.  */
67 #define LOCK_EX 2 /* Exclusive lock.  */
68 #define LOCK_UN 8 /* Unlock.  */
69 #define LOCK_NB 4 /* Don't block when locking.  */
70 
71 extern int flock(int fd, int operation);
72 
73 #define flock(a, b) amigaos_flock((a), (b))
74 
75 #endif
76