return ret;
}
+/**
+ * Set a file descriptor to blocking mode.
+ *
+ * \param fd The file descriptor.
+ *
+ * \return Standard.
+ */
+int mark_fd_blocking(int fd)
+{
+ int flags = fcntl(fd, F_GETFL);
+ if (flags < 0)
+ return -ERRNO_TO_PARA_ERROR(errno);
+ flags = fcntl(fd, F_SETFL, ((long)flags) & ~O_NONBLOCK);
+ if (flags < 0)
+ return -ERRNO_TO_PARA_ERROR(errno);
+ return 1;
+}
+
/**
* Set a file descriptor to non-blocking mode.
*
*
* \return Standard.
*/
-int mark_fd_nonblock(int fd)
+int mark_fd_nonblocking(int fd)
{
int flags = fcntl(fd, F_GETFL);
if (flags < 0)