mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-17 17:44:40 +02:00
8260264: Move common os_<unix> inline methods to a common posix source file
Reviewed-by: iklam, dholmes, coleenp, stuefe
This commit is contained in:
parent
288a4fed3f
commit
189b65b2ca
4 changed files with 60 additions and 194 deletions
|
@ -28,13 +28,6 @@
|
|||
#include "runtime/os.hpp"
|
||||
#include "os_posix.inline.hpp"
|
||||
|
||||
// System includes
|
||||
|
||||
#include <unistd.h>
|
||||
#include <sys/socket.h>
|
||||
#include <poll.h>
|
||||
#include <netdb.h>
|
||||
|
||||
inline bool os::uses_stack_guard_pages() {
|
||||
return true;
|
||||
}
|
||||
|
@ -48,61 +41,4 @@ inline bool os::must_commit_stack_guard_pages() {
|
|||
inline void os::map_stack_shadow_pages(address sp) {
|
||||
}
|
||||
|
||||
inline void os::dll_unload(void *lib) {
|
||||
::dlclose(lib);
|
||||
}
|
||||
|
||||
inline jlong os::lseek(int fd, jlong offset, int whence) {
|
||||
return (jlong) ::lseek64(fd, offset, whence);
|
||||
}
|
||||
|
||||
inline int os::fsync(int fd) {
|
||||
return ::fsync(fd);
|
||||
}
|
||||
|
||||
inline int os::ftruncate(int fd, jlong length) {
|
||||
return ::ftruncate64(fd, length);
|
||||
}
|
||||
|
||||
inline bool os::numa_has_static_binding() { return true; }
|
||||
inline bool os::numa_has_group_homing() { return false; }
|
||||
|
||||
inline size_t os::write(int fd, const void *buf, unsigned int nBytes) {
|
||||
size_t res;
|
||||
RESTARTABLE((size_t) ::write(fd, buf, (size_t) nBytes), res);
|
||||
return res;
|
||||
}
|
||||
|
||||
inline int os::socket_close(int fd) {
|
||||
return ::close(fd);
|
||||
}
|
||||
|
||||
inline int os::socket(int domain, int type, int protocol) {
|
||||
return ::socket(domain, type, protocol);
|
||||
}
|
||||
|
||||
inline int os::recv(int fd, char* buf, size_t nBytes, uint flags) {
|
||||
RESTARTABLE_RETURN_INT(::recv(fd, buf, nBytes, flags));
|
||||
}
|
||||
|
||||
inline int os::send(int fd, char* buf, size_t nBytes, uint flags) {
|
||||
RESTARTABLE_RETURN_INT(::send(fd, buf, nBytes, flags));
|
||||
}
|
||||
|
||||
inline int os::raw_send(int fd, char* buf, size_t nBytes, uint flags) {
|
||||
return os::send(fd, buf, nBytes, flags);
|
||||
}
|
||||
|
||||
inline int os::connect(int fd, struct sockaddr* him, socklen_t len) {
|
||||
RESTARTABLE_RETURN_INT(::connect(fd, him, len));
|
||||
}
|
||||
|
||||
inline struct hostent* os::get_host_by_name(char* name) {
|
||||
return ::gethostbyname(name);
|
||||
}
|
||||
|
||||
inline void os::exit(int num) {
|
||||
::exit(num);
|
||||
}
|
||||
|
||||
#endif // OS_LINUX_OS_LINUX_INLINE_HPP
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue