} else {
ASSERT(FileIO_IsValid(&tokenPtr->u.mandatory.lockFd));
- if (FileIO_CloseAndUnlink(&tokenPtr->u.mandatory.lockFd)) {
- /*
- * Should succeed, but there is an unavoidable race:
- * close() must preceed unlink(), but another locker could acquire
- * lock between close() and unlink(). Solution: treat EBUSY as
- * success.
- */
- if (Err_Errno() == EBUSY) {
- LOG(0, ("Tolerating EBUSY on unlink of advisory lock at %s\n",
- UTF8(tokenPtr->pathName)));
- } else {
- err = Err_Errno();
- }
+ if (FileIO_CloseAndUnlink(&tokenPtr->u.mandatory.lockFd)) {
+ /*
+ * Should succeed, but there is an unavoidable race:
+ * close() must preceed unlink(), but another thread could touch
+ * the file between close() and unlink(). We only worry about other
+ * FileLock-like manipulations; the advisory lock file should not
+ * experience any name collisions. Treat races as success.
+ * Specific errors:
+ * EBUSY: other locked file
+ * ENOENT: other locked + unlocked (w/ implicit unlink) file
+ */
+ if (Err_Errno() == EBUSY || Err_Errno() == ENOENT) {
+ LOG(0, ("Tolerating %s on unlink of advisory lock at %s\n",
+ Err_Errno() == EBUSY ? "EBUSY" : "ENOENT",
+ UTF8(tokenPtr->pathName)));
+ } else {
+ err = Err_Errno();
+ if (vmx86_debug) {
+ Log(LGPFX" %s failed for advisory lock '%s': %s\n", __FUNCTION__,
+ UTF8(tokenPtr->pathName), strerror(err));
+ }
+ }
}
}
} TimeUtil_Expiration;
-time_t TimeUtil_MakeTime(const TimeUtil_Date *d);
+time_t TimeUtil_MakeTime(const TimeUtil_Date *d); // IN
Bool TimeUtil_StringToDate(TimeUtil_Date *d, // IN/OUT
char const *date); // IN: 'YYYYMMDD' or 'YYYY/MM/DD' or 'YYYY-MM-DD'
int TimeUtil_GetLocalWindowsTimeZoneIndexAndName(char **ptzName);
+time_t TimeUtil_SecondsSinceEpoch(TimeUtil_Date *d); // IN
+
#endif // _TIMEUTIL_H_
#define HOSTD_VERSION "e.x.p"
#define RECOVERYLIBS_VERSION "2.0.0"
#define PRECHECK_VERSION "e.x.p"
+#define VIEW_FEATUREPACK_VERSION "5.2.0"
#ifndef MAKESTR
* a parameter that no longer match the content of the dormant license
* file.
*/
-#define PRODUCT_MAC_DESKTOP_VERSION_STRING_FOR_LICENSE "5.0"
+#define PRODUCT_MAC_DESKTOP_VERSION_STRING_FOR_LICENSE "6.0"
#if defined(VMX86_TOOLS)
/* This product doesn't use a license */
Unicode W32Util_GetVmwareCommonAppDataFilePath(ConstUnicode fileName);
Unicode W32Util_GetMyDocumentPath(void);
-Unicode W32Util_GetMyVideoPath(BOOL myDocumentsOnFail);
Unicode W32Util_GetDefaultVMPath(ConstUnicode pref);
Unicode W32Util_GetInstalledFilePath(ConstUnicode fileName);
#include "safetime.h"
#include "unicode.h"
+#include <stdio.h>
#if defined(_WIN32)
# include <wtypes.h>
* while the time will be left unmodified.
* The string 'date' needs to be in the format of 'YYYYMMDD' or
* 'YYYY/MM/DD' or 'YYYY-MM-DD'.
- * Unsuccesful initialization will leave the 'd' argument unmodified.
+ * Unsuccessful initialization will leave the 'd' argument unmodified.
*
* Results:
* TRUE or FALSE.
return timeZoneIndex;
}
#endif // _WIN32
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TimeUtil_SecondsSinceEpoch --
+ *
+ * Converts a date into the the number of seconds since the unix epoch in UTC.
+ *
+ * Parameters:
+ * date to be converted.
+ *
+ * Results:
+ * Returns the numbers of seconds since the unix epoch.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+time_t
+TimeUtil_SecondsSinceEpoch(TimeUtil_Date *d) // IN
+{
+ const int DAY_IN_SECONDS = 60*60*24;
+ struct tm tmval1970 = {0};
+ struct tm tmval = {0};
+
+ /*
+ * We can't handle negative time.
+ */
+ if (d->year < 1970) {
+ ASSERT(0);
+ return -1;
+ }
+
+ /*
+ * Get the localtime for Jan 2nd 1970. We need to get the 2nd because
+ * if we are in a timezone that is + UTC then mktime will return -1
+ * for Jan 1st.
+ */
+ tmval1970.tm_year= 1970 - 1900;
+ tmval1970.tm_mon = 0;
+ tmval1970.tm_mday = 2;
+
+ tmval.tm_year = d->year - 1900;
+ tmval.tm_mon = d->month - 1;
+ tmval.tm_mday = d->day;
+ tmval.tm_hour = d->hour;
+ tmval.tm_min = d->minute;
+ tmval.tm_sec = d->second;
+
+ /*
+ * Add back in the day.
+ */
+ return mktime(&tmval) - mktime(&tmval1970) + DAY_IN_SECONDS;
+}
#define VMNET_CAP_RESTART_NEG CONST64U(0x400000000000) /* Ability to restart negotiation of link speed/duplexity */
#define VMNET_CAP_LRO CONST64U(0x800000000000) /* Hardware supported LRO */
#define VMNET_CAP_OFFLOAD_ALIGN_ANY CONST64U(0x1000000000000) /* Nic requires no header alignment */
+#define VMNET_CAP_GENERIC_OFFLOAD CONST64U(0x2000000000000) /* Generic hardware offloading (eg. vxlan encap offload and offset based offload) */
#define VMNET_CAP_LEGACY CONST64U(0x8000000000000000) /* Uplink is compatible with vmklinux drivers */
#endif // _VMNET_DEF_H_
/* completion descriptor types */
#define VMXNET3_CDTYPE_TXCOMP 0 /* Tx Completion Descriptor */
#define VMXNET3_CDTYPE_RXCOMP 3 /* Rx Completion Descriptor */
+#define VMXNET3_CDTYPE_RXCOMP_LRO 4 /* Rx Completion Descriptor for LRO */
#define VMXNET3_GOS_BITS_UNK 0 /* unknown */
#define VMXNET3_GOS_BITS_32 1