jehanne: fix sys/dirent.h (still BROKEN)

This commit is contained in:
Giacomo Tesio 2017-08-19 00:08:48 +02:00
parent 8fbd328317
commit 025678147e
3 changed files with 17 additions and 28 deletions

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 closedir.c
calloc.c callocr.c realloc.c reallocr.c
lib_a_LIBADD = $(extra_objs)
EXTRA_lib_a_SOURCES = libposix_conf.c syscalls.c

View File

@ -1,23 +0,0 @@
/*
* 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

@ -18,16 +18,28 @@
#ifndef _SYS_DIRENT_H
#define _SYS_DIRENT_H
#define MAXNAMLEN 127 /* sizeof(struct dirent.d_name)-1 */
struct dirent
{
ino_t d_ino;
char d_name[256];
char d_name[MAXNAMLEN+1];
};
#define d_fileno d_ino /* Cheap backwards compatibility. */
#define dirent64 dirent
typedef struct {
int dd_fd; /* Directory file. */
int dd_loc; /* Position in buffer. */
int dd_seek;
char *dd_buf; /* Pointer to buffer. */
int dd_len; /* Buffer size. */
int dd_size; /* Data size in buffer. */
} DIR;
typedef struct DIR DIR;
#define d_fileno d_ino /* Cheap backwards compatibility. */
#ifdef __USE_LARGEFILE64
#define dirent64 dirent
#endif
DIR *opendir(const char *);
struct dirent *readdir(DIR *);