summaryrefslogtreecommitdiff
path: root/network_io/unix/sockopt.c
diff options
context:
space:
mode:
Diffstat (limited to 'network_io/unix/sockopt.c')
-rw-r--r--network_io/unix/sockopt.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c
index c346678cb..26de90c17 100644
--- a/network_io/unix/sockopt.c
+++ b/network_io/unix/sockopt.c
@@ -55,6 +55,7 @@
#include "apr_arch_networkio.h"
#include "apr_strings.h"
+
static apr_status_t soblock(int sd)
{
/* BeOS uses setsockopt at present for non blocking... */
@@ -369,6 +370,27 @@ apr_status_t apr_socket_opt_get(apr_socket_t *sock,
}
+apr_status_t apr_socket_atmark(apr_socket_t *sock, int *atmark)
+{
+/* In 1.0 we rely on compile failure to assure all platforms grabbed
+ * the correct header file support for SIOCATMARK, but we don't want
+ * to fail the build of 0.9. Keep things good for the released branch.
+ */
+#ifdef SIOCATMARK
+ int oobmark;
+
+ if (ioctl(sock->socketdes, SIOCATMARK, (void*) &oobmark) < 0)
+ return apr_get_netos_error();
+
+ *atmark = (oobmark != 0);
+
+ return APR_SUCCESS;
+#else
+ return APR_ENOTIMPL;
+#endif
+}
+
+
/* deprecated */
apr_status_t apr_setsocketopt(apr_socket_t *sock,
apr_int32_t opt, apr_int32_t on)