No need in procfs(5).
MFC after: 2 weeks
This commit is contained in:
parent
ee5169dc9d
commit
57c87bfabb
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=227840
@ -29,7 +29,7 @@
|
|||||||
.\" @(#)ps.1 8.3 (Berkeley) 4/18/94
|
.\" @(#)ps.1 8.3 (Berkeley) 4/18/94
|
||||||
.\" $FreeBSD$
|
.\" $FreeBSD$
|
||||||
.\"
|
.\"
|
||||||
.Dd October 30, 2011
|
.Dd November 22, 2011
|
||||||
.Dt PS 1
|
.Dt PS 1
|
||||||
.Os
|
.Os
|
||||||
.Sh NAME
|
.Sh NAME
|
||||||
@ -686,9 +686,6 @@ attempts to automatically determine the terminal width.
|
|||||||
.Bl -tag -width ".Pa /boot/kernel/kernel" -compact
|
.Bl -tag -width ".Pa /boot/kernel/kernel" -compact
|
||||||
.It Pa /boot/kernel/kernel
|
.It Pa /boot/kernel/kernel
|
||||||
default system namelist
|
default system namelist
|
||||||
.It Pa /proc
|
|
||||||
the mount point of
|
|
||||||
.Xr procfs 5
|
|
||||||
.El
|
.El
|
||||||
.Sh SEE ALSO
|
.Sh SEE ALSO
|
||||||
.Xr kill 1 ,
|
.Xr kill 1 ,
|
||||||
|
21
bin/ps/ps.c
21
bin/ps/ps.c
@ -130,7 +130,6 @@ struct listinfo {
|
|||||||
} l;
|
} l;
|
||||||
};
|
};
|
||||||
|
|
||||||
static int check_procfs(void);
|
|
||||||
static int addelem_gid(struct listinfo *, const char *);
|
static int addelem_gid(struct listinfo *, const char *);
|
||||||
static int addelem_pid(struct listinfo *, const char *);
|
static int addelem_pid(struct listinfo *, const char *);
|
||||||
static int addelem_tty(struct listinfo *, const char *);
|
static int addelem_tty(struct listinfo *, const char *);
|
||||||
@ -410,14 +409,6 @@ main(int argc, char *argv[])
|
|||||||
argc -= optind;
|
argc -= optind;
|
||||||
argv += optind;
|
argv += optind;
|
||||||
|
|
||||||
/*
|
|
||||||
* If the user specified ps -e then they want a copy of the process
|
|
||||||
* environment kvm_getenvv(3) attempts to open /proc/<pid>/mem.
|
|
||||||
* Check to make sure that procfs is mounted on /proc, otherwise
|
|
||||||
* print a warning informing the user that output will be incomplete.
|
|
||||||
*/
|
|
||||||
if (needenv == 1 && check_procfs() == 0)
|
|
||||||
warnx("Process environment requires procfs(5)");
|
|
||||||
/*
|
/*
|
||||||
* If there arguments after processing all the options, attempt
|
* If there arguments after processing all the options, attempt
|
||||||
* to treat them as a list of process ids.
|
* to treat them as a list of process ids.
|
||||||
@ -1360,18 +1351,6 @@ kludge_oldps_options(const char *optlist, char *origval, const char *nextarg)
|
|||||||
return (newopts);
|
return (newopts);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
|
||||||
check_procfs(void)
|
|
||||||
{
|
|
||||||
struct statfs mnt;
|
|
||||||
|
|
||||||
if (statfs("/proc", &mnt) < 0)
|
|
||||||
return (0);
|
|
||||||
if (strcmp(mnt.f_fstypename, "procfs") != 0)
|
|
||||||
return (0);
|
|
||||||
return (1);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
usage(void)
|
usage(void)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user