Skip to content

Commit 3b2bb79

Browse files
committed
Add design notes for for bit sets and OS specific functions
1 parent 5c4f7bb commit 3b2bb79

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/os/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ inspiration for several decisions in this library.
5050
- do not use `OS\ErrnoException` if the error condition would not be indicated
5151
by the `errno` variable in C. Consider adding another similar class, e.g.
5252
add `OS\HErrnoException` if you want to report an error exposed via `h_errno`
53+
- use `keyset<Flag>` to represent a C bit set, where `Flag` is a Hack `enum`.
5354
- add and use Hack classes (not type aliases) for long-lived 'handle'-like
5455
parameters and return values, e.g. `OS\open()` returns a
5556
`HH\Lib\FileDescriptor` instead of an `int`; as well as aiding type safety,
@@ -64,6 +65,8 @@ inspiration for several decisions in this library.
6465
destroy a short-lived opaque C pointer, they should be exposed as a `shape`
6566
or `vec`. See [Appendix: opaque C pointer
6667
encoding](#appendix-opaque-c-pointer-encoding) section for more detail.
68+
- Functions that are not available in all the Hack supported operating systems
69+
should put into separate namespaces, e.g. `HH\Lib\OS\Bsd` or `HH\Lib\OS\Linux`.
6770

6871
## Implementation notes
6972

0 commit comments

Comments
 (0)