Missing and incorrect documentation and specs for atomvm:posix_* functions

Open
#2,029 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 3 days

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
55/100
Issue type
Documentation
Clarity
Mostly clear
Activity status
Stale
Tech stack
erlang
Domain
documentation

Research direction

Read posix_nifs.c and the atomvm module documentation to identify the listed functions and compare their documented behavior with the NIF implementations. Add documentation and specs for the listed functions and atomvm:file_get_cwd/0, and correct the posix_write/2 reference; done when each named function is documented accurately and has a useful spec. No test file or test command is named in the issue.

Written by the indexing model from the issue text.

Description

The documentation for atomvm:posix_write/2 states:

Write data to a file. Files are open non-blocking. ˋatomvm:posix_select_write/3` can be used to determine if the file can be written.

The function ˋatomvm:posix_select_write/3` does not seem to be implemented in posix_nifs.c

Several other nifs in posix_nifs.c are not documented, since these are not standard functions from an OTP module users will have no way of knowing they exist. These functions include:

  • atomvm:posix_closedir/1
  • atomvm:posix_mkfifo/2
  • atomvm:posix_select_read/2
  • atomvm:posix_select_write/2
  • atomvm:posix_select_stop/2
  • atomvm:posix_unlink/1

Also in the atomvm module atomvm:file_get_cwd/0 is lacking documentation.

As well as making the existence of these functions known to users, specs would be beneficial for dialyzer.

Dominant language
Erlang
Stars
2.3k
Forks
171
Avg merge
4d 11h
Merged PRs (30d)
20

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from atomvm/AtomVM

All issues in atomvm/AtomVM

Similar issues

More Documentation issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.