2 * This library is free software; you can redistribute it and/or
3 * modify it under the terms of the GNU Lesser General Public
4 * License as published by the Free Software Foundation; either
5 * version 2.1 of the License, or (at your option) any later version.
7 * This library is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10 * Lesser General Public License for more details.
12 * You should have received a copy of the GNU Lesser General Public
13 * License along with this library; if not, write to the Free Software
14 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 #if defined(__GLIBC__) && !defined(REDSTORM)
25 * As of glibc 2.3, the new capability to define functions with a 'hidden'
26 * attribute means that any time glibc decides to use that capability
27 * we will no longer be able to successfully intercept low level calls
28 * in a link against default system glibc. Thus the following imported
40 #include "sysio-symbols.h"
43 /***********************************************************
44 * dir series functions *
45 ***********************************************************/
48 SYSIO_INTERFACE_NAME(opendir)(const char *name)
52 SYSIO_INTERFACE_DISPLAY_BLOCK;
54 SYSIO_INTERFACE_ENTER;
56 dir = (DIR * )calloc(1, sizeof(DIR));
58 SYSIO_INTERFACE_RETURN(NULL, -ENOMEM);
60 dir->fd = open(name, O_RDONLY);
63 SYSIO_INTERFACE_RETURN(NULL, -errno);
68 sysio_sym_weak_alias(opendir, __opendir)
71 SYSIO_INTERFACE_NAME(closedir)(DIR *dir)
74 SYSIO_INTERFACE_DISPLAY_BLOCK;
76 SYSIO_INTERFACE_ENTER;
78 rc = SYSIO_INTERFACE_NAME(close)(dir->fd);
81 SYSIO_INTERFACE_RETURN(rc, 0);
84 sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(closedir),
85 PREPEND(__, SYSIO_INTERFACE_NAME(closedir)))
88 SYSIO_INTERFACE_NAME(dirfd)(DIR *dir)
94 SYSIO_INTERFACE_NAME(telldir)(DIR *dir)
100 SYSIO_INTERFACE_NAME(seekdir)(DIR *dir, long int offset)
102 dir->filepos = offset;
109 SYSIO_INTERFACE_NAME(rewinddir)(DIR *dir)