Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
Merge pull request #914 from MartinNowak/fixInotify
Browse files Browse the repository at this point in the history
fix constants for inotify_init1
  • Loading branch information
Alex Rønne Petersen committed Aug 14, 2014
2 parents 3ed62d6 + 340432b commit 0b2e699
Showing 1 changed file with 72 additions and 31 deletions.
103 changes: 72 additions & 31 deletions src/core/sys/linux/sys/inotify.d
Expand Up @@ -13,43 +13,84 @@ nothrow:

struct inotify_event
{
int wd;
uint mask;
uint cookie;
uint len;
char[0] name;
int wd;
uint mask;
uint cookie;
uint len;
char[0] name;
}

enum: uint
{
IN_ACCESS = 0x00000000,
IN_MODIFY = 0x00000002,
IN_ATTRIB = 0x00000004,
IN_CLOSE_WRITE = 0x00000008,
IN_CLOSE_NOWRITE = 0x00000010,
IN_OPEN = 0x00000020,
IN_MOVED_FROM = 0x00000040,
IN_MOVED_TO = 0x00000080,
IN_CREATE = 0x00000100,
IN_DELETE = 0x00000200,
IN_DELETE_SELF = 0x00000400,
IN_MOVE_SELF = 0x00000800,
IN_UMOUNT = 0x00002000,
IN_Q_OVERFLOW = 0x00004000,
IN_IGNORED = 0x00008000,
IN_CLOSE = 0x00000018,
IN_MOVE = 0x000000C0,
IN_ONLYDIR = 0x01000000,
IN_DONT_FOLLOW = 0x02000000,
IN_EXCL_UNLINK = 0x04000000,
IN_MASK_ADD = 0x20000000,
IN_ISDIR = 0x40000000,
IN_ONESHOT = 0x80000000,
IN_ALL_EVENTS = 0x80000FFF,
IN_CLOEXEC = 0x02000000,
IN_NONBLOCK = 0x00004000,
IN_ACCESS = 0x00000000,
IN_MODIFY = 0x00000002,
IN_ATTRIB = 0x00000004,
IN_CLOSE_WRITE = 0x00000008,
IN_CLOSE_NOWRITE = 0x00000010,
IN_OPEN = 0x00000020,
IN_MOVED_FROM = 0x00000040,
IN_MOVED_TO = 0x00000080,
IN_CREATE = 0x00000100,
IN_DELETE = 0x00000200,
IN_DELETE_SELF = 0x00000400,
IN_MOVE_SELF = 0x00000800,
IN_UMOUNT = 0x00002000,
IN_Q_OVERFLOW = 0x00004000,
IN_IGNORED = 0x00008000,
IN_CLOSE = 0x00000018,
IN_MOVE = 0x000000C0,
IN_ONLYDIR = 0x01000000,
IN_DONT_FOLLOW = 0x02000000,
IN_EXCL_UNLINK = 0x04000000,
IN_MASK_ADD = 0x20000000,
IN_ISDIR = 0x40000000,
IN_ONESHOT = 0x80000000,
IN_ALL_EVENTS = 0x80000FFF,
}

version (X86)
{
enum IN_CLOEXEC = 0x80000; // octal!2000000
enum IN_NONBLOCK = 0x800; // octal!4000
}
else version (X86_64)
{
enum IN_CLOEXEC = 0x80000; // octal!2000000
enum IN_NONBLOCK = 0x800; // octal!4000
}
else version (MIPS32)
{
enum IN_CLOEXEC = 0x80000; // octal!2000000
enum IN_NONBLOCK = 0x80; // octal!200
}
else version (MIPS64)
{
enum IN_CLOEXEC = 0x80000; // octal!2000000
enum IN_NONBLOCK = 0x80; // octal!200
}
else version (PPC)
{
enum IN_CLOEXEC = 0x80000; // octal!2000000
enum IN_NONBLOCK = 0x800; // octal!4000
}
else version (PPC64)
{
enum IN_CLOEXEC = 0x80000; // octal!2000000
enum IN_NONBLOCK = 0x800; // octal!4000
}
else version (ARM)
{
enum IN_CLOEXEC = 0x80000; // octal!2000000
enum IN_NONBLOCK = 0x800; // octal!4000
}
else version (AArch64)
{
enum IN_CLOEXEC = 0x80000; // octal!2000000
enum IN_NONBLOCK = 0x800; // octal!4000
}
else
static assert(0, "unimplemented");

int inotify_init();
int inotify_init1(int flags);
int inotify_add_watch(int fd, const(char)* name, uint mask);
Expand Down

0 comments on commit 0b2e699

Please sign in to comment.