Initial revision
[cacao.git] / threads / threadio.h
1 /* -*- c -*- */
2
3 #ifndef __threadio_h_
4 #define __threadio_h_
5
6 #include <sys/types.h>
7 #include <sys/socket.h>
8
9 #include "../global.h"
10
11 #ifdef USE_THREADS
12 int threadedFileDescriptor(int fd);
13 int threadedSocket(int af, int type, int proto);
14 int threadedOpen(char* path, int flags, int mode);
15 int threadedConnect(int fd, struct sockaddr* addr, int len);
16 int threadedAccept(int fd, struct sockaddr* addr, int* len);
17 int threadedRead(int fd, char* buf, int len);
18 int threadedWrite(int fd, char* buf, int len);
19 #else
20 #define threadedFileDescriptor(fd)
21 #define threadedRead(fd,buf,len)          read(fd,buf,len)
22 #define threadedWrite(fd,buf,len)         write(fd,buf,len)
23 #endif
24
25
26 #endif