Re: CS352 Homework 10 / General Question

1 view
Skip to first unread message

David L. Rager

unread,
Nov 24, 2009, 1:02:25 AM11/24/09
to utexas-cs352-fall2009
MAP_PRIVATE means that any changes to the memory-mapped region can
only be seen by that particular process. MAP_SHARED means that the
changes can be seen by other processes. Guess which one you need if
you want to change a file in a way that persists beyond one particular
process.

On Mon, Nov 23, 2009 at 9:42 PM, wrote:
> I think this could help me in my solution to 10.14 since 10.5 is very
> similar in scope. In the solution given to 10.5, bufp gets the flag
> "MAP_PRIVATE". Would using "MAP_SHARED" have a negative effect on the
> program? I guess what I'm trying to say is that I don't understand the
> difference between the two and the book doesn't really help. Could you
> explain the difference and/or effect of using one over the other? Thank you
> in advance for any help.

Matt Miller

unread,
Nov 24, 2009, 5:20:48 PM11/24/09
to utexas-cs352-fall2009
Has anyone figure out what this line is for? i.e., what purpose does it serve in the code for actually solving this problem, if any?

void *mmap(void *start, size_t length, int prot , int flags, int fd, off_t offset);

It looks like a function prototype, but it returns void, which only adds to my confusion.

This problem is frustrating because at this point I know exactly what needs to be done conceptually, but the code fragments and hints given with it don't make a lot of sense to me and I've spent more time trying to figure out what the hints are trying to say than what the question is asking.

Reply all
Reply to author
Forward
0 new messages