ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
(int)pointer & ~ 0xFFF
edit: 4k is x86 and amd64, other cpu architectures may use a diff alignment
(so use the getpagesize from above, or better yet if there is a header that declares it)
another, maybe faster, way would be to use two shifts
Hi,
I know where/when it stops...I am debugging using QT.
can you post a working code (fixing the code mentioned above), I don't want ideas on how to solve it since I would have tried them already, please copy paste the code to your editor, compile, run and figure out the reason for violation......
Hi,
I know where/when it stops...I am debugging using QT.
can you post a working code (fixing the code mentioned above), I don't want ideas on how to solve it since I would have tried them already, please copy paste the code to your editor, compile, run and figure out the reason for violation......
i understand the language barrier
people will be willing to help you if you try to do it yourself and post on what you got stuck
also remember to use the CODE ("#" button above) tags when pasting code on the forum
You are trying to change the protection on a page containing a constant string, so it would be in your program's text segment. The value that you gave turns off read and execute access on the whole page, which is likely to instantly kill your program. Allocate a new page and mess with that, not parts of your program text.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.