diff options
author | xyz <xyz@queeq.com> | 2016-01-17 13:56:41 -0500 |
---|---|---|
committer | xyz <xyz@queeq.com> | 2016-01-17 13:56:41 -0500 |
commit | aad55ae772b652ee252b2e2c94cc61013ca05a99 (patch) | |
tree | 370c9be7abbddd82f5e00f6f7c96a4b93a9e34dd /lib/system.nim | |
parent | cc2decbbbc7fc44bc9f9e5d456e4b5d25ac47e8a (diff) | |
download | Nim-aad55ae772b652ee252b2e2c94cc61013ca05a99.tar.gz |
Add support for ioctl.
"ioctl (an abbreviation of input/output control) is a system call for device-specific input/output operations and other operations which cannot be expressed by regular system calls."
Diffstat (limited to 'lib/system.nim')
-rw-r--r-- | lib/system.nim | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/system.nim b/lib/system.nim index bb8254364..1e090cfbd 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -2694,6 +2694,11 @@ when not defined(JS): #and not defined(nimscript): proc endOfFile*(f: File): bool {.tags: [], benign.} ## Returns true iff `f` is at the end. + proc ioctl*(f: FileHandle, device: uint): int {.importc: "ioctl", + header: "<sys/ioctl.h>", varargs, tags: [WriteIOEffect].} + ## A system call for device-specific input/output operations and other + ## operations which cannot be expressed by regular system calls + proc readChar*(f: File): char {. importc: "fgetc", header: "<stdio.h>", tags: [ReadIOEffect].} ## Reads a single character from the stream `f`. |