(index ("posix-shm?" 0) ("shm-open" 160) ("shm-unlink" 2027))
(def (sig (procedure "posix-shm? :: BOOLEAN" (id posix-shm?))) (p (tt "#t") " if the current platform supports POSIX shared memory, " (tt "#f") " otherwise."))
(def (sig (procedure "shm-open:: PATH * OFLAGS  [* MODE] -> FD" (id shm-open))) (p (tt "shm-open") " is a wrapper around " (tt "shm_open") ", which analogous to the UNIX system call " (tt "open(2)") ".") (p "Argument " (tt "PATH") " specifies the shared memory object to be created or opened. For portable use, name should have an initial slash (/) and contain no embedded slashes.") (p (tt "OFLAGS") " is a list of bit masks from the " (tt "posix") " unit which will be ORed together and passed to " (tt "shm_open") ". It must contains exactly one of " (tt "open/rdonly") " or " (tt "open/rdwr") " and any of the other flags listed here:") (dl (dt (tt "open/creat")) (dd "Creates the shared memory object if it does not exist. The user and group ownership of the object are taken from the corresponding effective IDs of the calling process, and the object's permission bits are set according to the low-order 9 bits of mode, except that those bits set in the process file mode creation mask (see " (tt "umask(2)") ") are cleared for the new object.  A new shared memory object initially has zero length. The size of the object can be set using " (tt "file-truncate") ". The newly allocated bytes of a shared memory object are automatically initialised to 0.") (dt (tt "open/excl")) (dd "If " (tt "open/create") " was also specified, and a shared memory object with the given name already exists, returns an error. ") (dt (tt "open/trunc")) (dd "If the shared memory object already exists, truncate it to zero bytes.")) (p (tt "MODE") " should be a bitmask composed of one or more permission values like " (tt "perm/irusr") " and is only relevant when a new file is created. The default mode is " (tt "perm/irwxu | perm/irgrp | perm/iroth") ".") (p "On successful completion " (tt "shm-open") " returns a new file descriptor referring to the shared memory object."))
(def (sig (procedure "shm-unlink:: PATH -> STATUS" (id shm-unlink))) (p "The operation of " (tt "shm-unlink") " is analogous to " (tt "unlink(2)") ": it removes a shared memory object name, and, once all processes have unmapped the object, de-allocates and destroys the contents of the associated memory region. After a successful " (tt "shm-unlink") ", attempts to " (tt "shm-open") " an object with the same name will fail (unless " (tt "open/creat") " was specified, in which case a new, distinct object is created)."))
