From nobody Sat Dec 4 22:21:09 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 76E59189D504; Sat, 4 Dec 2021 22:21:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J640R0Q7qz3tWT; Sat, 4 Dec 2021 22:21:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E2E1A45CE; Sat, 4 Dec 2021 22:21:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1B4ML9kf002200; Sat, 4 Dec 2021 22:21:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B4ML9RA002199; Sat, 4 Dec 2021 22:21:09 GMT (envelope-from git) Date: Sat, 4 Dec 2021 22:21:09 GMT Message-Id: <202112042221.1B4ML9RA002199@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 79d650f26277 - main - swapoff(2): document extended syscall arguments List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 79d650f26277b364be45c598dd498bff600bb4a6 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638656471; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pacdpCnYFH3Ioh03708u1NCEKtp+p1l0K600tiK6Wxo=; b=ynYJ3V4FUwDznTYuoO13QodzLv9AbAKm0abMEZSVfuOHMaTepWrB2sHhpotCYyX9k6ozVG qXF+0ElNLhE5n1tVJdQD5nO4JCo9MzCVtD2HVnHwgr6q2ByvYTxStRivP3mdjvRyBFmzal y4+69IZ1Yg3zTIlNGRTrB9C8OmlejKqqTN1AiKlrN3fvOvYBWuvovs+N+FMh1rjwQMjex9 bKoPBOPoZjrjlkTkvWNfF5+gWzURYLQe7v6TdgKHv9Kltnc7CSur10HMnqA+tIXD7AoDjp 0F4CMCqu/eEok4ps3uuodZ8aXVgbTUStQRodB/+fOkNbSeZPXuSqIa2XnrjVgQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638656471; a=rsa-sha256; cv=none; b=xMZKIHN1VwRi8+rC94nUdkeddFFLTeefRUvzXaMKw3oc6iijYt+rmIuEC16/Uh4wD59IFM UiUjaygQCaIHbPk8NEm9TyJ8/yApkjB5KTPEkp6tdniqXM/xqQiHVau3LqGHxuerdEwAYw NUCoS3ZyViCXWUSrPMY85J9YcL2bhL1n3nmxL8iw/eeZVX7N7D5Ym2eWztqVF3wld6cFXk 1Sa8SnFafjICTmLHd2CWG1WyklkHg97cCJO30oMY3aEoJph/5fkO1ub2qaADE2BF4ZrTuF 0kmIu6NgmRcUM2ow8JZYmPDJnWwoNviGNmxT0YOmabOG2VTT+WNQ5Xr4si2avQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=79d650f26277b364be45c598dd498bff600bb4a6 commit 79d650f26277b364be45c598dd498bff600bb4a6 Author: Konstantin Belousov AuthorDate: 2021-12-02 03:17:40 +0000 Commit: Konstantin Belousov CommitDate: 2021-12-04 22:20:58 +0000 swapoff(2): document extended syscall arguments Reviewed by: markj Discussed with: alc Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D33165 --- lib/libc/sys/swapon.2 | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/lib/libc/sys/swapon.2 b/lib/libc/sys/swapon.2 index 47acbc2dc178..3a8da8f4f363 100644 --- a/lib/libc/sys/swapon.2 +++ b/lib/libc/sys/swapon.2 @@ -28,7 +28,7 @@ .\" @(#)swapon.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd March 30, 2020 +.Dd December 2, 2021 .Dt SWAPON 2 .Os .Sh NAME @@ -37,6 +37,8 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS +.It vm/vm_param.h +.It vm/swap_pager.h .In unistd.h .Ft int .Fn swapon "const char *special" @@ -63,6 +65,40 @@ The system call disables paging and swapping on the given device. All associated swap metadata are deallocated, and the device is made available for other purposes. +.Pp +The +.Fa special +argument points to either the string that names the special device +used for swapping or the following structure +.Bd -literal +struct swapoff_new_args { + const char *name_old_syscall; + const char *name; + u_int flags; +}; +.Ed +that extends swapoff's interface to include optional flags. +The +.Va name_old_syscall +member must be initialized to +.Dv NULL +for the system to recognize the extended interface. +It is recommended that the whole structure be zeroed for future +compatibility, due to padding. +.Pp +The +.Va name +string is the special device name, same as legacy syscall argument. +.The +.Va flags +argument takes the following flags: +.Bl -tag -width SWAPOFF_FORCE +.It Dv SWAPOFF_FORCE +Overrides a very conservative check that prevents swapoff +if the total amount of free memory and remaining swap +devices space might be unsufficient for the system to continue +operating. +.El .Sh RETURN VALUES If an error has occurred, a value of -1 is returned and .Va errno