summaryrefslogtreecommitdiff
path: root/libc/rt
diff options
context:
space:
mode:
authorjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2007-05-24 16:37:12 +0000
committerjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2007-05-24 16:37:12 +0000
commit4d3a9860fce21aedcdc076117ec76f87d84add34 (patch)
tree04ed976e790ecc7ffc71be153f2d97ce0a355f4b /libc/rt
parente4899a03d1fd17fac542f34f2b3d3e0087b26908 (diff)
downloadeglibc2-4d3a9860fce21aedcdc076117ec76f87d84add34.tar.gz
Merge changes between r2243 and r2277 from /fsf/trunk.
git-svn-id: svn://svn.eglibc.org/trunk@2278 7b3dc134-2b1b-0410-93df-9e9f96275f8d
Diffstat (limited to 'libc/rt')
-rw-r--r--libc/rt/tst-shm.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/libc/rt/tst-shm.c b/libc/rt/tst-shm.c
index 01bf89fa7..5838b0ee1 100644
--- a/libc/rt/tst-shm.c
+++ b/libc/rt/tst-shm.c
@@ -60,7 +60,7 @@ static void
worker (int write_now)
{
struct timespec ts;
- struct stat st;
+ struct stat64 st;
int i;
int fd = do_open ();
char *mem;
@@ -68,8 +68,10 @@ worker (int write_now)
if (fd == -1)
exit (fd);
- if (fstat (fd, &st) == -1 || st.st_size != 4000)
+ if (fstat64 (fd, &st) == -1)
error (EXIT_FAILURE, 0, "stat failed");
+ if (st.st_size != 4000)
+ error (EXIT_FAILURE, 0, "size incorrect");
mem = mmap (NULL, 4000, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
if (mem == NULL)
@@ -131,7 +133,7 @@ do_test (void)
pid_t pid2;
int status1;
int status2;
- struct stat st;
+ struct stat64 st;
/* Create the shared memory object. */
fd = shm_open ("/shm-test", O_RDWR | O_CREAT | O_TRUNC | O_EXCL, 0600);
@@ -155,11 +157,16 @@ do_test (void)
return 0;
}
- if (fstat (fd, &st) == -1 || st.st_size != 4000)
+ if (fstat64 (fd, &st) == -1)
{
shm_unlink ("/shm-test");
error (EXIT_FAILURE, 0, "initial stat failed");
}
+ if (st.st_size != 4000)
+ {
+ shm_unlink ("/shm-test");
+ error (EXIT_FAILURE, 0, "initial size not correct");
+ }
/* Spawn to processes which will do the work. */
pid1 = fork ();