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."
This commit is contained in:
parent
cc2decbbbc
commit
aad55ae772
1 changed files with 5 additions and 0 deletions
|
|
@ -2694,6 +2694,11 @@ when not defined(JS): #and not defined(nimscript):
|
||||||
proc endOfFile*(f: File): bool {.tags: [], benign.}
|
proc endOfFile*(f: File): bool {.tags: [], benign.}
|
||||||
## Returns true iff `f` is at the end.
|
## 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 {.
|
proc readChar*(f: File): char {.
|
||||||
importc: "fgetc", header: "<stdio.h>", tags: [ReadIOEffect].}
|
importc: "fgetc", header: "<stdio.h>", tags: [ReadIOEffect].}
|
||||||
## Reads a single character from the stream `f`.
|
## Reads a single character from the stream `f`.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue