Lines Matching defs:fd

81 #define SET_NONBLOCKING(fd) {           \
82 int flags = fcntl(fd, F_GETFL); \
84 fcntl(fd, F_SETFL, flags); \
87 #define SET_BLOCKING(fd) { \
88 int flags = fcntl(fd, F_GETFL); \
90 fcntl(fd, F_SETFL, flags); \
95 * which we shutdown but do not close the fd. The result is an fd that
111 * Finally shutdown sv[0] (any reads to this fd will get
140 psi_fdID = (*env)->GetFieldID(env, cls , "fd",
165 /* Create the marker fd used for dup2 */
184 int fd;
201 (*env)->ThrowNew(env, socketExceptionCls, "null fd object");
205 if ((fd = JVM_Socket(domain, type, 0)) == JVM_IO_ERR) {
218 if (setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, (char*)&arg,
221 close(fd);
234 SET_NONBLOCKING(fd);
235 if (JVM_SetSockOpt(fd, SOL_SOCKET, SO_REUSEADDR, (char*)&arg,
238 close(fd);
243 (*env)->SetIntField(env, fdObj, IO_fd_fdID, fd);
271 /* fd is an int field on iaObj */
272 jint fd;
282 fd = (*env)->GetIntField(env, fdObj, IO_fd_fdID);
301 connect_rv = NET_Connect(fd, (struct sockaddr *)&him, len);
312 pfd.fd = fd;
322 FD_SET(fd, &wr);
324 FD_SET(fd, &ex);
326 connect_rv = NET_Select(fd+1, 0, &wr, &ex, 0);
341 if (JVM_GetSockOpt(fd, SOL_SOCKET, SO_ERROR,
362 SET_NONBLOCKING(fd);
365 connect_rv = connect(fd, (struct sockaddr *)&him, len);
375 SET_BLOCKING(fd);
390 pfd.fd = fd;
405 FD_SET(fd, &wr);
407 FD_SET(fd, &ex);
410 connect_rv = NET_Select(fd+1, 0, &wr, &ex, &t);
445 SET_BLOCKING(fd);
446 JVM_SocketShutdown(fd, 2);
452 if (JVM_GetSockOpt(fd, SOL_SOCKET, SO_ERROR, (void*)&connect_rv,
459 SET_BLOCKING(fd);
517 (*env)->SetIntField(env, fdObj, IO_fd_fdID, fd);
533 if (JVM_GetSockName(fd, (struct sockaddr *)&him, &len) == -1) {
554 /* fd is an int field on fdObj */
555 int fd;
564 fd = (*env)->GetIntField(env, fdObj, IO_fd_fdID);
577 if (NET_Bind(fd, (struct sockaddr *)&him, len) < 0) {
597 if (JVM_GetSockName(fd, (struct sockaddr *)&him, &len) == -1) {
618 /* this FileDescriptor fd field */
620 /* fdObj's int fd field */
621 int fd;
628 fd = (*env)->GetIntField(env, fdObj, IO_fd_fdID);
638 if (JVM_Listen(fd, count) == JVM_IO_ERR) {
664 /* the ServerSocket fd int field on fdObj */
665 jint fd;
667 /* accepted fd */
680 fd = (*env)->GetIntField(env, fdObj, IO_fd_fdID);
707 ret = NET_Timeout(fd, -1);
709 ret = NET_Timeout(fd, timeout);
729 newfd = NET_Accept(fd, (struct sockaddr *)&him, (jint*)&len);
784 * Populate SocketImpl.fd.fd
807 jint fd;
814 fd = (*env)->GetIntField(env, fdObj, IO_fd_fdID);
817 if (!JVM_SocketAvailable(fd, &ret)){
838 jint fd;
845 fd = (*env)->GetIntField(env, fdObj, IO_fd_fdID);
847 if (fd != -1) {
849 NET_Dup2(marker_fd, fd);
852 NET_SocketClose(fd);
868 jint fd;
871 * WARNING: THIS NEEDS LOCKING. ALSO: SHOULD WE CHECK for fd being
879 fd = (*env)->GetIntField(env, fdObj, IO_fd_fdID);
881 JVM_SocketShutdown(fd, howto);
894 int fd;
904 fd = getFD(env, this);
905 if (fd < 0) {
965 if (NET_SetSockOpt(fd, level, optname, (const void *)&optval, optlen) < 0) {
990 int fd;
1000 fd = getFD(env, this);
1001 if (fd < 0) {
1020 if (getsockname(fd, (struct sockaddr *)&him, &len) < 0) {
1053 if (NET_GetSockOpt(fd, level, optname, (void *)&optval, &optlen) < 0) {
1082 /* The fd field */
1084 int n, fd;
1091 fd = (*env)->GetIntField(env, fdObj, IO_fd_fdID);
1095 if (fd == -1) {
1101 n = JVM_Send(fd, (char *)&d, 1, MSG_OOB);