17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef OS_BSD_VM_OS_BSD_INLINE_HPP
26 #define OS_BSD_VM_OS_BSD_INLINE_HPP
27
28 #include "runtime/os.hpp"
29
30 // System includes
31
32 #include <unistd.h>
33 #include <sys/socket.h>
34 #include <poll.h>
35 #include <netdb.h>
36
37 // File names are case-insensitive on windows only
38 inline int os::file_name_strncmp(const char* s1, const char* s2, size_t num) {
39 return strncmp(s1, s2, num);
40 }
41
42 inline bool os::uses_stack_guard_pages() {
43 return true;
44 }
45
46 inline bool os::must_commit_stack_guard_pages() {
47 assert(uses_stack_guard_pages(), "sanity check");
48 #if !defined(__FreeBSD__) || __FreeBSD__ < 5
49 // Since FreeBSD 4 uses malloc() for allocating the thread stack
50 // there is no need to do anything extra to allocate the guard pages
51 return false;
52 #else
53 // FreeBSD 5+ uses mmap MAP_STACK for allocating the thread stacks.
54 // Must 'allocate' them or guard pages are ignored.
55 return true;
56 #endif
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef OS_BSD_VM_OS_BSD_INLINE_HPP
26 #define OS_BSD_VM_OS_BSD_INLINE_HPP
27
28 #include "runtime/os.hpp"
29
30 // System includes
31
32 #include <unistd.h>
33 #include <sys/socket.h>
34 #include <poll.h>
35 #include <netdb.h>
36
37 // Use threadsafe version of strtok
38 inline char* os::strtok(char *str, const char *delim, char **saveptr) {
39 return strtok_r(str, delim, saveptr);
40 }
41
42 // File names are case-insensitive on windows only
43 inline int os::file_name_strncmp(const char* s1, const char* s2, size_t num) {
44 return strncmp(s1, s2, num);
45 }
46
47 inline bool os::uses_stack_guard_pages() {
48 return true;
49 }
50
51 inline bool os::must_commit_stack_guard_pages() {
52 assert(uses_stack_guard_pages(), "sanity check");
53 #if !defined(__FreeBSD__) || __FreeBSD__ < 5
54 // Since FreeBSD 4 uses malloc() for allocating the thread stack
55 // there is no need to do anything extra to allocate the guard pages
56 return false;
57 #else
58 // FreeBSD 5+ uses mmap MAP_STACK for allocating the thread stacks.
59 // Must 'allocate' them or guard pages are ignored.
60 return true;
61 #endif
|