This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
amigaos4: declare the amigaos protos in amigaos.h
[perl5.git] / amigaos4 / amigaos.h
CommitLineData
a83a2cd1
AB
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__)
738ab09f 15#include <dos.h>
a83a2cd1
AB
16#endif
17#if defined(__NEWLIB__)
738ab09f 18#include <amiga_platform.h>
a83a2cd1
AB
19#endif
20
21#if 1
738ab09f
AB
22int myexecve(bool isperlthread, const char *path, char *argv[], char *env[]);
23int myexecvp(bool isperlthread, const char *filename, char *argv[]);
24int myexecv(bool isperlthread, const char *path, char *argv[]);
25int myexecl(bool isperlthread, const char *path, ...);
a83a2cd1
AB
26#endif
27
738ab09f
AB
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__)
a83a2cd1
AB
32
33int pipe(int filedes[2]);
34
35FILE *amigaos_popen(const char *cmd, const char *mode);
36void amigaos4_obtain_environ();
37void amigaos4_release_environ();
38
738ab09f
AB
39char *mystrdup(const char *s);
40
41char *convert_path_u2a(const char *filename);
42char *convert_path_a2u(const char *filename);
43
ef2467ad
AB
44/* Need Pid_t define to make amigaos.c compile without including config.h */
45#ifndef Pid_t
46#define Pid_t pid_t
47#endif
48
49int amigaos_kill(Pid_t pid, int signal);
a83a2cd1 50
ef2467ad 51#define kill(a,b) amigaos_kill((a),(b))
a83a2cd1
AB
52
53void ___makeenviron() __attribute__((constructor));
54void ___freeenviron() __attribute__((destructor));
55
56long amigaos_get_file(int fd);
57
a843b009
AB
58void amigaos4_init_fork_array();
59void amigaos4_dispose_fork_array();
60void amigaos4_init_environ_sema();
a83a2cd1 61
1cd70adf
AB
62/* emulated flock stuff */
63
64#define LOCK_SH 1 /* Shared lock. */
65#define LOCK_EX 2 /* Exclusive lock. */
66#define LOCK_UN 8 /* Unlock. */
67#define LOCK_NB 4 /* Don't block when locking. */
68
69extern int flock(int fd, int operation);
70
71#define flock(a, b) amigaos_flock((a), (b))
72
a83a2cd1 73#endif