From 9d796422b1a40106c10bd9f66349f826c4883122 Mon Sep 17 00:00:00 2001 From: David van Moolenbroek Date: Thu, 19 Nov 2015 14:59:41 +0000 Subject: [PATCH] Import NetBSD pagesize(1) Change-Id: I6a749cba5c6dabb3daea8c5bad3e94be342833d7 --- distrib/sets/lists/minix-base/mi | 1 + distrib/sets/lists/minix-man/mi | 1 + usr.bin/Makefile | 2 +- usr.bin/pagesize/Makefile | 7 +++++ usr.bin/pagesize/pagesize.1 | 54 ++++++++++++++++++++++++++++++++ usr.bin/pagesize/pagesize.sh | 42 +++++++++++++++++++++++++ 6 files changed, 106 insertions(+), 1 deletion(-) create mode 100644 usr.bin/pagesize/Makefile create mode 100644 usr.bin/pagesize/pagesize.1 create mode 100644 usr.bin/pagesize/pagesize.sh diff --git a/distrib/sets/lists/minix-base/mi b/distrib/sets/lists/minix-base/mi index 495ec2bdc..5c41e4950 100644 --- a/distrib/sets/lists/minix-base/mi +++ b/distrib/sets/lists/minix-base/mi @@ -420,6 +420,7 @@ ./usr/bin/od minix-base ./usr/bin/openssl minix-base crypto ./usr/bin/page minix-base +./usr/bin/pagesize minix-base ./usr/bin/part minix-base ./usr/bin/partition minix-base ./usr/bin/passwd minix-base diff --git a/distrib/sets/lists/minix-man/mi b/distrib/sets/lists/minix-man/mi index c49176705..527dcb8fd 100644 --- a/distrib/sets/lists/minix-man/mi +++ b/distrib/sets/lists/minix-man/mi @@ -278,6 +278,7 @@ ./usr/man/man1/openssl_x509.1 minix-man crypto ./usr/man/man1/openssl_x509v3_config.1 minix-man crypto ./usr/man/man1/page.1 minix-man +./usr/man/man1/pagesize.1 minix-man ./usr/man/man1/passwd.1 minix-man ./usr/man/man1/paste.1 minix-man ./usr/man/man1/patch.1 minix-man diff --git a/usr.bin/Makefile b/usr.bin/Makefile index d2700aa43..cb2eea606 100644 --- a/usr.bin/Makefile +++ b/usr.bin/Makefile @@ -20,7 +20,7 @@ SUBDIR= asa \ mkdep mkfifo mkstr mktemp \ msgc \ nbperf newgrp nice nl nohup \ - passwd paste patch pathchk pr \ + pagesize passwd paste patch pathchk pr \ printenv printf pwhash \ renice rev rsh \ \ diff --git a/usr.bin/pagesize/Makefile b/usr.bin/pagesize/Makefile new file mode 100644 index 000000000..8986d62f9 --- /dev/null +++ b/usr.bin/pagesize/Makefile @@ -0,0 +1,7 @@ +# @(#)Makefile 8.2 (Berkeley) 4/3/94 +# $NetBSD: Makefile,v 1.8 1997/03/24 21:59:47 christos Exp $ + +MAN= pagesize.1 +SCRIPTS=pagesize.sh + +.include diff --git a/usr.bin/pagesize/pagesize.1 b/usr.bin/pagesize/pagesize.1 new file mode 100644 index 000000000..d693384bf --- /dev/null +++ b/usr.bin/pagesize/pagesize.1 @@ -0,0 +1,54 @@ +.\" $NetBSD: pagesize.1,v 1.8 2003/08/07 11:15:25 agc Exp $ +.\" +.\" Copyright (c) 1983, 1990, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)pagesize.1 8.1 (Berkeley) 6/6/93 +.\" +.Dd June 6, 1993 +.Dt PAGESIZE 1 +.Os +.Sh NAME +.Nm pagesize +.Nd print system page size +.Sh SYNOPSIS +.Nm +.Sh DESCRIPTION +.Nm +prints the size of a page of memory in bytes, as +returned by +.Xr getpagesize 3 . +This program is useful in constructing portable +shell scripts. +.Sh SEE ALSO +.Xr getpagesize 3 +.Sh HISTORY +The +.Nm +command +appeared in +.Bx 4.2 . diff --git a/usr.bin/pagesize/pagesize.sh b/usr.bin/pagesize/pagesize.sh new file mode 100644 index 000000000..31c838228 --- /dev/null +++ b/usr.bin/pagesize/pagesize.sh @@ -0,0 +1,42 @@ +#!/bin/sh - +# +# $NetBSD: pagesize.sh,v 1.3 2000/03/22 17:35:56 tron Exp $ +# +# Copyright (c) 1994 +# The Regents of the University of California. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. All advertising materials mentioning features or use of this software +# must display the following acknowledgement: +# This product includes software developed by the University of +# California, Berkeley and its contributors. +# 4. Neither the name of the University nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# @(#)pagesize.sh 8.1 (Berkeley) 4/3/94 +# + +PATH=/bin:/usr/bin:/sbin:/usr/sbin +export PATH + +exec sysctl -n hw.pagesize -- 2.44.0