[haiku-bugs] Re: [Haiku] #8233: Patch for pthread_attr_getguardsize

  • From: "bonefish" <trac@xxxxxxxxxxxx>
  • Date: Sun, 12 Feb 2012 14:19:13 -0000

#8233: Patch for pthread_attr_getguardsize
--------------------------+------------------------------------------------
   Reporter:  unitedroad  |      Owner:  nobody
       Type:              |     Status:  new
  enhancement             |  Milestone:  R1
   Priority:  normal      |    Version:  R1/Development
  Component:              |   Keywords:  pthread, pthread_attr_getguardsize
  System/POSIX            |   Blocking:
 Resolution:              |   Platform:  All
 Blocked By:              |
Has a Patch:  1           |
--------------------------+------------------------------------------------
Changes (by bonefish):

 * version:  R1/alpha3 => R1/Development


Comment:

 Replying to [comment:5 hamish]:
 > I can implement the actual functionality, though I have a question:

 Great!

 > Should get_thread_info return a stack_base and stack_end that include
 the guard pages or not? Currently, if I'm not mistaken, the range it
 returns includes the guard pages (though it excludes the TLS space). To me
 it seems more consistent (and useful) for it to return only the usable
 range of the stack, though I'm not sure what the behaviour was on BeOS,
 and this might break compatibility.

 I don't think this is much of a compatibility concern. The stack range
 returned by `get_thread_info()` is mostly informative only. There isn't
 much one can do with it anyway -- maybe check whether a certain object has
 been allocated on the stack or paranoia debug checks (like whether a
 certain address is a valid stack address). So I think either including or
 excluding the guard pages is fine. Feel free to change that. I think all
 that has to be done is set `Thread::stack_base/stack_size` in
 `create_thread_user_stack()` accordingly, but the usage of the fields in
 the kernel should be checked to be sure.

-- 
Ticket URL: <http://dev.haiku-os.org/ticket/8233#comment:6>
Haiku <http://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: