2012-04-01から1ヶ月間の記事一覧

os::signal_init()

- //Linux版(jdk7/hotspot/src/share/vm/runtime/os.cpp) void os::signal_init() { if (!ReduceSignalUsage) { // Setup JavaThread for processing signals EXCEPTION_MARK; klassOop k = SystemDictionary::resolve_or_fail(vmSymbols::java_lang_Thread(…

os::signal_init_pd()

- //Linux版(jdk7/hotspot/src/share/vm/runtime/os.cpp) void os::signal_init_pd() { // Initialize signal structures ::memset((void*)pending_signals, 0, sizeof(pending_signals)); // Initialize signal semaphore ::sem_init(&sig_sem, 0, 0); }

os::is_headless_jre()

- //Linux版(jdk7/hotspot/src/os/linux/vm/os_linux.cpp) // is_headless_jre() // // Test for the existence of libmawt in motif21 or xawt directories // in order to report if we are running in a headless jre // bool os::is_headless_jre() { st…

os::print_jni_name_prefix_on(outputStream* st, int args_size)

- //Linux版(jdk7/hotspot/src/os/linux/vm/os_linux.cpp) void os::print_jni_name_prefix_on(outputStream* st, int args_size) { // no prefix required, not even "_" }

os::print_jni_name_suffix_on(outputStream* st, int args_size)

- //Linux版(jdk7/hotspot/src/os/linux/vm/os_linux.cpp) void os::print_jni_name_suffix_on(outputStream* st, int args_size) { // no suffix required }

os::file_separator()

- //Linux版(jdk7/hotspot/src/os/linux/vm/os_linux.inline.hpp) inline const char* os::file_separator() { return "/"; }

os::line_separator()

- //Linux版(jdk7/hotspot/src/os/linux/vm/os_linux.inline.hpp) inline const char* os::line_separator() { return "\n"; }

os::path_separator()

- //Linux版(jdk7/hotspot/src/os/linux/vm/os_linux.inline.hpp) inline const char* os::path_separator() { return ":"; }

os::jlong_format_specifier()

- //Linux版(jdk7/hotspot/src/os/linux/vm/os_linux.inline.hpp) inline const char* os::jlong_format_specifier() { return "%lld"; }

os::julong_format_specifier()

- //Linux版(jdk7/hotspot/src/os/linux/vm/os_linux.inline.hpp) inline const char* os::julong_format_specifier() { return "%llu"; }

os::init_system_properties_values()

- //Linux版(jdk7/hotspot/src/os/linux/vm/os_linux.cpp) void os::init_system_properties_values() { // char arch[12]; // sysinfo(SI_ARCHITECTURE, arch, sizeof(arch)); // The next steps are taken in the product version: // // Obtain the JAVA_…

os::stat(const char *path, struct stat *sbuf)

- //Linux版(jdk7/hotspot/src/os/linux/vm/os_linux.cpp) int os::stat(const char *path, struct stat *sbuf) { char pathbuf[MAX_PATH]; if (strlen(path) > MAX_PATH - 1) { errno = ENAMETOOLONG; return -1; } os::native_path(strcpy(pathbuf, path))…

os::dir_is_empty(const char* path)

- //Linux版(jdk7/hotspot/src/os/linux/vm/os_linux.cpp) // Is a (classpath) directory empty? bool os::dir_is_empty(const char* path) { DIR *dir = NULL; struct dirent *ptr; dir = opendir(path); if (dir == NULL) return true; /* Scan the direc…

os::create_binary_file(const char* path, bool rewrite_existing)

- //Linux版(jdk7/hotspot/src/os/linux/vm/os_linux.cpp) // create binary file, rewriting existing file if required int os::create_binary_file(const char* path, bool rewrite_existing) { int oflags = O_WRONLY | O_CREAT; if (!rewrite_existing)…

os::current_file_offset(int fd)

- //Linux版(jdk7/hotspot/src/os/linux/vm/os_linux.cpp) // return current position of file pointer jlong os::current_file_offset(int fd) { return (jlong)::lseek64(fd, (off64_t)0, SEEK_CUR); }

os::seek_to_file_offset(int fd, jlong offset)

- //Linux版(jdk7/hotspot/src/os/linux/vm/os_linux.cpp) // move file pointer to the specified offset jlong os::seek_to_file_offset(int fd, jlong offset) { return (jlong)::lseek64(fd, (off64_t)offset, SEEK_SET); }

os::allocate_thread_local_storage()

- //Linux版(jdk7/hotspot/src/os/linux/vm/os_linux.cpp) int os::allocate_thread_local_storage() { pthread_key_t key; int rslt = pthread_key_create(&key, NULL); assert(rslt == 0, "cannot allocate thread local storage"); return (int)key; }

os::thread_local_storage_at_put(int index, void* value)

- //Linux版(jdk7/hotspot/src/os/linux/vm/os_linux.cpp) void os::thread_local_storage_at_put(int index, void* value) { int rslt = pthread_setspecific((pthread_key_t)index, value); assert(rslt == 0, "pthread_setspecific failed"); }

os::free_thread_local_storage(int index)

- //Linux版(jdk7/hotspot/src/os/linux/vm/os_linux.cpp) // Note: This is currently not used by VM, as we don't destroy TLS key // on VM exit. void os::free_thread_local_storage(int index) { int rslt = pthread_key_delete((pthread_key_t)index…

os::thread_local_storage_at(int index)

- //Linux版(jdk7/hotspot/src/os/linux/vm/os_linux.inline.hpp) inline void* os::thread_local_storage_at(int index) { return pthread_getspecific((pthread_key_t)index); }

os::check_heap(bool force)

- //Linux版(jdk7/hotspot/src/os/linux/vm/os_linux.cpp) bool os::check_heap(bool force) { return true; }

os::strdup(const char *str)

- //Linux版(jdk7/hotspot/src/share/vm/runtime/os.cpp) char *os::strdup(const char *str) { size_t size = strlen(str); char *dup_str = (char *)malloc(size + 1); if (dup_str == NULL) return NULL; strcpy(dup_str, str); return dup_str; }

os::socket(int domain, int type, int protocol)

- //Linux版(jdk7/hotspot/src/os/linux/vm/os_linux.inline.hpp) inline int os::socket(int domain, int type, int protocol) { return ::socket(domain, type, protocol); }

os::socket_close(int fd)

- //Linux版(jdk7/hotspot/src/os/linux/vm/os_linux.inline.hpp) inline int os::socket_close(int fd) { return ::close(fd); }

os::socket_shutdown(int fd, int howto)

- //Linux版(jdk7/hotspot/src/os/linux/vm/os_linux.inline.hpp) inline int os::socket_shutdown(int fd, int howto){ return ::shutdown(fd, howto); }

os::recv(int fd, char *buf, int nBytes, int flags)

- //Linux版(jdk7/hotspot/src/os/linux/vm/os_linux.inline.hpp) inline int os::recv(int fd, char *buf, int nBytes, int flags) { RESTARTABLE_RETURN_INT(::recv(fd, buf, nBytes, (unsigned int) flags)); }

os::send(int fd, char *buf, int nBytes, int flags)

- //Linux版(jdk7/hotspot/src/os/linux/vm/os_linux.inline.hpp) inline int os::send(int fd, char *buf, int nBytes, int flags) { RESTARTABLE_RETURN_INT(::send(fd, buf, nBytes, (unsigned int) flags)); }

os::raw_send(int fd, char *buf, int nBytes, int flags)

- //Linux版(jdk7/hotspot/src/os/linux/vm/os_linux.inline.hpp) inline int os::raw_send(int fd, char *buf, int nBytes, int flags) { return os::send(fd, buf, nBytes, flags); }

os::timeout(int fd, long timeout)

- //Linux版(jdk7/hotspot/src/os/linux/vm/os_linux.inline.hpp) inline int os::timeout(int fd, long timeout) { julong prevtime,newtime; struct timeval t; gettimeofday(&t, NULL); prevtime = ((julong)t.tv_sec * 1000) + t.tv_usec / 1000; for(;;…

os::listen(int fd, int count)

- //Linux版(jdk7/hotspot/src/os/linux/vm/os_linux.inline.hpp) inline int os::listen(int fd, int count) { return ::listen(fd, count); }