Skip to content

Solaris 11/OpenIndiana building patch #35

Open
wants to merge 1 commit into from

2 participants

@troydm
troydm commented Feb 17, 2014

This patch makes core compile on Solaris 11/OpenIndiana, it's not the best way as it detects the platform by using __sun macro definition which is obviously present only on Solaris-based operating systems. However this can further be improved. I hope you'll find it useful and will take steps to implement support for this less popular platform

@avsm avsm commented on the diff Feb 17, 2014
lib/unix_stubs.c
@@ -555,6 +559,45 @@ CAMLprim value core_getpwent(value v_unit)
CAMLreturn(res);
}
+#if defined(__sun)
+
+#define LOCK_SH 1 /* shared lock */
+#define LOCK_EX 2 /* exclusive lock */
+#define LOCK_NB 4 /* don't block when locking */
+#define LOCK_UN 8 /* unlock */
+
+/* flock wrapper for solaris 11/openindiana by Jonathan Perkin */
@avsm
avsm added a note Feb 17, 2014

is this original code or from some other source that needs a license?

@troydm
troydm added a note Feb 17, 2014

it's taken from this blog post http://www.perkin.org.uk/posts/solaris-portability-flock.html I think we need to contact the author, but i don't think he wouldn't mind including it as he wishes for this code to be included in illumos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.