Skip to content

Commit

Permalink
Add docs for RawFD
Browse files Browse the repository at this point in the history
  • Loading branch information
kshyatt committed Aug 2, 2018
1 parent 463513f commit ef0b214
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion base/event.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Block the current task until some event occurs, depending on the type of the arg
can be used to determine success or failure.
* [`Task`](@ref): Wait for a `Task` to finish. If the task fails with an exception, the
exception is propagated (re-thrown in the task that called `wait`).
* `RawFD`: Wait for changes on a file descriptor (see the `FileWatching` package).
* [`RawFD`](@ref): Wait for changes on a file descriptor (see the `FileWatching` package).
If no argument is passed, the task blocks for an undefined period. A task can only be
restarted by an explicit call to [`schedule`](@ref) or [`yieldto`](@ref).
Expand Down
9 changes: 9 additions & 0 deletions base/libc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@ include(string(length(Core.ARGS) >= 2 ? Core.ARGS[2] : "", "errno_h.jl")) # inc
## RawFD ##

# Wrapper for an OS file descriptor (on both Unix and Windows)
"""
RawFD
Primitive type which wraps the native OS file descriptor.
`RawFD`s can be passed to methods like [`stat`](@ref) to
discover information about the underlying file, and can
also be used to open streams, with the `RawFD` describing
the OS file backing the stream.
"""
primitive type RawFD 32 end
RawFD(fd::Integer) = bitcast(RawFD, Cint(fd))
RawFD(fd::RawFD) = fd
Expand Down
1 change: 1 addition & 0 deletions doc/src/base/file.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Base.Filesystem.symlink
Base.Filesystem.readlink
Base.Filesystem.chmod
Base.Filesystem.chown
Base.RawFD
Base.stat
Base.Filesystem.lstat
Base.Filesystem.ctime
Expand Down

0 comments on commit ef0b214

Please sign in to comment.