Add an option (-M) to install to disable use of mmap(2). This is kinda

handy at the moment with -current's mmap+unlink interactions..  The
problems seem worst when using INSTALL="install -C" in /etc/make.conf.
This could well come in handy in the future too.
This commit is contained in:
Peter Wemm 1998-01-11 11:43:36 +00:00
parent 5905ba8289
commit ff8962446b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=32429
2 changed files with 14 additions and 7 deletions

View file

@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" From: @(#)install.1 8.1 (Berkeley) 6/6/93
.\" $Id: install.1,v 1.9 1997/02/22 19:57:54 peter Exp $
.\" $Id: install.1,v 1.10 1997/08/27 06:29:23 charnier Exp $
.\"
.Dd September 22, 1996
.Dt INSTALL 1
@ -40,14 +40,14 @@
.Nd install binaries
.Sh SYNOPSIS
.Nm install
.Op Fl CcDps
.Op Fl CcDMps
.Op Fl f Ar flags
.Op Fl g Ar group
.Op Fl m Ar mode
.Op Fl o Ar owner
.Ar file1 file2
.Nm install
.Op Fl CcDps
.Op Fl CcDMps
.Op Fl f Ar flags
.Op Fl g Ar group
.Op Fl m Ar mode
@ -107,6 +107,9 @@ Specify the target's file flags; see
for a list of possible flags and their meanings.
.It Fl g
Specify a group. A numeric GID is allowed.
.It Fl M
Disable all use of
.Xr mmap 2 .
.It Fl m
Specify an alternate mode.
The default mode is set to rwxr-xr-x (0755).
@ -162,6 +165,7 @@ are created in the target directory.
.Xr cp 1 ,
.Xr mv 1 ,
.Xr strip 1 ,
.Xr mmap 2 ,
.Xr chown 8
.Sh HISTORY
The

View file

@ -42,7 +42,7 @@ static const char copyright[] =
static char sccsid[] = "From: @(#)xinstall.c 8.1 (Berkeley) 7/21/93";
#endif
static const char rcsid[] =
"$Id: xinstall.c,v 1.27 1997/10/28 14:20:10 ache Exp $";
"$Id: xinstall.c,v 1.28 1998/01/09 06:05:13 jb Exp $";
#endif /* not lint */
/*-
@ -87,7 +87,7 @@ static const char rcsid[] =
#define MAP_FAILED ((caddr_t)-1) /* from <sys/mman.h> */
#endif
int debug, docompare, docopy, dodir, dopreserve, dostrip, verbose;
int debug, docompare, docopy, dodir, dopreserve, dostrip, verbose, nommap;
int mode = S_IRWXU|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH;
char *group, *owner, pathbuf[MAXPATHLEN];
char pathbuf2[MAXPATHLEN];
@ -136,7 +136,7 @@ main(argc, argv)
char *flags, *to_name;
iflags = 0;
while ((ch = getopt(argc, argv, "CcdDf:g:m:o:psv")) != -1)
while ((ch = getopt(argc, argv, "CcdDf:g:m:Mo:psv")) != -1)
switch((char)ch) {
case 'C':
docompare = docopy = 1;
@ -165,6 +165,9 @@ main(argc, argv)
optarg);
mode = getmode(set, 0);
break;
case 'M':
nommap = 1;
break;
case 'o':
owner = optarg;
break;
@ -711,7 +714,7 @@ trymmap(fd)
{
struct statfs stfs;
if (fstatfs(fd, &stfs) < 0)
if (nommap || fstatfs(fd, &stfs) < 0)
return 0;
/* NetBSD MOUNT_XXX defines are strings, but doesn't have a MOUNT_NONE. */