Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Update.
2000-08-11  Ulrich Drepper  <drepper@redhat.com>

	* rt/aio_cancel.c: If canceling a specific request which is running
	*really* do nothing.
	* rt/aio_misc.h: Add `done' to states of a request.
	* rt/aio_misc.c: Add several tests for the correct state.
	Simplify request table memory handling.

2000-08-10  Jakub Jelinek  <jakub@redhat.com>

	* dirent/scandir.c: Use it for scandir64 and old_scandir64 as well.
	* dirent/scandir64.c: Move...
	* sysdeps/generic/scandir64.c: ...here.
	* dirent/alphasort64.c: Move...
	* sysdeps/generic/alphasort64.c: ...here.
	* dirent/versionsort64.c: Move...
	* sysdeps/generic/versionsort64.c: ...here.
	* sysdeps/unix/sysv/linux/i386/dirent/Versions (alphasort64,
	getdirentries64, readdir64, readdir64_r, scandir64, versionsort64):
	Export symbols at GLIBC_2.2.
	* sysdeps/unix/sysv/linux/powerpc/dirent/Versions: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/dirent/Versions: Likewise.
	* include/dirent.h (__readdir64_r, __scandir64, __alphasort64,
	__versionsort64): Add prototypes.
	* io/Versions (__xstat64, __fxstat64, __lxstat64): Export at GLIBC_2.2.
	* sysdeps/unix/sysv/linux/alpha/kernel_stat.h (__xstat_conv): Remove
	unused prototype.
	* sysdeps/unix/sysv/linux/alpha/readdir.c: Export at both GLIBC_2.1
	and GLIBC_2.2.
	* sysdeps/unix/sysv/linux/alpha/readdir_r.c: Likewise.
	* sysdeps/unix/sysv/linux/alpha/getdents.c: New.
	* sysdeps/unix/sysv/linux/alpha/getdents64.c: New.
	* sysdeps/unix/sysv/linux/bits/types.h (__ino64_t): Change to
	__u_quad_t.
	* sysdeps/unix/sysv/linux/bits/stat.h (struct stat, struct stat64):
	Adjust for kernel-2.4.0-test6 layout.
	* sysdeps/unix/sysv/linux/i386/fxstat.c (__fxstat64): Export at both
	GLIBC_2.1 and GLIBC_2.2.
	* sysdeps/unix/sysv/linux/i386/lxstat.c (__lxstat64): Likewise.
	* sysdeps/unix/sysv/linux/i386/xstat.c (__xstat64): Likewise.
	* sysdeps/unix/sysv/linux/i386/getdents64.c: New.
	* sysdeps/unix/sysv/linux/i386/olddirent.h: New.
	* sysdeps/unix/sysv/linux/i386/readdir64.c: New.
	* sysdeps/unix/sysv/linux/i386/readdir64_r.c: New.
	* sysdeps/unix/sysv/linux/i386/scandir64.c: New.
	* sysdeps/unix/sysv/linux/i386/alphasort64.c: New.
	* sysdeps/unix/sysv/linux/i386/versionsort64.c: New.
	* sysdeps/unix/sysv/linux/ia64/getdents.c: New.
	* sysdeps/unix/sysv/linux/ia64/getdents64.c: New.
	* sysdeps/unix/sysv/linux/ia64/readdir.c: Include alpha/readdir.c.
	* sysdeps/unix/sysv/linux/ia64/readdir_r.c: Include alpha/readdir_r.c.
	* sysdeps/unix/sysv/linux/mips/bits/types.h (__ino64_t): Change to
	__u_quad_t.
	* sysdeps/unix/sysv/linux/powerpc/bits/stat.h: New.
	* sysdeps/unix/sysv/linux/powerpc/kernel_stat.h (_HAVE_STAT*): Define.
	* sysdeps/unix/sysv/linux/powerpc/scandir64.c: New.
	* sysdeps/unix/sysv/linux/powerpc/getdents64.c: New.
	* sysdeps/unix/sysv/linux/powerpc/readdir64.c: New.
	* sysdeps/unix/sysv/linux/powerpc/readdir64_r.c: New.
	* sysdeps/unix/sysv/linux/sparc/bits/types.h (__ino64_t): Change to
	__u_quad_t.
	* sysdeps/unix/sysv/linux/sparc/bits/stat.h: New.
	* sysdeps/unix/sysv/linux/sparc/sparc32/kernel_stat.h (_HAVE_STAT*):
	Define.
	* sysdeps/unix/sysv/linux/sparc/sparc32/getdents64.c: New.
	* sysdeps/unix/sysv/linux/sparc/sparc32/readdir64.c: New.
	* sysdeps/unix/sysv/linux/sparc/sparc32/readdir64_r.c: New.
	* sysdeps/unix/sysv/linux/sparc/sparc32/scandir64.c: New.
	* sysdeps/unix/sysv/linux/sparc/sparc64/kernel_stat.h (_HAVE_STAT*):
	Define.
	* sysdeps/unix/sysv/linux/sparc/sparc64/readdir.c: Include
	alpha/readdir.c.
	* sysdeps/unix/sysv/linux/sparc/sparc64/readdir_r.c: Include
	alpha/readdir_r.c
	* sysdeps/unix/sysv/linux/sparc/sparc64/getdents.c: New.
	* sysdeps/unix/sysv/linux/sparc/sparc64/getdents64.c: New.
	* sysdeps/unix/sysv/linux/fxstat64.c (__fxstat64): If
	_HAVE_STAT64___ST_INO and __st_ino != (uint32_t)st_ino, set
	st_ino from __st_ino.
	* sysdeps/unix/sysv/linux/lxstat64.c (__lxstat64): Likewise.
	* sysdeps/unix/sysv/linux/xstat64.c (__xstat64): Likewise.
	* sysdeps/unix/sysv/linux/xstatconv.c (xstat_conv, xstat64_conv,
	xstat32_conv): Use _HAVE_STAT* macros.  If _HAVE_STAT64___ST_INO,
	set __st_ino in addition to st_ino.
	* sysdeps/unix/sysv/linux/kernel_stat.h (_HAVE_STAT*): Define.
	* sysdeps/unix/sysv/linux/getdents.c: Use it for __getdents64 and
	__old_getdents64 as well.
	* sysdeps/unix/sysv/linux/getdirentries.c: Use it for
	getdirentries64 and old_getdirentries64 as well.
	* sysdeps/unix/sysv/linux/getdirentries64.c (GETDIRENTRIES,
	__GETDENTS): Define.
	(GETDENTS64): Remove.
	* sysdeps/unix/sysv/linux/getdents64.c (__GETDENTS, DIRENT_TYPE):
	Define.
	(GETDENTS64): Remove.
	* sysdeps/unix/sysv/linux/readdir64.c: Use sysdeps/unix/readdir.c.
	* sysdeps/unix/sysv/linux/readdir64_r.c: Use sysdeps/unix/readdir_r.c.
	* sysdeps/unix/readdir.c: Use it for readdir64 and __old_readdir64
	as well.
	* sysdeps/unix/readdir_r.c: Use it for readdir64_r and
	__old_readdir64_r as well.
	* sysdeps/unix/sysv/linux/kernel-features.h: Define
	__ASSUME_ST_INO_64_bit for kernel 2.4.1 and up.

	* sysdeps/unix/sysv/linux/ia64/bits/siginfo.h: Add SI_KERNEL define.
  • Loading branch information
Ulrich Drepper committed Aug 12, 2000
1 parent 1a5b42a commit 56ddf35
Show file tree
Hide file tree
Showing 63 changed files with 1,213 additions and 484 deletions.
107 changes: 105 additions & 2 deletions ChangeLog
@@ -1,7 +1,110 @@
2000-08-11 Ulrich Drepper <drepper@redhat.com>

* rt/aio_cancel.c: If canceling a specific request which is running
*really* do nothing.
* rt/aio_misc.h: Add `done' to states of a request.
* rt/aio_misc.c: Add several tests for the correct state.
Simplify request table memory handling.

2000-08-10 Jakub Jelinek <jakub@redhat.com>

* dirent/scandir.c: Use it for scandir64 and old_scandir64 as well.
* dirent/scandir64.c: Move...
* sysdeps/generic/scandir64.c: ...here.
* dirent/alphasort64.c: Move...
* sysdeps/generic/alphasort64.c: ...here.
* dirent/versionsort64.c: Move...
* sysdeps/generic/versionsort64.c: ...here.
* sysdeps/unix/sysv/linux/i386/dirent/Versions (alphasort64,
getdirentries64, readdir64, readdir64_r, scandir64, versionsort64):
Export symbols at GLIBC_2.2.
* sysdeps/unix/sysv/linux/powerpc/dirent/Versions: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc32/dirent/Versions: Likewise.
* include/dirent.h (__readdir64_r, __scandir64, __alphasort64,
__versionsort64): Add prototypes.
* io/Versions (__xstat64, __fxstat64, __lxstat64): Export at GLIBC_2.2.
* sysdeps/unix/sysv/linux/alpha/kernel_stat.h (__xstat_conv): Remove
unused prototype.
* sysdeps/unix/sysv/linux/alpha/readdir.c: Export at both GLIBC_2.1
and GLIBC_2.2.
* sysdeps/unix/sysv/linux/alpha/readdir_r.c: Likewise.
* sysdeps/unix/sysv/linux/alpha/getdents.c: New.
* sysdeps/unix/sysv/linux/alpha/getdents64.c: New.
* sysdeps/unix/sysv/linux/bits/types.h (__ino64_t): Change to
__u_quad_t.
* sysdeps/unix/sysv/linux/bits/stat.h (struct stat, struct stat64):
Adjust for kernel-2.4.0-test6 layout.
* sysdeps/unix/sysv/linux/i386/fxstat.c (__fxstat64): Export at both
GLIBC_2.1 and GLIBC_2.2.
* sysdeps/unix/sysv/linux/i386/lxstat.c (__lxstat64): Likewise.
* sysdeps/unix/sysv/linux/i386/xstat.c (__xstat64): Likewise.
* sysdeps/unix/sysv/linux/i386/getdents64.c: New.
* sysdeps/unix/sysv/linux/i386/olddirent.h: New.
* sysdeps/unix/sysv/linux/i386/readdir64.c: New.
* sysdeps/unix/sysv/linux/i386/readdir64_r.c: New.
* sysdeps/unix/sysv/linux/i386/scandir64.c: New.
* sysdeps/unix/sysv/linux/i386/alphasort64.c: New.
* sysdeps/unix/sysv/linux/i386/versionsort64.c: New.
* sysdeps/unix/sysv/linux/ia64/getdents.c: New.
* sysdeps/unix/sysv/linux/ia64/getdents64.c: New.
* sysdeps/unix/sysv/linux/ia64/readdir.c: Include alpha/readdir.c.
* sysdeps/unix/sysv/linux/ia64/readdir_r.c: Include alpha/readdir_r.c.
* sysdeps/unix/sysv/linux/mips/bits/types.h (__ino64_t): Change to
__u_quad_t.
* sysdeps/unix/sysv/linux/powerpc/bits/stat.h: New.
* sysdeps/unix/sysv/linux/powerpc/kernel_stat.h (_HAVE_STAT*): Define.
* sysdeps/unix/sysv/linux/powerpc/scandir64.c: New.
* sysdeps/unix/sysv/linux/powerpc/getdents64.c: New.
* sysdeps/unix/sysv/linux/powerpc/readdir64.c: New.
* sysdeps/unix/sysv/linux/powerpc/readdir64_r.c: New.
* sysdeps/unix/sysv/linux/sparc/bits/types.h (__ino64_t): Change to
__u_quad_t.
* sysdeps/unix/sysv/linux/sparc/bits/stat.h: New.
* sysdeps/unix/sysv/linux/sparc/sparc32/kernel_stat.h (_HAVE_STAT*):
Define.
* sysdeps/unix/sysv/linux/sparc/sparc32/getdents64.c: New.
* sysdeps/unix/sysv/linux/sparc/sparc32/readdir64.c: New.
* sysdeps/unix/sysv/linux/sparc/sparc32/readdir64_r.c: New.
* sysdeps/unix/sysv/linux/sparc/sparc32/scandir64.c: New.
* sysdeps/unix/sysv/linux/sparc/sparc64/kernel_stat.h (_HAVE_STAT*):
Define.
* sysdeps/unix/sysv/linux/sparc/sparc64/readdir.c: Include
alpha/readdir.c.
* sysdeps/unix/sysv/linux/sparc/sparc64/readdir_r.c: Include
alpha/readdir_r.c
* sysdeps/unix/sysv/linux/sparc/sparc64/getdents.c: New.
* sysdeps/unix/sysv/linux/sparc/sparc64/getdents64.c: New.
* sysdeps/unix/sysv/linux/fxstat64.c (__fxstat64): If
_HAVE_STAT64___ST_INO and __st_ino != (uint32_t)st_ino, set
st_ino from __st_ino.
* sysdeps/unix/sysv/linux/lxstat64.c (__lxstat64): Likewise.
* sysdeps/unix/sysv/linux/xstat64.c (__xstat64): Likewise.
* sysdeps/unix/sysv/linux/xstatconv.c (xstat_conv, xstat64_conv,
xstat32_conv): Use _HAVE_STAT* macros. If _HAVE_STAT64___ST_INO,
set __st_ino in addition to st_ino.
* sysdeps/unix/sysv/linux/kernel_stat.h (_HAVE_STAT*): Define.
* sysdeps/unix/sysv/linux/getdents.c: Use it for __getdents64 and
__old_getdents64 as well.
* sysdeps/unix/sysv/linux/getdirentries.c: Use it for
getdirentries64 and old_getdirentries64 as well.
* sysdeps/unix/sysv/linux/getdirentries64.c (GETDIRENTRIES,
__GETDENTS): Define.
(GETDENTS64): Remove.
* sysdeps/unix/sysv/linux/getdents64.c (__GETDENTS, DIRENT_TYPE):
Define.
(GETDENTS64): Remove.
* sysdeps/unix/sysv/linux/readdir64.c: Use sysdeps/unix/readdir.c.
* sysdeps/unix/sysv/linux/readdir64_r.c: Use sysdeps/unix/readdir_r.c.
* sysdeps/unix/readdir.c: Use it for readdir64 and __old_readdir64
as well.
* sysdeps/unix/readdir_r.c: Use it for readdir64_r and
__old_readdir64_r as well.
* sysdeps/unix/sysv/linux/kernel-features.h: Define
__ASSUME_ST_INO_64_bit for kernel 2.4.1 and up.

2000-08-08 Jes Sorensen <jes@linuxcare.com>

* sysdeps/unix/sysv/linux/ia64/bits/siginfo.h: Add SI_KERNEL
define.
* sysdeps/unix/sysv/linux/ia64/bits/siginfo.h: Add SI_KERNEL define.
Add missing ILL_BADIADDR to enum and make ILL_BREAK match the
define of the kernel.
Add missing __SEG_PSTKOVF definition.
Expand Down
15 changes: 4 additions & 11 deletions NEWS
@@ -1,4 +1,4 @@
GNU C Library NEWS -- history of user-visible changes. 2000-08-03
GNU C Library NEWS -- history of user-visible changes. 2000-08-11

Copyright (C) 1992-1999, 2000 Free Software Foundation, Inc.
See the end for copying conditions.
Expand Down Expand Up @@ -1084,7 +1084,8 @@ Version 1.04
compiler, so the C library should now work with C++ code.

* The header file <bstring.h> is gone. <string.h> now declares bcopy,
bcmp, bzero, and ffs.
bcmp, bzero, and ffs. (Update: nowadays these functions are declared
in <strings.h>.)

* Mike Haertel (of GNU e?grep and malloc fame) has written a new sorting
function which uses the `merge sort' algorithm, and is said to be
Expand All @@ -1095,22 +1096,14 @@ Version 1.04

* The C library now includes Michael Glad's Ultra Fast Crypt, which
provides the Unix `crypt' function, plus some other entry points.
Because of the United States export restriction on DES implementations,
we are distributing this code separately from the rest of the C library.
There is an extra distribution tar file just for crypt; it is called
`glibc-VERSION-crypt.tar.Z', e.g. `glibc-1.04-crypt.tar.Z'. You can just
unpack the crypt distribution along with the rest of the C library and
build; you can also build the library without getting crypt. Users
outside the USA can get the crypt distribution via anonymous FTP from
ftp.uni-c.dk [129.142.6.74], or another archive site outside the U.S.

* The code and header files taken from 4.4 BSD have been updated with the
latest files released from Berkeley.

----------------------------------------------------------------------
Copyright information:

Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
Copyright (C) 1992-1999, 2000 Free Software Foundation, Inc.

Permission is granted to anyone to make or distribute verbatim copies
of this document as received, in any medium, provided that the
Expand Down
28 changes: 17 additions & 11 deletions dirent/scandir.c
Expand Up @@ -21,17 +21,23 @@
#include <string.h>
#include <errno.h>

#ifndef SCANDIR
#define SCANDIR scandir
#define READDIR __readdir
#define DIRENT_TYPE struct dirent
#endif

int
scandir (dir, namelist, select, cmp)
SCANDIR (dir, namelist, select, cmp)
const char *dir;
struct dirent ***namelist;
int (*select) (const struct dirent *);
DIRENT_TYPE ***namelist;
int (*select) (const DIRENT_TYPE *);
int (*cmp) (const void *, const void *);
{
DIR *dp = __opendir (dir);
struct dirent **v = NULL;
DIRENT_TYPE **v = NULL;
size_t vsize = 0, i;
struct dirent *d;
DIRENT_TYPE *d;
int save;

if (dp == NULL)
Expand All @@ -41,34 +47,34 @@ scandir (dir, namelist, select, cmp)
__set_errno (0);

i = 0;
while ((d = __readdir (dp)) != NULL)
while ((d = READDIR (dp)) != NULL)
if (select == NULL || (*select) (d))
{
struct dirent *vnew;
DIRENT_TYPE *vnew;
size_t dsize;

/* Ignore errors from select or readdir */
__set_errno (0);

if (__builtin_expect (i == vsize, 0))
{
struct dirent **new;
DIRENT_TYPE **new;
if (vsize == 0)
vsize = 10;
else
vsize *= 2;
new = (struct dirent **) realloc (v, vsize * sizeof (*v));
new = (DIRENT_TYPE **) realloc (v, vsize * sizeof (*v));
if (new == NULL)
break;
v = new;
}

dsize = &d->d_name[_D_ALLOC_NAMLEN (d)] - (char *) d;
vnew = (struct dirent *) malloc (dsize);
vnew = (DIRENT_TYPE *) malloc (dsize);
if (vnew == NULL)
break;

v[i++] = (struct dirent *) memcpy (vnew, d, dsize);
v[i++] = (DIRENT_TYPE *) memcpy (vnew, d, dsize);
}

if (__builtin_expect (errno, 0) != 0)
Expand Down
93 changes: 0 additions & 93 deletions dirent/scandir64.c

This file was deleted.

8 changes: 8 additions & 0 deletions include/dirent.h
Expand Up @@ -8,8 +8,16 @@ extern struct dirent *__readdir (DIR *__dirp);
extern struct dirent64 *__readdir64 (DIR *__dirp);
extern int __readdir_r (DIR *__dirp, struct dirent *__entry,
struct dirent **__result);
extern int __readdir64_r (DIR *__dirp, struct dirent64 *__entry,
struct dirent64 **__result);
extern int __scandir64 (__const char * __dir,
struct dirent64 *** __namelist,
int (*__selector) (__const struct dirent64 *),
int (*__cmp) (__const void *, __const void *));
extern __ssize_t __getdents (int __fd, char *__buf, size_t __nbytes)
internal_function;
extern __ssize_t __getdents64 (int __fd, char *__buf, size_t __nbytes)
internal_function;
extern int __alphasort64 (const void *a, const void *b);
extern int __versionsort64 (const void *a, const void *b);
#endif
24 changes: 17 additions & 7 deletions rt/aio_cancel.c
Expand Up @@ -29,6 +29,7 @@
/* And undo the hack. */
#undef aio_cancel64

#include <assert.h>
#include <errno.h>

#include "aio_misc.h"
Expand Down Expand Up @@ -74,16 +75,19 @@ aio_cancel (fildes, aiocbp)

/* Don't remove the entry if a thread is already working on it. */
if (req->running == allocated)
result = AIO_NOTCANCELED;
else if (req->running == yes)
{
result = AIO_NOTCANCELED;
req = NULL;
}
else
{
/* We can remove the entry. */
__aio_remove_request (last, req, 0);

result = AIO_CANCELED;
}

req->next_prio = NULL;
req->next_prio = NULL;
}
}
}
else
Expand All @@ -103,19 +107,25 @@ aio_cancel (fildes, aiocbp)
old->next_prio = NULL;

result = AIO_NOTCANCELED;

if (req != NULL)
__aio_remove_request (old, req, 1);
}
else
result = AIO_CANCELED;
{
result = AIO_CANCELED;

/* We can remove the entry. */
__aio_remove_request (NULL, req, 1);
/* We can remove the entry. */
__aio_remove_request (NULL, req, 1);
}
}
}

/* Mark requests as canceled and send signal. */
while (req != NULL)
{
struct requestlist *old = req;
assert (req->running == yes || req->running == queued);
req->aiocbp->aiocb.__error_code = ECANCELED;
req->aiocbp->aiocb.__return_value = -1;
__aio_notify (req);
Expand Down

0 comments on commit 56ddf35

Please sign in to comment.