posix/mman: update atime on shared memory read call

Update #2859.
This commit is contained in:
Gedare Bloom
2017-03-15 14:29:19 -04:00
parent e0627c69b5
commit 889eb76731
2 changed files with 10 additions and 0 deletions

View File

@@ -84,6 +84,15 @@ RTEMS_INLINE_ROUTINE POSIX_Shm_Control *_POSIX_Shm_Get_by_name(
);
}
RTEMS_INLINE_ROUTINE void _POSIX_Shm_Update_atime(
POSIX_Shm_Control *shm
)
{
struct timeval now;
gettimeofday( &now, 0 );
shm->atime = now.tv_sec;
}
RTEMS_INLINE_ROUTINE void _POSIX_Shm_Update_mtime_ctime(
POSIX_Shm_Control *shm
)

View File

@@ -66,6 +66,7 @@ static ssize_t shm_read( rtems_libio_t *iop, void *buffer, size_t count )
buffer,
count
);
_POSIX_Shm_Update_atime( shm );
_POSIX_Shm_Release( shm, &queue_context );
return bytes_read;