summaryrefslogtreecommitdiff
path: root/ext/socket/basicsocket.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-04-18 14:10:06 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-04-18 14:10:06 +0000
commit05a278b4cdc8456580e51055ccb89fe4d1cd46ed (patch)
treebe02312738c84536b2ab08ccadbbec3c031fff76 /ext/socket/basicsocket.c
parentbe2d3f5979f10cd06f6d1512ee367b2ec43ef315 (diff)
* ext/readline/readline.c: use rb_f_notimplement for methods not
implemented. * ext/openssl/ossl_engine.c: ditto. * ext/openssl/ossl_config.c: ditto. * ext/openssl/ossl_cipher.c: ditto. * ext/openssl/ossl_pkcs5.c: ditto. * ext/openssl/ossl_x509ext.c: ditto. * ext/socket/socket.c: ditto. * ext/socket/basicsocket.c: ditto. * ext/socket/ancdata.c: ditto. * ext/socket/unixsocket.c: ditto. * ext/iconv/iconv.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/socket/basicsocket.c')
-rw-r--r--ext/socket/basicsocket.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/ext/socket/basicsocket.c b/ext/socket/basicsocket.c
index 78e675c..4ffbd49 100644
--- a/ext/socket/basicsocket.c
+++ b/ext/socket/basicsocket.c
@@ -244,6 +244,7 @@ bsock_setsockopt(int argc, VALUE *argv, VALUE sock)
return INT2FIX(0);
}
+#if !defined(__BEOS__)
/*
* Document-method: getsockopt
* call-seq: getsockopt(level, optname)
@@ -287,7 +288,6 @@ bsock_setsockopt(int argc, VALUE *argv, VALUE sock)
static VALUE
bsock_getsockopt(VALUE sock, VALUE lev, VALUE optname)
{
-#if !defined(__BEOS__)
int level, option;
socklen_t len;
char *buf;
@@ -307,10 +307,10 @@ bsock_getsockopt(VALUE sock, VALUE lev, VALUE optname)
rb_sys_fail_path(fptr->pathv);
return rsock_sockopt_new(family, level, option, rb_str_new(buf, len));
+}
#else
- rb_notimplement();
+#define bsock_getsockopt rb_f_notimplement
#endif
-}
/*
* call-seq:
@@ -361,6 +361,7 @@ bsock_getpeername(VALUE sock)
return rb_str_new((char*)&buf, len);
}
+#if defined(HAVE_GETPEEREID) || defined(SO_PEERCRED) || defined(HAVE_GETPEERUCRED)
/*
* call-seq:
* basicsocket.getpeereid => [euid, egid]
@@ -412,10 +413,11 @@ bsock_getpeereid(VALUE self)
ret = rb_assoc_new(UIDT2NUM(ucred_geteuid(uc)), GIDT2NUM(ucred_getegid(uc)));
ucred_free(uc);
return ret;
-#else
- rb_notimplement();
#endif
}
+#else
+#define bsock_getpeereid rb_f_notimplement
+#endif
/*
* call-seq: