microsoftarchive / redis

Redis is an in-memory database that persists on disk. The data model is key-value, but many different kind of values are supported: Strings, Lists, Sets, Sorted Sets, Hashes
http://redis.io
Other
20.78k stars 5.37k forks source link

I need "ioctl.h" and "unistd.h"; #591

Closed jstzwhc closed 6 years ago

jstzwhc commented 6 years ago

When I build the task, I need "ioctl.h" and "unistd.h".

tporadowski commented 6 years ago

Please provide some more details on what you are doing and what happens - only then someone might be able to help.

jstzwhc commented 6 years ago

In Branch 3.2: RedisCli: linenoise.c

include <sys/ioctl.h>

include

error code: c1083 No such file or directory

tporadowski commented 6 years ago

Looks like you don't have _WIN32 defined as this part should be normally skipped:

#ifdef _WIN32
#include "../../src/Win32_Interop/Win32_Portability.h"
#include "../../src/Win32_Interop/win32fixes.h"
#define UNUSED(V) ((void) V)
#include "../../src/Win32_Interop/win32_ANSI.h"
#else
#include <termios.h>
#include <unistd.h>
#include <sys/ioctl.h>
#endif

https://github.com/MicrosoftArchive/redis/blob/3.2/deps/linenoise/linenoise.c#L106-L115

jstzwhc commented 6 years ago

I tried, but the problem remains.

ifdef _WIN32

include "../../src/Win32_Interop/Win32_Portability.h"

include "../../src/Win32_Interop/win32fixes.h"

define UNUSED(V) ((void) V)

include "../../src/Win32_Interop/win32_ANSI.h"

else

include

include

include <sys/ioctl.h>

endif

include

include

include

include

include

include

include <sys/stat.h>

include <sys/types.h>

**#include <sys/ioctl.h>

include **

include "linenoise.h"

tporadowski commented 6 years ago

@jstzwhc just remove those 2 includes you marked in bold - they are already part of #if ... #else ... #endif

jstzwhc commented 6 years ago

I tried, but the problem remains. mode_t old_umask = umask(S_IXUSR|S_IRWXG|S_IRWXO); Error Reports: "umask" undefinition; "S_IXUSR and S_IRWXG and S_IRWXO" Undeclared identifier

tporadowski commented 6 years ago

Looks like 3.2 branch here is not completely ported to Windows, so please better switch to win-3.2.100 as this part of Redis code that uses umask is different there (uses _WIN32 preprocessor directive): https://github.com/MicrosoftArchive/redis/blob/win-3.2.100/deps/linenoise/linenoise.c#L1335-L1340

Depending on what you are doing with this Redis port - you might also want to check my fork of this archived repo - where I updated Redis port for Windows to Redis 4.0.2 (without modules support yet): https://github.com/tporadowski/redis

jstzwhc commented 6 years ago

Fine,I swith to 3.2.100 branch. Please release 3.2.100, not only 3.2.100-preview!

LihtPro commented 4 years ago

very helpful, thanks!