Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • F frama-c
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 204
    • Issues 204
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • pub
  • frama-c
  • Issues
  • #48
Closed
Open
Created Dec 11, 2020 by fx-carton@fx-carton

select()'s contract assigns {read,write,error}fds arguments even if they are NULL pointers

My understanding is that select() accepts NULL pointers for any of the fd_set* argument. POSIX 2008 states "If the name argument is not a null pointer," for name in {readfds, writefds, errorfds}. The manual page for select on my system also states this is allowed: "Each of the fd_set arguments may be specified as NULL if no file descriptors are to be watched for the corresponding class of events."

The select() contract in Frama-C's libc has an unconditional assigns clause for these arguments:

assigns *readfds, *writefds, *errorfds, *timeout, \result

This means that a function calling select() with a NULL pointer for any of the fd_set* argument, is unable to prove an assigns clause, unless it contains *(fd_set*)0.

Could the select() contract be updated to reflect this case?

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking