mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8317866: replace NET_SocketAvailable
Reviewed-by: dfuchs, alanb
This commit is contained in:
parent
6d6c9008d5
commit
424de295a6
4 changed files with 7 additions and 30 deletions
|
@ -28,7 +28,6 @@
|
|||
#include <netinet/tcp.h> // defines TCP_NODELAY
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
#if defined(__linux__)
|
||||
|
@ -51,18 +50,6 @@
|
|||
#define IPV6_FLOWINFO_SEND 33
|
||||
#endif
|
||||
|
||||
#define RESTARTABLE(_cmd, _result) do { \
|
||||
do { \
|
||||
_result = _cmd; \
|
||||
} while((_result == -1) && (errno == EINTR)); \
|
||||
} while(0)
|
||||
|
||||
int NET_SocketAvailable(int s, int *pbytes) {
|
||||
int result;
|
||||
RESTARTABLE(ioctl(s, FIONREAD, pbytes), result);
|
||||
return result;
|
||||
}
|
||||
|
||||
void
|
||||
NET_ThrowByNameWithLastError(JNIEnv *env, const char *name,
|
||||
const char *defaultDetail) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue