libposix: sleep and pipe

This commit is contained in:
Giacomo Tesio 2017-04-30 16:49:50 +02:00
parent 3707eaece6
commit 14934ee51f
3 changed files with 19 additions and 0 deletions

View File

@ -59,6 +59,8 @@ extern void * POSIX_malloc(int *errnop, size_t size);
extern void *POSIX_realloc(int *errnop, void *ptr, size_t size);
extern void *POSIX_calloc(int *errnop, size_t nelem, size_t size);
extern void POSIX_free(void *ptr);
extern unsigned int POSIX_sleep(unsigned int seconds);
extern int POSIX_pipe(int *errnop, int fildes[2]);
/* Library initialization
*/

View File

@ -97,6 +97,16 @@ find_seek_type(int whence)
return -1;
}
int
POSIX_pipe(int *errnop, int fildes[2])
{
int res;
res = jehanne_pipe(fildes);
if(res == -1)
*errnop = __libposix_get_errno(PosixEMFILE);
return res;
}
int
POSIX_open(int *errnop, const char *name, int flags, int mode)
{

View File

@ -41,6 +41,13 @@ POSIX_isatty(int *errnop, int fd)
return 0;
}
unsigned int
POSIX_sleep(unsigned int seconds)
{
sleep(seconds*1000);
return 0;
}
clock_t
POSIX_times(int *errnop, void *buf)
{