Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement legacy __ulibc_* symbols in ulibc to get rid of non ANSI compliant interfaces #2

Open
NewbiZ opened this issue Jul 3, 2014 · 3 comments
Assignees
Milestone

Comments

@NewbiZ
Copy link
Owner

NewbiZ commented Jul 3, 2014

Also, that may require implementing parts of POSIX libc interface on top of the current ANSI libc. This should be done carefully and not pollute the ANSI libc file/symbol namespace.

@NewbiZ NewbiZ added the bug label Jul 3, 2014
@NewbiZ NewbiZ self-assigned this Jul 3, 2014
@NewbiZ NewbiZ added ulibc and removed bug labels Jul 3, 2014
@NewbiZ NewbiZ added this to the ANSI ulibc milestone Jul 3, 2014
@NewbiZ
Copy link
Owner Author

NewbiZ commented Jul 3, 2014

Symbols to implement:

$ grep '__ulibc_' distrib/include/ulibc/ulibc.h
void         __ulibc_printf(int, char*, ...);
void*        __ulibc_memset(void*, int, unsigned int);
void*        __ulibc_malloc(unsigned int);
char*        __ulibc_strchr(const char*, char c);
unsigned int __ulibc_strlen(char*);
int          __ulibc_stat(char*, struct stat*);
char*        __ulibc_strcpy(char*, char*);
void*        __ulibc_memmove(void*, void*, int);
int          __ulibc_strcmp(const char*, const char*);
char*        __ulibc_gets(char*, int max);
void         __ulibc_free(void*);
int          __ulibc_atoi(const char*);

@NewbiZ
Copy link
Owner Author

NewbiZ commented Jul 3, 2014

POSIX libc symbols to implement:

int fork(void);
int sysexit(void) __attribute__((noreturn));
int wait(void);
int pipe(int*);
int write(int, void*, int);
int read(int, void*, int);
int close(int);
int kill(int);
int exec(char*, char**);
int open(char*, int);
int mknod(char*, short, short);
int unlink(char*);
int fstat(int fd, struct stat*);
int link(char*, char*);
int mkdir(char*);
int chdir(char*);
int dup(int);
int getpid(void);
char* sbrk(int);
int sleep(int);
int uptime(void);
int getcwd(char* buf, int size);
int halt(void);

Some prototypes should change in the meantime and respect POSIX

@NewbiZ
Copy link
Owner Author

NewbiZ commented Nov 1, 2014

All __ulibc_ functions have been removed and implemented in ulibc except malloc and free

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant