(index ("o/accmode" 0) ("o/rdonly" 0) ("o/wronly" 0) ("o/rdwr" 0) ("o/creat" 0) ("o/noctty" 0) ("o/trunc" 0) ("o/append" 0) ("o/nonblock" 0) ("o/ndelay" 0) ("o/sync" 0) ("o/fsync" 0) ("o/async" 0) ("s/isuid" 470) ("s/isgid" 470) ("s/irusr" 470) ("s/iwusr" 470) ("s/ixusr" 470) ("s/irwxu" 470) ("s/irgrp" 470) ("s/iwgrp" 470) ("s/ixgrp" 470) ("s/irwxg" 470) ("s/iroth" 470) ("s/iwoth" 470) ("s/ixoth" 470) ("s/irwxo" 470) ("make-sem" 958) ("free-sem" 1049) ("sem-init" 1156) ("sem-destroy" 1434) ("sem-failed?" 1539) ("sem-open" 1743) ("sem-open/mode" 1982) ("sem-close" 2377) ("sem-unlink" 2543) ("sem-wait" 2693) ("sem-trywait" 2837) ("sem-timedwait" 3070) ("sem-post" 3334) ("sem-getvalue" 3425) ("create-sem" 3585) ("with-sem/try" 3957) ("with-sem/try" 4157) ("with-sem/timed" 4490))
(def (sig (constant "o/accmode" (id o/accmode)) (constant "o/rdonly" (id o/rdonly)) (constant "o/wronly" (id o/wronly)) (constant "o/rdwr" (id o/rdwr)) (constant "o/creat" (id o/creat)) (constant "o/noctty" (id o/noctty)) (constant "o/trunc" (id o/trunc)) (constant "o/append" (id o/append)) (constant "o/nonblock" (id o/nonblock)) (constant "o/ndelay" (id o/ndelay)) (constant "o/sync" (id o/sync)) (constant "o/fsync" (id o/fsync)) (constant "o/async" (id o/async))))
(def (sig (constant "s/isuid" (id s/isuid)) (constant "s/isgid" (id s/isgid)) (constant "s/irusr" (id s/irusr)) (constant "s/iwusr" (id s/iwusr)) (constant "s/ixusr" (id s/ixusr)) (constant "s/irwxu" (id s/irwxu)) (constant "s/irgrp" (id s/irgrp)) (constant "s/iwgrp" (id s/iwgrp)) (constant "s/ixgrp" (id s/ixgrp)) (constant "s/irwxg" (id s/irwxg)) (constant "s/iroth" (id s/iroth)) (constant "s/iwoth" (id s/iwoth)) (constant "s/ixoth" (id s/ixoth)) (constant "s/irwxo" (id s/irwxo))))
(def (sig (procedure "(make-sem)" (id make-sem))) (p "Allocates memory for a semaphore."))
(def (sig (procedure "(free-sem semaphore)" (id free-sem))) (p "Frees memory allocated for a semaphore."))
(def (sig (procedure "(sem-init semaphore shared? value)" (id sem-init))) (p "Initializes a semaphore. If `shared?` is true then the semaphore will be shared with processes which are not its children, and so must reside in a POSIX shared memory range. `value` is an integer."))
(def (sig (procedure "(sem-destroy semaphore)" (id sem-destroy))) (p "Destroys an un-named semaphore."))
(def (sig (procedure "(sem-failed? semaphore)" (id sem-failed?))) (p "Returns true if `semaphore` is a pointer to the special failed semaphore, indicating that `sem-open` failed to operate as desired."))
(def (sig (procedure "(sem-open name open-flags)" (id sem-open))) (p "Given a string `name` and an integer mask of `open-flags`, attempts to open a semaphore using the given flags. Returns a semaphore, or false if the operation failed."))
(def (sig (procedure "(sem-open/mode name open-flags mode_t value)" (id sem-open/mode))) (p "Given a string `name` and an integer mask of `open-flags`, attempts to open a semaphore using the given flags. If `open-flags` is o/creat, then it will attempt to allocate a new semaphore with the given `mode_t` and a particular integer value. Returns a semaphore, or false if the operation failed."))
(def (sig (procedure "(sem-close semaphore)" (id sem-close))) (p "Given a semaphore, attempts to close the semaphore. Returns true if successful, false otherwise."))
(def (sig (procedure "(sem-unlink name)" (id sem-unlink))) (p "Unlinks a semaphore by the given name. Returns true if successful, false otherwise."))
(def (sig (procedure "(sem-wait semaphore)" (id sem-wait))) (p "Attempts to decrement a semaphore. It will block until doing so is possible."))
(def (sig (procedure "(sem-trywait semaphore)" (id sem-trywait))) (p "Attempts to decrement a semaphore. It will not block if it is not possible to do so, and will return true if the semaphore was decremented and false otherwise."))
(def (sig (procedure "(sem-timedwait semaphore seconds nano-seconds)" (id sem-timedwait))) (p "Attempts to decrement a semaphore. It will block for a maximum of `seconds + nanoseconds`, and will return true if the semaphore was decremented and false otherwise."))
(def (sig (procedure "(sem-post semaphore)" (id sem-post))) (p "Increments a semaphore."))
(def (sig (procedure "(sem-getvalue semaphore)" (id sem-getvalue))) (p "Gets the value of the semaphore. This command is non-blocking and non-deterministic."))
(def (sig (procedure "(create-sem name value #!key (open-flags o/creat) (mode 0644))" (id create-sem))) (p "Uses sem-open/mode to open or create a new semaphore, defaulting to creating. If doing so failed then it will unlink the name and return false. If doing so succeeded then it sets a finalizer that closes and unlinks the semaphore, and returns the new semaphore."))
(def (sig (procedure "(with-sem/try semaphore . body)" (id with-sem/try))) (p "Macro that uses dynamic-wind to ensure that the semaphore is properly posted regardless of the outcome of `body ...`."))
(def (sig (procedure "(with-sem/try semaphore body-success body-fail)" (id with-sem/try))) (p "Macro that uses dynamic-wind to ensure that the semaphore is properly posted regardless of the outcome of `body-success` and `body-fail`. `body-success` is called if the semaphore could be decremented, otherwise `body-fail` is called."))
(def (sig (procedure "(with-sem/timed semaphore seconds nano-seconds body-success body-fail)" (id with-sem/timed))) (p "Macro that uses dynamic-wind to ensure that the semaphore is properly posted regardless of the outcome of `body-success` and `body-fail`. `body-success` is called if the semaphore was able to be decremented in `seconds + nano-seconds`, otherwise `body-fail` is called."))
