OpenBSD manual page server

Manual Page Search Parameters

INSQUE(3) Library Functions Manual INSQUE(3)

insque, remquelegacy doubly linked lists

#include <search.h>

insque(void *elem, void *pred);

remque(void *elem);

These interfaces have been superseded by the queue(3) macros and are provided for compatibility with legacy code.

() and remque() manipulate a legacy variety of intrusive doubly linked lists. A list can be either circular or linear. Each element in the list must be of the following form:

struct qelem {
	struct qelem   *q_forw;
	struct qelem   *q_back;
	char            q_data[];

The first two members of the struct must be pointers of the same type that point to the next and previous elements in the list, respectively. Any subsequent data in the struct is application-dependent.

The () function inserts elem into a list immediately after pred.

The () function removes elem from the list.

These functions are not atomic.


The insque() and remque() functions conform to the X/Open System Interfaces option of the IEEE Std 1003.1-2008 (“POSIX.1”) specification.

The insque() and remque() functions are derived from the insque and remque instructions on the VAX. They first appeared in 4.2BSD.

April 26, 2020 OpenBSD-current