diff options
author | cheatfate <ka@hardcore.kiev.ua> | 2016-10-22 15:07:45 +0300 |
---|---|---|
committer | cheatfate <ka@hardcore.kiev.ua> | 2016-10-22 15:07:45 +0300 |
commit | 406878ec5f76148e8717d71f50266ff18586c40d (patch) | |
tree | 5ad91e4a922ce2f2c7b95fba5d50ff9aaa5e84dc /lib/pure/ioselects/ioselectors_kqueue.nim | |
parent | cdd69e951f3861b47f3d71bdf6a9aa09d6575100 (diff) | |
download | Nim-406878ec5f76148e8717d71f50266ff18586c40d.tar.gz |
Fix #4928
Diffstat (limited to 'lib/pure/ioselects/ioselectors_kqueue.nim')
-rw-r--r-- | lib/pure/ioselects/ioselectors_kqueue.nim | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/pure/ioselects/ioselectors_kqueue.nim b/lib/pure/ioselects/ioselectors_kqueue.nim index cdaeeae26..3c0cf4e90 100644 --- a/lib/pure/ioselects/ioselectors_kqueue.nim +++ b/lib/pure/ioselects/ioselectors_kqueue.nim @@ -26,8 +26,8 @@ when defined(macosx) or defined(freebsd): const MAX_DESCRIPTORS_ID = 29 # KERN_MAXFILESPERPROC (MacOS) else: const MAX_DESCRIPTORS_ID = 27 # KERN_MAXFILESPERPROC (FreeBSD) - proc sysctl(name: ptr cint, namelen: cuint, oldp: pointer, oldplen: ptr int, - newp: pointer, newplen: int): cint + proc sysctl(name: ptr cint, namelen: cuint, oldp: pointer, oldplen: ptr csize, + newp: pointer, newplen: csize): cint {.importc: "sysctl",header: """#include <sys/types.h> #include <sys/sysctl.h>"""} elif defined(netbsd) or defined(openbsd): @@ -35,8 +35,8 @@ elif defined(netbsd) or defined(openbsd): # KERN_MAXFILES, because KERN_MAXFILES is always bigger, # than KERN_MAXFILESPERPROC. const MAX_DESCRIPTORS_ID = 7 # KERN_MAXFILES - proc sysctl(name: ptr cint, namelen: cuint, oldp: pointer, oldplen: ptr int, - newp: pointer, newplen: int): cint + proc sysctl(name: ptr cint, namelen: cuint, oldp: pointer, oldplen: ptr csize, + newp: pointer, newplen: csize): cint {.importc: "sysctl",header: """#include <sys/param.h> #include <sys/sysctl.h>"""} @@ -72,7 +72,7 @@ type SelectEvent* = ptr SelectEventImpl proc newSelector*[T](): Selector[T] = var maxFD = 0.cint - var size = sizeof(cint) + var size = csize(sizeof(cint)) var namearr = [1.cint, MAX_DESCRIPTORS_ID.cint] # Obtain maximum number of file descriptors for process if sysctl(addr(namearr[0]), 2, cast[pointer](addr maxFD), addr size, |