git.ucc.asn.au
/
tpg
/
acess2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Usermode/telnetd - Hacking it up :) Needs _SysSpawn implemented to work
[tpg/acess2.git]
/
Usermode
/
include
/
acess
/
sys.h
diff --git
a/Usermode/include/acess/sys.h
b/Usermode/include/acess/sys.h
index
368524a
..
2d2b429
100644
(file)
--- a/
Usermode/include/acess/sys.h
+++ b/
Usermode/include/acess/sys.h
@@
-5,13
+5,17
@@
#define _ACESS_SYS_H_
#include <stdint.h>
#define _ACESS_SYS_H_
#include <stdint.h>
-#include
<sys/types.h>
+#include
"../sys/types.h"
// === CONSTANTS ===
#ifndef NULL
# define NULL ((void*)0)
#endif
// === CONSTANTS ===
#ifndef NULL
# define NULL ((void*)0)
#endif
+#define THREAD_EVENT_VFS 0x0001
+#define THREAD_EVENT_IPCMSG 0x0002
+#define THREAD_EVENT_SIGNAL 0x0004
+
#define OPENFLAG_EXEC 0x01
#define OPENFLAG_READ 0x02
#define OPENFLAG_WRITE 0x04
#define OPENFLAG_EXEC 0x01
#define OPENFLAG_READ 0x02
#define OPENFLAG_WRITE 0x04
@@
-22,40
+26,11
@@
# define SEEK_CUR 0
# define SEEK_END -1
#endif
# define SEEK_CUR 0
# define SEEK_END -1
#endif
-#define CLONE_VM 0x10
#define GETMSG_IGNORE ((void*)-1)
#define FILEFLAG_DIRECTORY 0x10
#define FILEFLAG_SYMLINK 0x20
// === TYPES ===
#define GETMSG_IGNORE ((void*)-1)
#define FILEFLAG_DIRECTORY 0x10
#define FILEFLAG_SYMLINK 0x20
// === TYPES ===
-struct s_sysACL {
- union {
- struct {
- unsigned group: 1;
- unsigned id: 31;
- };
- uint32_t object;
- };
- union {
- struct {
- unsigned invert: 1;
- unsigned perms: 31;
- };
- uint32_t rawperms;
- };
-};
-struct s_sysFInfo {
- uint uid, gid;
- uint flags;
- uint64_t size;
- uint64_t atime;
- uint64_t mtime;
- uint64_t ctime;
- int numacls;
- struct s_sysACL acls[];
-};
-typedef struct s_sysFInfo t_sysFInfo;
-typedef struct s_sysACL t_sysACL;
// === VARIABLES ===
extern int _errno;
// === VARIABLES ===
extern int _errno;
@@
-64,19
+39,24
@@
extern int _errno;
extern void _SysDebug(const char *format, ...);
// --- Proc ---
extern void _exit(int status) __attribute__((noreturn));
extern void _SysDebug(const char *format, ...);
// --- Proc ---
extern void _exit(int status) __attribute__((noreturn));
-extern void sleep();
-extern void yield();
-extern void wait(int miliseconds);
+extern void sleep(void);
+extern void yield(void);
+extern int kill(int pid, int sig);
+//extern void wait(int miliseconds);
+extern int _SysWaitEvent(int EventMask);
extern int waittid(int id, int *status);
extern int clone(int flags, void *stack);
extern int execve(char *path, char **argv, char **envp);
extern int waittid(int id, int *status);
extern int clone(int flags, void *stack);
extern int execve(char *path, char **argv, char **envp);
-extern int gettid();
-extern int getpid();
+extern int _SysSpawn(const char *Path, const char **argv, const char **envp, int nFDs, int *FDs);
+extern int gettid(void);
+extern int getpid(void);
extern int _SysSetFaultHandler(int (*Handler)(int));
extern int _SysSetFaultHandler(int (*Handler)(int));
+extern void SysSetName(const char *Name);
+//extern int SysGetName(const char *Name);
// --- Permissions ---
// --- Permissions ---
-extern int getuid();
-extern int getgid();
+extern int getuid(
void
);
+extern int getgid(
void
);
extern void setuid(int id);
extern void setgid(int id);
extern void setuid(int id);
extern void setgid(int id);
@@
-84,9
+64,9
@@
extern void setgid(int id);
extern int chdir(const char *dir);
extern int open(const char *path, int flags);
extern int reopen(int fd, const char *path, int flags);
extern int chdir(const char *dir);
extern int open(const char *path, int flags);
extern int reopen(int fd, const char *path, int flags);
-extern
void
close(int fd);
-extern uint read(int fd,
uint length, void *buffer
);
-extern uint write(int fd,
uint length, void *buffer
);
+extern
int
close(int fd);
+extern uint read(int fd,
void *buffer, uint length
);
+extern uint write(int fd,
const void *buffer, uint length
);
extern int seek(int fd, int64_t offset, int whence);
extern uint64_t tell(int fd);
extern int ioctl(int fd, int id, void *data);
extern int seek(int fd, int64_t offset, int whence);
extern uint64_t tell(int fd);
extern int ioctl(int fd, int id, void *data);
@@
-95,9
+75,11
@@
extern int readdir(int fd, char *dest);
extern int _SysOpenChild(int fd, char *name, int flags);
extern int _SysGetACL(int fd, t_sysACL *dest);
extern int _SysMount(const char *Device, const char *Directory, const char *Type, const char *Options);
extern int _SysOpenChild(int fd, char *name, int flags);
extern int _SysGetACL(int fd, t_sysACL *dest);
extern int _SysMount(const char *Device, const char *Directory, const char *Type, const char *Options);
+extern int _SysSelect(int nfds, fd_set *read, fd_set *write, fd_set *err, time_t *timeout, int extraevents);
+#define select(nfs, rdfds, wrfds, erfds, timeout) _SysSelect(nfs, rdfds, wrfds, erfds, timeout, 0)
// --- IPC ---
// --- IPC ---
-extern int SysSendMessage(pid_t dest, uint length, void *Data);
+extern int SysSendMessage(pid_t dest, uint length,
const
void *Data);
extern int SysGetMessage(pid_t *src, void *Data);
// --- MEMORY ---
extern int SysGetMessage(pid_t *src, void *Data);
// --- MEMORY ---
UCC
git Repository :: git.ucc.asn.au