Linux Manuals session 3

Section 3: library functions

  • |

    CK_RWCOHORT_INSTANCE (3) Linux Manual Page

    CK_RWCOHORT_INSTANCE – declare an instance of a cohort-based reader-writer lock type LibraryConcurrency Kit (libck, -lck) SynopsisIn ck_cohort.h Fn CK_RWCOHORT_NEUTRAL_INSTANCE COHORT_NAME cohort_name Fn CK_RWCOHORT_RP_INSTANCE COHORT_NAME cohort_name Fn CK_RWCOHORT_WP_INSTANCE COHORT_NAME cohort_name DescriptionThe user must use this macro to declare instances of lock types that they have defined using the CK_RWCOHORT_PROTOTYPE3 macro. The cohort_name must be the same…

  • |

    CK_RWCOHORT_INIT (3) Linux Manual Page

    CK_RWCOHORT_INIT – initialize instance of a cohort-based reader-writer lock type LibraryConcurrency Kit (libck, -lck) SynopsisIn ck_rwcohort.h Fn CK_RWCOHORT_NEUTRAL_INIT COHORT_NAME cohort_name LOCK *lock Fn CK_RWCOHORT_RP_INIT COHORT_NAME cohort_name LOCK *lock unsigned int wait_limit Fn CK_RWCOHORT_WP_INIT COHORT_NAME cohort_name LOCK *lock unsigned int wait_limit DescriptionThis macro initializes the lock instance pointed to by the Fa lock argument. Until a…

  • |

    CK_RHS_HASH (3) Linux Manual Page

    CK_RHS_HASH – invoke hash function with hash set seed LibraryConcurrency Kit (libck, -lck) SynopsisIn ck_rhs.h Ft unsigned long Fn CK_RHS_HASH ck_rhs_t *hs ck_rhs_hash_cb_t *hf const void *key DescriptionThe Fn CK_RHS_HASH 3 macro will invoke the hash function pointed to by the Fa hf argument with the seed value associated with Fa hs and the key…

  • |

    CK_COHORT_UNLOCK (3) Linux Manual Page

    CK_COHORT_UNLOCK – release cohort lock LibraryConcurrency Kit (libck, -lck) SynopsisIn ck_cohort.h Fn CK_COHORT_UNLOCK COHORT_NAME cohort_name COHORT *cohort void *global_context void *local_context DescriptionThis call instructs Fa cohort to relinquish its local lock and potentially its global lock as well. Fa global_context will be passed as the second argument to the function that was provided as the…

  • |

    CK_COHORT_TRYLOCK_PROTOTYPE (3) Linux Manual Page

    CK_COHORT_TRYLOCK_PROTOTYPE – define cohort type with specified lock types LibraryConcurrency Kit (libck, -lck) SynopsisIn ck_cohort.h Fn CK_COHORT_TRYLOCK_PROTOTYPE COHORT_NAME cohort_name LOCK_FXN global_lock_method LOCK_FXN global_unlock_method BOOL_LOCK_FXN global_locked_method BOOL_LOCK_FXN global_trylock_method LOCK_FXN local_lock_method LOCK_FXN local_unlock_method BOOL_LOCK_FXN local_locked_method BOOL_LOCK_FXN local_trylock_method DescriptionThe ck_cohort.h header file does not define any cohort types. Instead, the user must use the CK_COHORT_PROTOTYPE or CK_COHORT_TRYLOCK_PROTOTYPE macros…

  • |

    CK_COHORT_TRYLOCK (3) Linux Manual Page

    CK_COHORT_TRYLOCK – try to acquire cohort lock LibraryConcurrency Kit (libck, -lck) SynopsisIn ck_cohort.h Fn CK_COHORT_TRYLOCK COHORT_NAME cohort_name COHORT *cohort void *global_trylock_context void *local_trylock_context void *lock_unlock_context DescriptionThis call attempts to acquire both the local and global (if necessary) locks from Fa cohort . It can only be used with cohort types that were defined using the…

  • |

    CK_COHORT_PROTOTYPE (3) Linux Manual Page

    CK_COHORT_PROTOTYPE – define cohort type with specified lock types LibraryConcurrency Kit (libck, -lck) SynopsisIn ck_cohort.h Fn CK_COHORT_PROTOTYPE COHORT_NAME cohort_name TYPE global_lock_method LOCK_FXN global_unlock_method LOCK_FXN local_lock_method LOCK_FXN local_unlock_method DescriptionThe ck_cohort.h header file does not define any cohort types. Instead, the user must use the CK_COHORT_PROTOTYPE or CK_COHORT_TRYLOCK_PROTOTYPE3 macros to define any types they want to use….

  • |

    CK_COHORT_LOCK (3) Linux Manual Page

    CK_COHORT_LOCK – acquire cohort lock LibraryConcurrency Kit (libck, -lck) SynopsisIn ck_cohort.h Fn CK_COHORT_LOCK COHORT_NAME cohort_name COHORT *cohort void *global_context void *local_context DescriptionThis call attempts to acquire both the local and global (if necessary) locks from Fa cohort . The call will block until both locks have been acquired. Fa global_context will be passed as the…

  • |

    CK_COHORT_INSTANCE (3) Linux Manual Page

    CK_COHORT_INSTANCE – declare an instance of a cohort type LibraryConcurrency Kit (libck, -lck) SynopsisIn ck_cohort.h Fn CK_COHORT_INSTANCE COHORT_NAME cohort_name DescriptionThe user must use this macro to declare instances of cohort types that they have defined. For instance, if they have used the CK_COHORT_PROTOTYPE macro to define a cohort type with name foo, they would create…

  • |

    CK_COHORT_INIT (3) Linux Manual Page

    CK_COHORT_INIT – initialize instance of a cohort type LibraryConcurrency Kit (libck, -lck) SynopsisIn ck_cohort.h Fn CK_COHORT_INIT COHORT_NAME cohort_name COHORT *cohort void *global_lock void *local_lock unsigned int pass_limit DescriptionUntil a cohort instance is initialized using the CK_COHORT_INIT macro, any operations involving it will have undefined behavior. After this macro has been called, the cohort pointed to…

  • |

    CK_ARRAY_FOREACH (3) Linux Manual Page

    CK_ARRAY_FOREACH – iterate through an array LibraryConcurrency Kit (libck, -lck) SynopsisIn ck_array.h Ft bool Fn CK_ARRAY_FOREACH ck_array_t *array ck_array_iterator_t *iterator void **b DescriptionThe Fn CK_ARRAY_FOREACH 3 macro iterates through the array pointed to by Fa array . A pointer to an iterator object must be specified by Fa iterator and Fa b must point to…

  • |

    CIRCLEQ_REMOVE (3) Linux Manual Page

    CIRCLEQ_EMPTY, CIRCLEQ_ENTRY, CIRCLEQ_FIRST, CIRCLEQ_FOREACH, CIRCLEQ_FOREACH_REVERSE, CIRCLEQ_HEAD, CIRCLEQ_HEAD_INITIALIZER, CIRCLEQ_INIT, CIRCLEQ_INSERT_AFTER, CIRCLEQ_INSERT_BEFORE, CIRCLEQ_INSERT_HEAD, CIRCLEQ_INSERT_TAIL, CIRCLEQ_LAST, CIRCLEQ_LOOP_NEXT, CIRCLEQ_LOOP_PREV, CIRCLEQ_NEXT, CIRCLEQ_PREV, CIRCLEQ_REMOVE – implementation of a doubly linked circular queue Synopsis#include <sys/queue.h> int CIRCLEQ_EMPTY(CIRCLEQ_HEAD *head); CIRCLEQ_ENTRY(TYPE); struct TYPE *CIRCLEQ_FIRST(CIRCLEQ_HEAD *head); CIRCLEQ_FOREACH(struct TYPE *var, CIRCLEQ_HEAD *head, CIRCLEQ_ENTRY NAME); CIRCLEQ_FOREACH_REVERSE(struct TYPE *var, CIRCLEQ_HEAD *head, CIRCLEQ_ENTRY NAME); CIRCLEQ_HEAD(HEADNAME, TYPE); CIRCLEQ_HEAD CIRCLEQ_HEAD_INITIALIZER(CIRCLEQ_HEAD head);…

  • |

    CIRCLEQ_PREV (3) Linux Manual Page

    CIRCLEQ_EMPTY, CIRCLEQ_ENTRY, CIRCLEQ_FIRST, CIRCLEQ_FOREACH, CIRCLEQ_FOREACH_REVERSE, CIRCLEQ_HEAD, CIRCLEQ_HEAD_INITIALIZER, CIRCLEQ_INIT, CIRCLEQ_INSERT_AFTER, CIRCLEQ_INSERT_BEFORE, CIRCLEQ_INSERT_HEAD, CIRCLEQ_INSERT_TAIL, CIRCLEQ_LAST, CIRCLEQ_LOOP_NEXT, CIRCLEQ_LOOP_PREV, CIRCLEQ_NEXT, CIRCLEQ_PREV, CIRCLEQ_REMOVE – implementation of a doubly linked circular queue Synopsis#include <sys/queue.h> int CIRCLEQ_EMPTY(CIRCLEQ_HEAD *head); CIRCLEQ_ENTRY(TYPE); struct TYPE *CIRCLEQ_FIRST(CIRCLEQ_HEAD *head); CIRCLEQ_FOREACH(struct TYPE *var, CIRCLEQ_HEAD *head, CIRCLEQ_ENTRY NAME); CIRCLEQ_FOREACH_REVERSE(struct TYPE *var, CIRCLEQ_HEAD *head, CIRCLEQ_ENTRY NAME); CIRCLEQ_HEAD(HEADNAME, TYPE); CIRCLEQ_HEAD CIRCLEQ_HEAD_INITIALIZER(CIRCLEQ_HEAD head);…

  • |

    CIRCLEQ_NEXT (3) Linux Manual Page

    CIRCLEQ_EMPTY, CIRCLEQ_ENTRY, CIRCLEQ_FIRST, CIRCLEQ_FOREACH, CIRCLEQ_FOREACH_REVERSE, CIRCLEQ_HEAD, CIRCLEQ_HEAD_INITIALIZER, CIRCLEQ_INIT, CIRCLEQ_INSERT_AFTER, CIRCLEQ_INSERT_BEFORE, CIRCLEQ_INSERT_HEAD, CIRCLEQ_INSERT_TAIL, CIRCLEQ_LAST, CIRCLEQ_LOOP_NEXT, CIRCLEQ_LOOP_PREV, CIRCLEQ_NEXT, CIRCLEQ_PREV, CIRCLEQ_REMOVE – implementation of a doubly linked circular queue Synopsis#include <sys/queue.h> int CIRCLEQ_EMPTY(CIRCLEQ_HEAD *head); CIRCLEQ_ENTRY(TYPE); struct TYPE *CIRCLEQ_FIRST(CIRCLEQ_HEAD *head); CIRCLEQ_FOREACH(struct TYPE *var, CIRCLEQ_HEAD *head, CIRCLEQ_ENTRY NAME); CIRCLEQ_FOREACH_REVERSE(struct TYPE *var, CIRCLEQ_HEAD *head, CIRCLEQ_ENTRY NAME); CIRCLEQ_HEAD(HEADNAME, TYPE); CIRCLEQ_HEAD CIRCLEQ_HEAD_INITIALIZER(CIRCLEQ_HEAD head);…

  • |

    CIRCLEQ_LOOP_PREV (3) Linux Manual Page

    CIRCLEQ_EMPTY, CIRCLEQ_ENTRY, CIRCLEQ_FIRST, CIRCLEQ_FOREACH, CIRCLEQ_FOREACH_REVERSE, CIRCLEQ_HEAD, CIRCLEQ_HEAD_INITIALIZER, CIRCLEQ_INIT, CIRCLEQ_INSERT_AFTER, CIRCLEQ_INSERT_BEFORE, CIRCLEQ_INSERT_HEAD, CIRCLEQ_INSERT_TAIL, CIRCLEQ_LAST, CIRCLEQ_LOOP_NEXT, CIRCLEQ_LOOP_PREV, CIRCLEQ_NEXT, CIRCLEQ_PREV, CIRCLEQ_REMOVE – implementation of a doubly linked circular queue Synopsis#include <sys/queue.h> int CIRCLEQ_EMPTY(CIRCLEQ_HEAD *head); CIRCLEQ_ENTRY(TYPE); struct TYPE *CIRCLEQ_FIRST(CIRCLEQ_HEAD *head); CIRCLEQ_FOREACH(struct TYPE *var, CIRCLEQ_HEAD *head, CIRCLEQ_ENTRY NAME); CIRCLEQ_FOREACH_REVERSE(struct TYPE *var, CIRCLEQ_HEAD *head, CIRCLEQ_ENTRY NAME); CIRCLEQ_HEAD(HEADNAME, TYPE); CIRCLEQ_HEAD CIRCLEQ_HEAD_INITIALIZER(CIRCLEQ_HEAD head);…

  • |

    CIRCLEQ_LOOP_NEXT (3) Linux Manual Page

    CIRCLEQ_EMPTY, CIRCLEQ_ENTRY, CIRCLEQ_FIRST, CIRCLEQ_FOREACH, CIRCLEQ_FOREACH_REVERSE, CIRCLEQ_HEAD, CIRCLEQ_HEAD_INITIALIZER, CIRCLEQ_INIT, CIRCLEQ_INSERT_AFTER, CIRCLEQ_INSERT_BEFORE, CIRCLEQ_INSERT_HEAD, CIRCLEQ_INSERT_TAIL, CIRCLEQ_LAST, CIRCLEQ_LOOP_NEXT, CIRCLEQ_LOOP_PREV, CIRCLEQ_NEXT, CIRCLEQ_PREV, CIRCLEQ_REMOVE – implementation of a doubly linked circular queue Synopsis#include <sys/queue.h> int CIRCLEQ_EMPTY(CIRCLEQ_HEAD *head); CIRCLEQ_ENTRY(TYPE); struct TYPE *CIRCLEQ_FIRST(CIRCLEQ_HEAD *head); CIRCLEQ_FOREACH(struct TYPE *var, CIRCLEQ_HEAD *head, CIRCLEQ_ENTRY NAME); CIRCLEQ_FOREACH_REVERSE(struct TYPE *var, CIRCLEQ_HEAD *head, CIRCLEQ_ENTRY NAME); CIRCLEQ_HEAD(HEADNAME, TYPE); CIRCLEQ_HEAD CIRCLEQ_HEAD_INITIALIZER(CIRCLEQ_HEAD head);…

  • |

    CIRCLEQ_LAST (3) Linux Manual Page

    CIRCLEQ_EMPTY, CIRCLEQ_ENTRY, CIRCLEQ_FIRST, CIRCLEQ_FOREACH, CIRCLEQ_FOREACH_REVERSE, CIRCLEQ_HEAD, CIRCLEQ_HEAD_INITIALIZER, CIRCLEQ_INIT, CIRCLEQ_INSERT_AFTER, CIRCLEQ_INSERT_BEFORE, CIRCLEQ_INSERT_HEAD, CIRCLEQ_INSERT_TAIL, CIRCLEQ_LAST, CIRCLEQ_LOOP_NEXT, CIRCLEQ_LOOP_PREV, CIRCLEQ_NEXT, CIRCLEQ_PREV, CIRCLEQ_REMOVE – implementation of a doubly linked circular queue Synopsis#include <sys/queue.h> int CIRCLEQ_EMPTY(CIRCLEQ_HEAD *head); CIRCLEQ_ENTRY(TYPE); struct TYPE *CIRCLEQ_FIRST(CIRCLEQ_HEAD *head); CIRCLEQ_FOREACH(struct TYPE *var, CIRCLEQ_HEAD *head, CIRCLEQ_ENTRY NAME); CIRCLEQ_FOREACH_REVERSE(struct TYPE *var, CIRCLEQ_HEAD *head, CIRCLEQ_ENTRY NAME); CIRCLEQ_HEAD(HEADNAME, TYPE); CIRCLEQ_HEAD CIRCLEQ_HEAD_INITIALIZER(CIRCLEQ_HEAD head);…

  • |

    CIRCLEQ_INSERT_TAIL (3) Linux Manual Page

    CIRCLEQ_EMPTY, CIRCLEQ_ENTRY, CIRCLEQ_FIRST, CIRCLEQ_FOREACH, CIRCLEQ_FOREACH_REVERSE, CIRCLEQ_HEAD, CIRCLEQ_HEAD_INITIALIZER, CIRCLEQ_INIT, CIRCLEQ_INSERT_AFTER, CIRCLEQ_INSERT_BEFORE, CIRCLEQ_INSERT_HEAD, CIRCLEQ_INSERT_TAIL, CIRCLEQ_LAST, CIRCLEQ_LOOP_NEXT, CIRCLEQ_LOOP_PREV, CIRCLEQ_NEXT, CIRCLEQ_PREV, CIRCLEQ_REMOVE – implementation of a doubly linked circular queue Synopsis#include <sys/queue.h> int CIRCLEQ_EMPTY(CIRCLEQ_HEAD *head); CIRCLEQ_ENTRY(TYPE); struct TYPE *CIRCLEQ_FIRST(CIRCLEQ_HEAD *head); CIRCLEQ_FOREACH(struct TYPE *var, CIRCLEQ_HEAD *head, CIRCLEQ_ENTRY NAME); CIRCLEQ_FOREACH_REVERSE(struct TYPE *var, CIRCLEQ_HEAD *head, CIRCLEQ_ENTRY NAME); CIRCLEQ_HEAD(HEADNAME, TYPE); CIRCLEQ_HEAD CIRCLEQ_HEAD_INITIALIZER(CIRCLEQ_HEAD head);…

  • |

    CIRCLEQ_INSERT_HEAD (3) Linux Manual Page

    CIRCLEQ_EMPTY, CIRCLEQ_ENTRY, CIRCLEQ_FIRST, CIRCLEQ_FOREACH, CIRCLEQ_FOREACH_REVERSE, CIRCLEQ_HEAD, CIRCLEQ_HEAD_INITIALIZER, CIRCLEQ_INIT, CIRCLEQ_INSERT_AFTER, CIRCLEQ_INSERT_BEFORE, CIRCLEQ_INSERT_HEAD, CIRCLEQ_INSERT_TAIL, CIRCLEQ_LAST, CIRCLEQ_LOOP_NEXT, CIRCLEQ_LOOP_PREV, CIRCLEQ_NEXT, CIRCLEQ_PREV, CIRCLEQ_REMOVE – implementation of a doubly linked circular queue Synopsis#include <sys/queue.h> int CIRCLEQ_EMPTY(CIRCLEQ_HEAD *head); CIRCLEQ_ENTRY(TYPE); struct TYPE *CIRCLEQ_FIRST(CIRCLEQ_HEAD *head); CIRCLEQ_FOREACH(struct TYPE *var, CIRCLEQ_HEAD *head, CIRCLEQ_ENTRY NAME); CIRCLEQ_FOREACH_REVERSE(struct TYPE *var, CIRCLEQ_HEAD *head, CIRCLEQ_ENTRY NAME); CIRCLEQ_HEAD(HEADNAME, TYPE); CIRCLEQ_HEAD CIRCLEQ_HEAD_INITIALIZER(CIRCLEQ_HEAD head);…