diff --git a/lib/std/syncio.nim b/lib/std/syncio.nim index dadad97918..d406c254f9 100644 --- a/lib/std/syncio.nim +++ b/lib/std/syncio.nim @@ -105,7 +105,7 @@ proc c_feof(f: File): cint {. importc: "feof", header: "".} when not declared(c_fwrite): - proc c_fwrite(buf: pointer, size, n: csize_t, f: File): cint {. + proc c_fwrite(buf: pointer, size, n: csize_t, f: File): csize_t {. importc: "fwrite", header: "".} # C routine that is used here: diff --git a/lib/system/ansi_c.nim b/lib/system/ansi_c.nim index ae4b905048..a8a4bd7678 100644 --- a/lib/system/ansi_c.nim +++ b/lib/system/ansi_c.nim @@ -211,7 +211,7 @@ else: proc c_realloc*(p: pointer, newsize: csize_t): pointer {. importc: "realloc", header: "".} -proc c_fwrite*(buf: pointer, size, n: csize_t, f: CFilePtr): cint {. +proc c_fwrite*(buf: pointer, size, n: csize_t, f: CFilePtr): csize_t {. importc: "fwrite", header: "".} proc c_fflush*(f: CFilePtr): cint {.