root / Whitix / branches / network / include / sys.h

Revision 229, 3.5 kB (checked in by mwhitworth, 9 months ago)

Update pci.h to remove out-of-date header.

Line 
1/*  This file is part of Whitix.
2 *
3 *  Whitix is free software; you can redistribute it and/or modify
4 *  it under the terms of the GNU General Public License as published by
5 *  the Free Software Foundation; either version 2 of the License, or
6 *  (at your option) any later version.
7 *
8 *  Whitix is distributed in the hope that it will be useful,
9 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
10 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 *  GNU General Public License for more details.
12 *
13 *  You should have received a copy of the GNU General Public License
14 *  along with Whitix; if not, write to the Free Software
15 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
16 *
17 */
18
19/* TODO: Cleanup, update */
20
21#ifndef SYS_H
22#define SYS_H
23
24#include <typedefs.h>
25
26extern DWORD sysCallTable[];
27
28struct Time;
29struct SocketAddr;
30
31/* The great syscall list */
32
33/* Filesystem calls */
34int SysOpen(char* pathName,int flags,int perms);
35int SysCreateDir(char* pathName,int perms);
36int SysClose(int fd);
37int SysRemove(char* pathName);
38int SysRemoveDir(char* path);
39int SysFileAccess(char* path,int mode); /* TODO */
40int SysFileDup(int fd);
41int SysFileSync(int fd);
42int SysFileSystemSync();
43int SysTruncate(int fd,DWORD length);
44int SysMove(char* src,char* dest); //Not done
45int SysWrite(int fd,BYTE* data,DWORD amount);
46int SysRead(int fd,BYTE* buffer,DWORD amount);
47int SysSeek(int fd,int distance,int whence);
48int SysChangeDir(char* newDir);
49int SysChangeRoot(char* newRoot);
50int SysMount(char* mountPoint,char* deviceName,char* fsName,void* data);
51int SysUnmount(char* mountPoint); //Not done
52int SysGetDirEntries(int fd,void* entries,DWORD numBytes);
53int SysGetCurrDir(char* str,int size);
54int SysStat(char* name,void* statBuf);
55int SysStatFd(int fd,void* statBuf);
56int SysIoCtl(int fd,unsigned long code,char* data);
57int SysPoll(void* fds, DWORD numFds, int timeout);
58int SysPipe(int* fds);
59
60/* Memory calls */
61void* SysMoreCore(int len);
62int SysMemoryMap(DWORD address, DWORD length, int protection, int fd, DWORD offset, int flags);
63int SysMemoryProtect(DWORD address, DWORD len, int protection);
64int SysMemoryUnmap(DWORD address,DWORD length);
65int SysSharedMemoryGet(unsigned int key, DWORD size, int flags);
66DWORD SysSharedMemoryAttach(int id, const void* address, int flags);
67int SysSharedMemoryControl(int id, int command, void* buffer);
68int SysSharedMemoryDetach(const void* address);
69
70/* Task management */
71int SysCreateProcess(char* pathName,int* fds,char** argvp);
72int SysCreateThread(DWORD address,DWORD stackP, void* argument);
73int SysGetCurrentThreadId();
74int SysGetCurrentProcessId();
75int SysExitThread(int threadID); //Not done
76int SysExit(int retCode);
77int SysWaitForProcessFinish(int pid,int* finishStatus);
78int SysYield();
79
80/* Time */
81int SysGetTime(struct Time* retTime);
82
83/* Network */
84int SysSocketCreate(int domain, int type, int protocol);
85int SysSocketBind(int fd, struct SocketAddr* addr, int length);
86int SysSocketConnect(int fd, struct SocketAddr* addr, int length);
87int SysSocketListen(int fd, int backlog);
88int SysSocketAccept(int fd, struct SocketAddr* addr, int* length);
89int SysSocketSend(int fd, const void* buffer, int length, int flags);
90int SysSocketReceive(int fd, void* buffer, int length, int flags);
91int SysSocketIoCtl(int fd, unsigned long code, void* data);
92int SysSocketClose(int fd);
93
94/* Miscellaneous */
95int SysShutdown(int type);
96int SysIoAccess(int on);
97
98#endif
Note: See TracBrowser for help on using the browser.