summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorart <art@openbsd.org>2002-07-12 13:32:38 +0000
committerart <art@openbsd.org>2002-07-12 13:32:38 +0000
commitadcc86bf9f37c962097d4e27a72fa8629536bd98 (patch)
tree6ea51fb408159f61a3f8c438e3fd2a6e9ccc3bc6
parent- Add a flags argument to dohooks. (diff)
downloadwireguard-openbsd-adcc86bf9f37c962097d4e27a72fa8629536bd98.tar.xz
wireguard-openbsd-adcc86bf9f37c962097d4e27a72fa8629536bd98.zip
Document the API change.
-rw-r--r--share/man/man9/dohooks.917
1 files changed, 15 insertions, 2 deletions
diff --git a/share/man/man9/dohooks.9 b/share/man/man9/dohooks.9
index 2590caad55e..d0407c10811 100644
--- a/share/man/man9/dohooks.9
+++ b/share/man/man9/dohooks.9
@@ -1,4 +1,4 @@
-.\" $OpenBSD: dohooks.9,v 1.2 2001/07/28 00:09:24 mpech Exp $
+.\" $OpenBSD: dohooks.9,v 1.3 2002/07/12 13:32:38 art Exp $
.\"
.\" Copyright (c) 2001 Niklas Hallqvist.
.\" All rights reserved.
@@ -34,7 +34,7 @@
.Sh SYNOPSIS
.Fd #include <sys/systm.h>
.Ft void
-.Fn dohooks "struct hook_desc_head *head"
+.Fn dohooks "struct hook_desc_head *head" "int flags"
.Sh DESCRIPTION
The
.Fn dohooks
@@ -49,6 +49,19 @@ can put the hooks either at the head or the tail of that queue,
making it possible to call the hooks either in the order of
establishment, or its reverse.
.Pp
+The flags can specify
+.Dv HOOK_REMOVE
+to remove already processed hooks from the hook list and
+.Dv HOOK_FREE
+to also free them.
+In most cases either no flags should be used or
+.Dv HOOK_REMOVE
+and
+.Dv HOOK_FREE
+at the same time, since just HOOK_REMOVE will drop the only reference to
+allocated memory and should only be used in situations where freeing
+memory would be illegal and unnecessary.
+.Pp
This function is used to implement the
.Xr doshutdownhooks 9
as well as the