loglevels: deal with fixup upon library load
[lttng-ust.git] / include / share.h
index f674f31f590719915398d56d464e7684b7ddaf14..19644f120c0b194b79224088da9f69389986c9fc 100644 (file)
@@ -1,34 +1,22 @@
-#ifndef UST_SHARE_H
-#define UST_SHARE_H
+#ifndef _LTTNG_SHARE_H
+#define _LTTNG_SHARE_H
 
-#include <unistd.h>
-#include <errno.h>
-
-/* This write is patient because it restarts if it was incomplete.
+/*
+ * Copyright (c) 2011 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ *
+ * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
+ * OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
+ *
+ * Permission is hereby granted to use or copy this program
+ * for any purpose,  provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
  */
 
-static inline ssize_t patient_write(int fd, const void *buf, size_t count)
-{
-       const char *bufc = (const char *) buf;
-       int result;
-
-       for(;;) {
-               result = write(fd, bufc, count);
-               if(result == -1 && errno == EINTR) {
-                       continue;
-               }
-               if(result <= 0) {
-                       return result;
-               }
-               count -= result;
-               bufc += result;
-
-               if(count == 0) {
-                       break;
-               }
-       }
+#include <stdlib.h>
 
-       return bufc-(const char *)buf;
-}
+ssize_t patient_write(int fd, const void *buf, size_t count);
+ssize_t patient_send(int fd, const void *buf, size_t count, int flags);
 
-#endif /* UST_SHARE_H */
+#endif /* _LTTNG_SHARE_H */
This page took 0.038045 seconds and 4 git commands to generate.