New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hp-ux port #409
hp-ux port #409
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you so much! it looks great!
I've made few inline very nitpicky comments.
Let me know if you can update this request, otherwise we'll gladly do so and amend the commit
|
||
#ifdef MAX | ||
#undef MAX | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel this is a bit unfortunate. we should probably rename the macros below instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @bjori
I can update this PR.
I will try to rename, but it comes from HP system header, and probably no luck with it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code below this macro - define that macro as
#define MAX "max" - so gcc warn about macro redefinition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry, yeah. I mean, we should rename our MAX macro there to something else.
MAX and MIN are quite common macros which we shouldn't be imposing on.
we should probably rename our macros to MAX_STRING, and MAX_STRING_LEN maybe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, that should be reasonable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -38,6 +38,12 @@ | |||
# include <sys/un.h> | |||
#endif | |||
|
|||
#ifdef __hpux__ | |||
typedef int mongoc_socklen_t; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should probably move this to autoconf check, I can imagine more unixes not having socklen_t
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
may be that right.
I not familiar with autoconf, may be you do that in right way (to define HAVE_XXX),
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will do ! leave it as is then, its fine :)
@@ -487,7 +487,7 @@ mongoc_socket_accept_ex (mongoc_socket_t *sock, /* IN */ | |||
int | |||
mongoc_socket_bind (mongoc_socket_t *sock, /* IN */ | |||
const struct sockaddr *addr, /* IN */ | |||
socklen_t addrlen) /* IN */ | |||
mongoc_socklen_t addrlen) /* IN */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here, and everywhere else, the argument should be aligned in a pretty ascii art with the argument above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, i will do allign it now.
@@ -48,6 +51,12 @@ _mongoc_get_cpu_count (void) | |||
{ | |||
#if defined(__linux__) | |||
return get_nprocs (); | |||
#elif defined(__hpux__) | |||
struct pst_dynamic psd; | |||
if (pstat_getdynamic (&psd, sizeof (psd), (size_t) 1, 0) != -1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
our coding standard requires braces, even for onelines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, undestand
@@ -333,7 +333,7 @@ _mongoc_socket_capture_errno (mongoc_socket_t *sock) /* IN */ | |||
#else | |||
sock->errno_ = errno; | |||
#endif | |||
TRACE("setting errno: %d", sock->errno_); | |||
TRACE("setting errno: %d %s", sock->errno_, strerror(sock->errno_)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense :D
now amend this commit with update allignment of variables and add braces to conform coding standart. |
note, this PR requires libbson PR |
Sorry to leave you in the dark on this. |
HPUX 11.31 (11i v3) to bootstrap gcc-4.8.5 on HPUX use this link https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64919 |
I've created https://jira.mongodb.org/browse/CDRIVER-1973 so we can keep track of this patch when we prepare for our next release. |
cool news! I see some conflicts in this branch. But now I'm at vacation now (to 12 January) , so not possible to help to resolve it. But as most of it - is a indentation and type replacement. That is not hard to change. |
Don't worry about the conflict, they are caused by our coding standard consistency commit in |
Hello @bjori ! Everithing works, tests pass, but small fixes need:
(see http://nixdoc.net/man-pages/HP-UX/man2/connect.2.html for more information) |
The above code will blindly ignore socklen_t and always pass I don't really think this matters much as the value of addrlen is never going to be so large for this to matter. Matching the strict prototype though would avoid a possible compiler warning. As for the VERSION files -- I'm very curious, I couldn't see any such issues when I was building on HPUX the other day. Could you file a ticket for the issue at https://jira.mongodb.org/browse/CDRIVER ? |
HPUX have several implementation of sockets. With case of connect() call - conversion things happens
More detail in https://curl.haxx.se/mail/lib-2009-04/0287.html |
Hello!
Following patch allows the mongo-c driver to work on HP-UX 11.31 ia64 platform.
Note: to work, with this patch, we need a patch to libbson, that PR-ed just now (mongodb/libbson#179).
To compile on HPUX we need:
configure opts: --enable-shm-counters=no -sinse it not ported yet