This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: mlock in libc


> What does work is using VM_PROT_DEFAULT, because memory allocated
> with malloc seems to use VM_PROT_DEFAULT.  However, I think the best
> solution is to call vm_region and actually get the proper
> permissions for the pages.

We certainly want to avoid making any assumptions.

> The second does not because perhaps something could write to a
> read-only part of memory between the calls to vm_protect.

It is not only that, but also that you lose any COW savings.  Thus,
doing a read loop would be better.


Your patches only cover a single memory region: there may be more than
one region or the region may be larger than the area that the user is
wiring.  Both of these cases should be handled by your code and are
handled by hurd/libshouldbeinlibc/wire.c:wire_segment_internal.

Thanks.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]