From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14924 invoked by alias); 24 Aug 2018 13:08:35 -0000 Mailing-List: contact newlib-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-cvs-owner@sourceware.org Received: (qmail 13436 invoked by uid 10080); 24 Aug 2018 13:08:34 -0000 Date: Fri, 24 Aug 2018 13:08:00 -0000 Message-ID: <20180824130834.13416.qmail@sourceware.org> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Sebastian Huber To: newlib-cvs@sourceware.org Subject: [newlib-cygwin] Implement read(2)/write(2) and neccessary lseek(2) X-Act-Checkin: newlib-cygwin X-Git-Author: kib X-Git-Refname: refs/heads/master X-Git-Oldrev: 5d29023c110473e13beff16607d85a49673f2b7b X-Git-Newrev: e6a85661cee799cd51c2afff4d6d5ec54d3e8a43 X-SW-Source: 2018-q3/txt/msg00051.txt.bz2 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=e6a85661cee799cd51c2afff4d6d5ec54d3e8a43 commit e6a85661cee799cd51c2afff4d6d5ec54d3e8a43 Author: kib Date: Wed Aug 21 17:45:00 2013 +0000 Implement read(2)/write(2) and neccessary lseek(2) for posix shmfd. Add MAC framework entries for posix shm read and write. Do not allow implicit extension of the underlying memory segment past the limit set by ftruncate(2) by either of the syscalls. Read and write returns short i/o, lseek(2) fails with EINVAL when resulting offset does not fit into the limit. Discussed with: alc Tested by: pho Sponsored by: The FreeBSD Foundation Diff: --- newlib/libc/sys/rtems/include/sys/mman.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/newlib/libc/sys/rtems/include/sys/mman.h b/newlib/libc/sys/rtems/include/sys/mman.h index e7e5cf4..536bfd5 100644 --- a/newlib/libc/sys/rtems/include/sys/mman.h +++ b/newlib/libc/sys/rtems/include/sys/mman.h @@ -190,6 +190,10 @@ typedef __size_t size_t; #endif #if defined(_KERNEL) || defined(_WANT_FILE) +#include +#include +#include +#include #include struct file; @@ -215,6 +219,9 @@ struct shmfd { struct label *shm_label; /* MAC label */ const char *shm_path; + + struct rangelock shm_rl; + struct mtx shm_mtx; }; #endif