summaryrefslogblamecommitdiff
path: root/src/user/lib/libc/include/tce/syscall.h
blob: 4a1c6ef449f4ed6b0fb72bf8e4ceb2cae85c36e9 (plain) (tree)
1
2
3
4
5
6
7
8
9



                     
                         
                    


                             



                             



                              
                             



                                                  
                           
                    
 
                                                          
                                
 

                                                            
                                                




                                                                   
                                                     
 



                  
      
#ifndef DEF_SYSCALL_H
#define DEF_SYSCALL_H

#include <types.h>
#include <tce/syscalls.h>
#include <tce/vfs.h>

#define NEW_STACK_SIZE 0x8000

#ifdef __cplusplus
extern "C" { namespace libc {
#endif

void thread_exit();
void schedule();
void thread_sleep(int time);
void process_exit(int retval);
void printk(const char* str);
void thread_new(void (*entry)(void*), void *data);
void irq_wait(int number);
int proc_priv();

void* sbrk(ptrdiff_t size);
void brk(void* ptr);

int run(const char* file, const char** args, int zero_fd);
int waitpid(int pid, int block);

int open(const char* filename, int mode);
int open_relative(int root, const char* filename, int mode);
int stat(const char* filename, file_info *info);
int stat_relative(int root, const char* filename, file_info *info);
int statf(int file, file_info *info);
void close(int file);
int read(int file, size_t offset, size_t len, char *buffer);
int write(int file, size_t offset, size_t len, const char *buffer);
int link(const char* from, const char* to, int mode);

#ifdef __cplusplus
} }
#endif

#endif