Update.
2000-05-26 Ulrich Drepper <drepper@redhat.com> * posix/tst-preadwrite.c: Alloc file being used also for testing pread64 and pwrite64. * posix/tst-preadwrite64.c: New file.
This commit is contained in:
parent
924e32b139
commit
09bbe3bf4e
|
@ -1,3 +1,9 @@
|
||||||
|
2000-05-26 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
* posix/tst-preadwrite.c: Alloc file being used also for testing
|
||||||
|
pread64 and pwrite64.
|
||||||
|
* posix/tst-preadwrite64.c: New file.
|
||||||
|
|
||||||
2000-05-26 Andreas Jaeger <aj@suse.de>
|
2000-05-26 Andreas Jaeger <aj@suse.de>
|
||||||
|
|
||||||
* sysdeps/unix/sysv/linux/i386/pread64.c: Removed, we can use the
|
* sysdeps/unix/sysv/linux/i386/pread64.c: Removed, we can use the
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Tests for pread and pwrite.
|
/* Tests for pread and pwrite.
|
||||||
Copyright (C) 1998 Free Software Foundation, Inc.
|
Copyright (C) 1998, 2000 Free Software Foundation, Inc.
|
||||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
|
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
|
@ -23,6 +23,15 @@
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
|
||||||
|
/* Allow testing of the 64-bit versions as well. */
|
||||||
|
#ifndef PREAD
|
||||||
|
# define PREAD pread
|
||||||
|
# define PWRITE pwrite
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define STRINGIFY(s) STRINGIFY2 (s)
|
||||||
|
#define STRINGIFY2(s) #s
|
||||||
|
|
||||||
/* Prototype for our test function. */
|
/* Prototype for our test function. */
|
||||||
extern void do_prepare (int argc, char *argv[]);
|
extern void do_prepare (int argc, char *argv[]);
|
||||||
extern int do_test (int argc, char *argv[]);
|
extern int do_test (int argc, char *argv[]);
|
||||||
|
@ -73,16 +82,16 @@ do_test (int argc, char *argv[])
|
||||||
|
|
||||||
for (i = 100; i < 200; ++i)
|
for (i = 100; i < 200; ++i)
|
||||||
buf[i] = i;
|
buf[i] = i;
|
||||||
if (pwrite (fd, buf + 100, 100, 100) != 100)
|
if (PWRITE (fd, buf + 100, 100, 100) != 100)
|
||||||
error (EXIT_FAILURE, errno, "during pwrite");
|
error (EXIT_FAILURE, errno, "during %s", STRINGIFY (PWRITE));
|
||||||
|
|
||||||
for (i = 450; i < 600; ++i)
|
for (i = 450; i < 600; ++i)
|
||||||
buf[i] = i;
|
buf[i] = i;
|
||||||
if (pwrite (fd, buf + 450, 150, 450) != 150)
|
if (PWRITE (fd, buf + 450, 150, 450) != 150)
|
||||||
error (EXIT_FAILURE, errno, "during pwrite");
|
error (EXIT_FAILURE, errno, "during %s", STRINGIFY (PWRITE));
|
||||||
|
|
||||||
if (pread (fd, res, sizeof (buf) - 50, 50) != sizeof (buf) - 50)
|
if (PREAD (fd, res, sizeof (buf) - 50, 50) != sizeof (buf) - 50)
|
||||||
error (EXIT_FAILURE, errno, "during pread");
|
error (EXIT_FAILURE, errno, "during %s", STRINGIFY (PREAD));
|
||||||
|
|
||||||
close (fd);
|
close (fd);
|
||||||
unlink (name);
|
unlink (name);
|
||||||
|
|
Loading…
Reference in a new issue