Re: [PATCH] Add Windows ctime_r implementation and empty ioctl.h header

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 5/7/2015 10:59 AM, Jens Axboe wrote:
Added. Side note - your email consistently ends up in my gmail spam, for some reason...

Ugh, it's because DMARC doesn't work through mailing lists without jumping through hoops. I'll see if I can disable it for specified destinations.


What are the linker errors? I'm guessing you need to check and add your OS dependencies to T_OBJS in the Makefile, when targetos is Windows.

Got it - I'd forgotten that the Makefile is still checked in and it's not generated by the configure script! I've attached a patch which should make the build work a lot better on Windows.

--
Bruce
>From 4a6ef95b40558b215c113a0260b891b36f376f83 Mon Sep 17 00:00:00 2001
From: Bruce Cran <bruce.cran@xxxxxxxxx>
Date: Thu, 7 May 2015 14:56:58 -0600
Subject: [PATCH] Fix compiler warning and test progs linker errors on Windows

Add prototype for ctime_r to os-windows.h to avoid compiler warning.
Link in os/windows/posix.o and lib/hweight.o to allow test progs to
build on Windows.
---
 Makefile        | 6 ++++++
 os/os-windows.h | 1 +
 2 files changed, 7 insertions(+)

diff --git a/Makefile b/Makefile
index 1b312cb..d9aedf5 100644
--- a/Makefile
+++ b/Makefile
@@ -218,6 +218,12 @@ T_OBJS += $(T_LFSR_TEST_OBJS)
 T_OBJS += $(T_BTRACE_FIO_OBJS)
 T_OBJS += $(T_DEDUPE_OBJS)
 
+ifneq (,$(findstring CYGWIN,$(CONFIG_TARGET_OS)))
+    T_DEDUPE_OBJS += os/windows/posix.o lib/hweight.o
+    T_SMALLOC_OBJS += os/windows/posix.o lib/hweight.o
+    T_LFSR_TEST_OBJS += os/windows/posix.o lib/hweight.o
+endif
+
 T_TEST_PROGS = $(T_SMALLOC_PROGS)
 T_TEST_PROGS += $(T_IEEE_PROGS)
 T_PROGS += $(T_ZIPF_PROGS)
diff --git a/os/os-windows.h b/os/os-windows.h
index 6603635..9e931c9 100644
--- a/os/os-windows.h
+++ b/os/os-windows.h
@@ -105,6 +105,7 @@ int fcntl(int fildes, int cmd, ...);
 int fdatasync(int fildes);
 int lstat(const char * path, struct stat * buf);
 uid_t geteuid(void);
+char* ctime_r(const time_t *t, char *buf);
 int nanosleep(const struct timespec *rqtp, struct timespec *rmtp);
 ssize_t pread(int fildes, void *buf, size_t nbyte, off_t offset);
 ssize_t pwrite(int fildes, const void *buf, size_t nbyte,
-- 
1.9.5.msysgit.1


[Index of Archives]     [Linux Kernel]     [Linux SCSI]     [Linux IDE]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux