summaryrefslogtreecommitdiff
path: root/network_io/os2
diff options
context:
space:
mode:
authorWilliam A. Rowe Jr <wrowe@apache.org>2003-10-14 23:47:29 +0000
committerWilliam A. Rowe Jr <wrowe@apache.org>2003-10-14 23:47:29 +0000
commit0a04723a23712ae192cb7d033d16ee0b73b47a12 (patch)
treeb8f4d4eaf3af94c8723aca707920d80f0091e843 /network_io/os2
parentdccac0f37e095ff37973cf17241b96481205e2ce (diff)
downloadapr-0a04723a23712ae192cb7d033d16ee0b73b47a12.tar.gz
Implement apr_socket_atmark, similar to socket_atmark except 1) it's
portable, and 2) the return value is passed by a boolean (int) ref, with errors returned as an apr_status_t. The question is, how portable? sys/sockio.h seems sufficent for me on hp/ux, solaris, linux, osx, and this works on Win32. The Netware and OS2 implementations are best guesses. Submitted by: Jim Jagielski and William Rowe git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64684 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'network_io/os2')
-rw-r--r--network_io/os2/sockopt.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/network_io/os2/sockopt.c b/network_io/os2/sockopt.c
index 70bb4c078..0b11f202d 100644
--- a/network_io/os2/sockopt.c
+++ b/network_io/os2/sockopt.c
@@ -156,6 +156,19 @@ APR_DECLARE(apr_status_t) apr_socket_opt_get(apr_socket_t *sock,
}
+APR_DECLARE(apr_status_t) apr_socket_atmark(apr_socket_t *sock, int *atmark)
+{
+ int oobmark;
+
+ if (ioctl(sock->socketdes, SIOCATMARK, (void*) &oobmark) < 0)
+ return APR_OS2_STATUS(sock_errno());;
+
+ *atmark = (oobmark != 0);
+
+ return APR_SUCCESS;
+}
+
+
APR_DECLARE(apr_status_t) apr_gethostname(char *buf, apr_int32_t len,
apr_pool_t *cont)
{