hhvm / hsl-experimental

Experimental features for the Hack Standard Library
MIT License
23 stars 10 forks source link

Review OS\ - is it actually 'POSIX-like'? #140

Closed fredemmott closed 4 years ago

fredemmott commented 4 years ago

Full design goals/notes at https://github.com/hhvm/hsl-experimental/blob/daf9f470109b6728a9ac998c8f964a32663a08e2/src/os/README.md#api-design-notes

TL;DR: aiming for a relatively small number of rules determining how OS\ differs to posix, assuming the function is a posix function. These include:

In particular, I'm aiming for no need to learn function-specific stuff.

If there's other stuff, we should either:

fredemmott commented 4 years ago

Need to review all functions/files for this systematically. Will grep/sed a checklist when I get to this.

fredemmott commented 4 years ago

In terms of signatures, I believe this is still consistent.

From a usability perspective, it might be good to codegen constants from enums- e.g. OS\EINVAL == OS\Errno::EINVAL