2 Copyright © 1995-2012, The AROS Development Team. All rights reserved.
5 Desc: Unix filedescriptor/socket IO include file
11 #define timeval sys_timeval
13 #include <sys/types.h>
14 #include <sys/socket.h>
19 #include <exec/tasks.h>
20 #include <exec/ports.h>
22 #include <hidd/unixio.h>
24 #include <proto/exec.h>
26 /* Android is not a real Linux :-) */
27 #ifdef HOST_OS_android
33 #define LIBC_NAME "libc.so.6"
38 #define LIBC_NAME "libSystem.dylib"
42 #define LIBC_NAME "libc.so"
53 int (*open
)(const char *path
, int oflag
, ...);
54 int (*close
)(int filedes
);
55 int (*ioctl
)(int d
, int request
, ...);
56 int (*fcntl
)(int fd
, int cmd
, ...);
57 int (*poll
)(struct pollfd
*fds
, nfds_t nfds
, int timeout
);
58 ssize_t (*read
)(int fd
, void *buf
, size_t count
);
59 ssize_t (*write
)(int fildes
, const void *buf
, size_t nbyte
);
60 pid_t (*getpid
)(void);
61 int *(*__error
)(void);
62 void *(*mmap
)(void *addr
, size_t len
, int prot
, int flags
, int fd
, __off_t offset
);
63 int (*munmap
)(void *addr
, size_t len
);
64 int (*socket
)(int domain
, int type
, int protocol
);
65 ssize_t (*sendto
)(int sockfd
, const void *buf
, size_t len
, int flags
, const struct sockaddr
*dest_addr
, socklen_t addrlen
);
66 ssize_t (*recvfrom
)(int sockfd
, void *buf
, size_t len
, int flags
,struct sockaddr
*src_addr
, socklen_t
*addrlen
);
67 int (*bind
)(int sockfd
, const struct sockaddr
*addr
, socklen_t addrlen
);
70 /* For simplicity, our library base is our static data */
73 struct UnixIOBase uio_Public
; /* Public portion */
74 OOP_AttrBase UnixIOAB
; /* Our attribute base */
75 OOP_Class
*uio_unixioclass
; /* Our class */
76 OOP_Object
*obj
; /* Our singleton */
77 APTR irqHandle
; /* SIGIO IRQ handle */
78 APTR KernelBase
; /* Resource bases */
80 STRPTR SystemArch
; /* System architecture string (cached) */
81 struct LibCInterface
*SysIFace
; /* Our libc interface */
82 pid_t aros_PID
; /* PID of AROS process (for F_SETOWN fcntl) */
83 struct MinList intList
; /* User's interrupts list */
84 struct SignalSemaphore lock
; /* Singleton creation lock */
87 #define UD(cl) ((struct unixio_base *)cl->UserData)