From 367660c192983fb223b89985d415fb0e62f4b4ba Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Sun, 31 Mar 2002 04:42:13 +0000 Subject: Add glob64.c, and add support for glob64 when large file is enabled. -Erik --- libc/misc/glob/Makefile | 4 +++- libc/misc/glob/glob-hooks.c | 35 +++++++++++++++++++++++++++++++++++ libc/misc/glob/glob64.c | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 libc/misc/glob/glob-hooks.c create mode 100644 libc/misc/glob/glob64.c (limited to 'libc/misc/glob') diff --git a/libc/misc/glob/Makefile b/libc/misc/glob/Makefile index e4ecd078a..e53c95b18 100644 --- a/libc/misc/glob/Makefile +++ b/libc/misc/glob/Makefile @@ -24,7 +24,7 @@ TOPDIR=../../../ include $(TOPDIR)Rules.mak -CSRC=glob.c +CSRC=glob.c glob64.c glob-hooks.c COBJS=$(patsubst %.c,%.o, $(CSRC)) OBJS=$(COBJS) @@ -39,6 +39,8 @@ $(COBJS): %.o : %.c $(CC) $(CFLAGS) -c $< -o $@ $(STRIPTOOL) -x -R .note -R .comment $*.o +glob64.o: glob64.c glob.c + clean: rm -f *.[oa] *~ core diff --git a/libc/misc/glob/glob-hooks.c b/libc/misc/glob/glob-hooks.c new file mode 100644 index 000000000..e2d8030cf --- /dev/null +++ b/libc/misc/glob/glob-hooks.c @@ -0,0 +1,35 @@ +/* Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. + * + * modified for uClibc by Erik Andersen + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU Library General Public License as published by + * the Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program 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 Library General Public License + * for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +__ptr_t (*__glob_opendir_hook) __P ((const char *directory)); +const char *(*__glob_readdir_hook) __P ((__ptr_t stream)); +void (*__glob_closedir_hook) __P ((__ptr_t stream)); + diff --git a/libc/misc/glob/glob64.c b/libc/misc/glob/glob64.c new file mode 100644 index 000000000..83a406afd --- /dev/null +++ b/libc/misc/glob/glob64.c @@ -0,0 +1,33 @@ +#include + +#ifdef __UCLIBC_HAVE_LFS__ + +#if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS != 64 +#undef _FILE_OFFSET_BITS +#define _FILE_OFFSET_BITS 64 +#endif +#ifndef __USE_FILE_OFFSET64 +# define __USE_FILE_OFFSET64 1 +#endif +#ifndef __USE_LARGEFILE64 +# define __USE_LARGEFILE64 1 +#endif +#include +#include +#include + +#define dirent dirent64 +#define readdir(dirp) readdir64 (dirp) + +#define glob_t glob64_t +#define glob(pattern, flags, errfunc, pglob) \ + glob64 (pattern, flags, errfunc, pglob) +#define globfree(pglob) globfree64 (pglob) + +#undef stat +#define stat stat64 +#define lstat lstat64 + +#include "glob.c" + +#endif -- cgit v1.2.3