jehanne: first try to enable posix (BROKEN)

This commit is contained in:
Giacomo Tesio 2017-08-18 01:02:24 +02:00
parent 8059e6c9db
commit 8fbd328317
4 changed files with 78 additions and 1 deletions

View File

@ -390,6 +390,7 @@ case "${host}" in
*-*-jehanne*)
sys_dir=jehanne
syscall_dir=syscalls
posix_dir=posix
newlib_cflags="${newlib_cflags} -DREENTRANT_SYSCALLS_PROVIDED -DMALLOC_PROVIDED"
newlib_cflags="${newlib_cflags} -fno-omit-frame-pointer"
default_newlib_io_c99_formats="yes"

View File

@ -11,7 +11,7 @@ extra_objs =
endif
lib_a_SOURCES = getenv_r.c getenv.c malloc.c mallocr.c free.c freer.c \
calloc.c callocr.c realloc.c reallocr.c
calloc.c callocr.c realloc.c reallocr.c closedir.c
lib_a_LIBADD = $(extra_objs)
EXTRA_lib_a_SOURCES = libposix_conf.c syscalls.c

View File

@ -0,0 +1,23 @@
/*
* This file is part of Jehanne.
*
* Copyright (C) 2017 Giacomo Tesio <giacomo@tesio.it>
*
* This is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, version 3 of the License.
*
* Jehanne is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
*/
int
closedir(DIR *)
{
/* TODO: implement */
return -1;
}

View File

@ -0,0 +1,53 @@
/*
* This file is part of Jehanne.
*
* Copyright (C) 2017 Giacomo Tesio <giacomo@tesio.it>
*
* This is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, version 3 of the License.
*
* Jehanne is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _SYS_DIRENT_H
#define _SYS_DIRENT_H
struct dirent
{
ino_t d_ino;
char d_name[256];
};
#define d_fileno d_ino /* Cheap backwards compatibility. */
#define dirent64 dirent
typedef struct DIR DIR;
DIR *opendir(const char *);
struct dirent *readdir(DIR *);
int readdir_r(DIR *__restrict, struct dirent *__restrict,
struct dirent **__restrict);
void rewinddir(DIR *);
int dirfd(DIR *);
DIR *fdopendir(int);
int closedir(DIR *);
#ifndef _POSIX_SOURCE
long telldir (DIR *);
void seekdir (DIR *, off_t loc);
int scandir (const char *__dir,
struct dirent ***__namelist,
int (*select) (const struct dirent *),
int (*compar) (const struct dirent **, const struct dirent **));
int alphasort (const struct dirent **__a, const struct dirent **__b);
#endif /* _POSIX_SOURCE */
#endif