573 static void free_thread_local_storage(int index);
574
575 // General allocation (must be MT-safe)
576 static void* malloc (size_t size);
577 static void* realloc (void *memblock, size_t size);
578 static void free (void *memblock);
579 static bool check_heap(bool force = false); // verify C heap integrity
580 static char* strdup(const char *); // Like strdup
581
582 #ifndef PRODUCT
583 static julong num_mallocs; // # of calls to malloc/realloc
584 static julong alloc_bytes; // # of bytes allocated
585 static julong num_frees; // # of calls to free
586 static julong free_bytes; // # of bytes freed
587 #endif
588
589 // SocketInterface (ex HPI SocketInterface )
590 static int socket(int domain, int type, int protocol);
591 static int socket_close(int fd);
592 static int socket_shutdown(int fd, int howto);
593 static int recv(int fd, char* buf, size_t nBytes, uint flags);
594 static int send(int fd, char* buf, size_t nBytes, uint flags);
595 static int raw_send(int fd, char* buf, size_t nBytes, uint flags);
596 static int timeout(int fd, long timeout);
597 static int listen(int fd, int count);
598 static int connect(int fd, struct sockaddr* him, socklen_t len);
599 static int bind(int fd, struct sockaddr* him, socklen_t len);
600 static int accept(int fd, struct sockaddr* him, socklen_t* len);
601 static int recvfrom(int fd, char* buf, size_t nbytes, uint flags,
602 struct sockaddr* from, socklen_t* fromlen);
603 static int get_sock_name(int fd, struct sockaddr* him, socklen_t* len);
604 static int sendto(int fd, char* buf, size_t len, uint flags,
605 struct sockaddr* to, socklen_t tolen);
606 static int socket_available(int fd, jint* pbytes);
607
608 static int get_sock_opt(int fd, int level, int optname,
609 char* optval, socklen_t* optlen);
610 static int set_sock_opt(int fd, int level, int optname,
611 const char* optval, socklen_t optlen);
612 static int get_host_name(char* name, int namelen);
613
614 static struct hostent* get_host_by_name(char* name);
615
616 // Printing 64 bit integers
617 static const char* jlong_format_specifier();
618 static const char* julong_format_specifier();
619
620 // Support for signals (see JVM_RaiseSignal, JVM_RegisterSignal)
621 static void signal_init();
622 static void signal_init_pd();
623 static void signal_notify(int signal_number);
624 static void* signal(int signal_number, void* handler);
625 static void signal_raise(int signal_number);
626 static int signal_wait();
627 static int signal_lookup();
628 static void* user_handler();
629 static void terminate_signal_thread();
630 static int sigexitnum_pd();
631
|
573 static void free_thread_local_storage(int index);
574
575 // General allocation (must be MT-safe)
576 static void* malloc (size_t size);
577 static void* realloc (void *memblock, size_t size);
578 static void free (void *memblock);
579 static bool check_heap(bool force = false); // verify C heap integrity
580 static char* strdup(const char *); // Like strdup
581
582 #ifndef PRODUCT
583 static julong num_mallocs; // # of calls to malloc/realloc
584 static julong alloc_bytes; // # of bytes allocated
585 static julong num_frees; // # of calls to free
586 static julong free_bytes; // # of bytes freed
587 #endif
588
589 // SocketInterface (ex HPI SocketInterface )
590 static int socket(int domain, int type, int protocol);
591 static int socket_close(int fd);
592 static int socket_shutdown(int fd, int howto);
593 static int recv(int fd, char* buf, int nBytes, int flags);
594 static int send(int fd, char* buf, int nBytes, int flags);
595 static int raw_send(int fd, char* buf, int nBytes, int flags);
596 static int timeout(int fd, long timeout);
597 static int listen(int fd, int count);
598 static int connect(int fd, struct sockaddr* him, int len);
599 static int bind(int fd, struct sockaddr* him, int len);
600 static int accept(int fd, struct sockaddr* him, int* len);
601 static int recvfrom(int fd, char* buf, int nbytes, int flags,
602 struct sockaddr* from, int* fromlen);
603 static int get_sock_name(int fd, struct sockaddr* him, int* len);
604 static int sendto(int fd, char* buf, int len, int flags,
605 struct sockaddr* to, int tolen);
606 static int socket_available(int fd, jint* pbytes);
607
608 static int get_sock_opt(int fd, int level, int optname,
609 char* optval, int* optlen);
610 static int set_sock_opt(int fd, int level, int optname,
611 const char* optval, int optlen);
612 static int get_host_name(char* name, int namelen);
613
614 static struct hostent* get_host_by_name(char* name);
615
616 // Printing 64 bit integers
617 static const char* jlong_format_specifier();
618 static const char* julong_format_specifier();
619
620 // Support for signals (see JVM_RaiseSignal, JVM_RegisterSignal)
621 static void signal_init();
622 static void signal_init_pd();
623 static void signal_notify(int signal_number);
624 static void* signal(int signal_number, void* handler);
625 static void signal_raise(int signal_number);
626 static int signal_wait();
627 static int signal_lookup();
628 static void* user_handler();
629 static void terminate_signal_thread();
630 static int sigexitnum_pd();
631
|