Commit Graph

97 Commits

Author SHA1 Message Date
jdolecek 64b598bf33 make some local arrays/variables static + const 2003-04-17 18:08:28 +00:00
jdolecek 98f212db7d use former genfs_eopnotsupp_rele() as genfs_eopnotsupp(), so that vnodes
are vput()/vrele()d as necessary - some filesystems did use the wrong
one for some ops, and it's just safer to not take the chance

based on suggestion by Bill Studenmund
2003-04-10 21:53:32 +00:00
dsl b2aefec351 Remove pointless check against PID_MAX. Let pfind() do the validation.
(The new pid allocation code may decide to allocate pids above PID_MAX.)
2003-04-05 23:32:52 +00:00
jrf a2d850baf8 This addresses PR kerm/19989. Thanks to hamajima@nagoya.ydc.co.jp for submitting this patch which enables /proc/uptime for linux emul. Patch reviewed by atatat@netbsd.org and tron@netbsd.org, approved by tron@netbsd.org. 2003-02-25 21:00:31 +00:00
martin d30bd703a5 Cast off_t expression to long long to match format even on 64 bit
plattforms.

Shouldn't we introduce a PRIoff_t macro to create such format strings?
2003-01-04 15:42:35 +00:00
christos b5e0c9eb5b add LK_CANRECURSE in the locking of /dev/<pid>/fd/<n> and remove the curproc
kludge. Thanks to fvdl.
2003-01-03 13:54:22 +00:00
christos dbe6c38bc2 Implement /proc/<pid>/fd/<n>. This is work in progress. Questionable things:
- Is it ok to convert DTYPE_PIPE to VFIFO and DTYPE_SOCKET to VSOCK?
    - XXX: Avoid locking issue in ls -Rl /proc by avoiding curproc
    - Does I/O to pipes work?
    - XXX: Are there security implications?
2003-01-03 13:21:17 +00:00
simonb c475865f39 Just use the "time" variable in the *_getattr functions instead of a call
to (the potentially expensive) microtime().
2002-08-03 04:52:44 +00:00
thorpej f1f51aa2b8 Move code shared by procfs and the kernel proper out of procfs and
into the kernel proper (renaming functions from procfs_* to process_*).
2002-05-09 15:44:44 +00:00
christos 5ff60a19d9 Don't hide the real return code with EPERM. 2002-01-12 18:51:56 +00:00
chs 5a690c92a1 add a VOP_PUTPAGES method for all the filesystems that don't have pages,
just unlock the interlock.
2001-12-06 04:27:40 +00:00
thorpej 03efee5585 * Allow machine-dependent code to specify hooks for ptrace(2)
(__HAVE_PTRACE_MACHDEP) and procfs (__HAVE_PROCFS_MACHDEP).
  These changes will allow platforms like x86 (XMM) and PowerPC
  (AltiVec) to export extended register sets in a sane manner.

* Use __HAVE_PTRACE_MACHDEP to export x86 XMM registers (standard
  FP + SSE/SSE2) using PT_{GET,SET}XMMREGS (in the machdep
  ptrace request space).
* Use __HAVE_PROCFS_MACHDEP to export x86 XMM registers via
  /proc/N/xmmregs in procfs.
2001-12-05 00:58:05 +00:00
lukem e4b00f433c add RCSIDs 2001-11-10 13:33:40 +00:00
simonb cf63a6b052 Remove some variables that are set but never used. 2001-11-06 07:20:37 +00:00
chs 94d6f3ee95 map files are zero-length. 2001-08-31 04:56:26 +00:00
chs 6e2828061f procfs_bmap() should never be called, make it a "bad op".
let procfs_mmap() use the default error method.
2001-06-03 02:21:35 +00:00
kleink 79283614b3 In procfs_readdir(), give /proc/# directories DT_DIR (rather than DT_REG). 2001-04-14 13:25:46 +00:00
fvdl 49b162566a Bump va_blocksize for the map files some more, so that programs with
quite a few mappings have a chance of being handled correctly if
st_blksize is looked at.
2001-03-30 20:25:11 +00:00
fvdl 2e64bebd3b For -o linux mounts, add some code to emulate /proc/#/maps.
Needs NAMECACHE_ENTER_REVERSE to include filenames.
2001-03-29 22:41:52 +00:00
jdolecek 522f569810 make some more constant arrays 'const' 2001-02-21 21:39:52 +00:00
jdolecek d9466585b7 make filesystem vnodeop, specop, fifoop and vnodeopv_* arrays const 2001-01-22 12:17:35 +00:00
fvdl 4e000b75b2 Add a few linux-style files, only enabled when -o linux is specified
for the mount. Currently these are /proc/cpuinfo and /proc/meminfo.
The former only does something on i386 right now.
2001-01-17 00:09:07 +00:00
chs b0ec16cc38 remove dead code and other misc cleanup. 2000-11-24 18:58:37 +00:00
tv 10d08cc9f2 Only show the "exe" entry to Linux processes, suggested by christos.
Since there are actually three struct emul's for linux, use the e_name
field to determine eligibility with strcmp().
2000-08-09 23:30:49 +00:00
tv ae4dea1dc4 Some versions of Linux libc look for /proc/.../exe instead of /proc/../file.
Add an entry for "exe" that is the same as "file", provided only if
COMPAT_LINUX is set.
2000-08-09 21:08:11 +00:00
thorpej b94e29816f MALLOC()/FREE() are not to be used for variable sized allocations. 2000-08-03 03:39:52 +00:00
mrg 20515f2854 <vm/vm.h> -> <uvm/uvm_extern.h> 2000-06-28 02:44:06 +00:00
simonb 92701d715c Delete duplicate declaration of atopid(). 2000-03-30 02:20:14 +00:00
thorpej 8772062270 Make /proc/self a symlink to /proc/curproc. I've observed Linux programs
that expect /proc/self/cmdline to exist.
1999-09-02 23:33:45 +00:00
sommerfeld 197579af47 Change variable used for directory offset from "int" to "off_t".
Overkill, but avoids a host of truncation problems.
1999-08-25 14:42:35 +00:00
sommerfeld 2e649e46d3 Fix PR8270:
Problem turned out to be due to improper handling of reads beyond EOF:
they should just return without error with the uio unchanged, and the
caller will recognize this as a zero-byte return (EOF).

The previous fix to protect directory reads against bogus uio_offset
values returned EINVAL, which broke mount -o union, which only
union'ed in the lower directory if the upper directory cleanly
returned EOF.

While we're here, protect kernfs as well.
1999-08-24 23:29:08 +00:00
christos 582a6def8b protect against large uio_offset 1999-08-14 02:20:19 +00:00
wrstuden 3bf14d81e9 Add support for fcntl(2) to generate VOP_FCNTL calls. Any fcntl
call with F_FSCTL set and F_SETFL calls generate calls to a new
fileop fo_fcntl. Add genfs_fcntl() and soo_fcntl() which return 0
for F_SETFL and EOPNOTSUPP otherwise. Have all leaf filesystems
use genfs_fcntl().

Reviewed by: thorpej
Tested by: wrstuden
1999-08-03 20:19:16 +00:00
thorpej fc04cf9982 Add calls to lock the proclist as appropriate. 1999-07-25 18:33:47 +00:00
thorpej f9b0db3013 Fix a paste-o in procfs_lookup() introduced with the vnode locking changes.
Fixes PR #7961, Mario Kemper <magick@bundy.lip.owl.de>.
1999-07-14 23:52:22 +00:00
wrstuden 9fc36d6807 Bump osrelease to 1.4E. Add layerfs files, remove null_subr.c.
Update coda to new struct lock in struct vnode.

make fdescfs, kernfs, portalfs, and procfs actually lock their vnodes.
It's not that hard.

Make unionfs set v_vnlock = NULL so any overlayed fs will call its
VOP_LOCK.
1999-07-08 01:26:21 +00:00
christos 8aa2fc5ab8 PR/7143: Jaromir Docelek: Add procfs/cmdline from Linux emulation 1999-03-12 18:45:40 +00:00
msaitoh ea669760d6 Add /proc/#/map. From FreeBSD. 1999-01-25 02:20:08 +00:00
thorpej 970e60efb8 - Use proclists[], rather than checking allproc and zombproc explicitly.
- Add some comments about locking.
1998-09-08 23:50:13 +00:00
kleink 5350df2953 Per POSIX, fail with EINVAL if advisory locking is attempted on a file type
that doesn't support it, rather than using a homegrown EBADF or EOPNOTSUPP.
1998-08-13 10:06:31 +00:00
matthias 574106c52b create miscfs/genfs/genfs_vnops.c:genfs_enoioctl and make all the other
filesystems use it instead of a private version.
1998-08-10 08:11:10 +00:00
perry 4522c799a1 bzero->memset, bcopy->memcpy, bcmp->memcmp 1998-08-09 20:51:08 +00:00
kleink 12a866151b Recognize _PC_SYNC_IO. 1998-08-03 14:19:57 +00:00
fvdl 811dba68c1 procfs_readdir: in case of error, check if cookies actually have
been allocated before freeing them. From Wolfgang Solfrank.
1998-04-21 16:36:37 +00:00
fvdl e5bc90f40c Merge with Lite2 + local changes 1998-03-01 02:20:01 +00:00
fvdl ce56587f15 Bump last argument to VOP_READDIR to off_t (from u_long). 1997-10-10 02:01:05 +00:00
thorpej a79a3ca472 Fix a reversed argument which caused procfs_checkioperm() to always return
"OK".  Add a few comments to avoid further confusion.
1997-08-27 08:52:51 +00:00
thorpej f9777e4a1c Fix the procfs hole described on current-users, similar to a fix for
FreeBSD by Sean Eric Fagan, but a bit different.  This makes the checks
in the same places as sef's FreeBSD patch, but does not hardcode the
"kmem" group into the kernel, and also does a check identical to the
(3) and (4) checks in the NetBSD ptrace(2):

	(1) it's not owned by you, or is set-id on exec (unless
	    you're root), or

	(2) it's init, which controls the security level of the
	    entire system, and the system was not compiled with
	    permanently insecure mode turned on.
1997-08-12 22:47:18 +00:00
mycroft e3f99a9397 Pass the vnode type to vaccess(), and use it when checking VEXEC. Make sure
that the mode bits passed to vaccess() and returned by foo_getattr() contain
only permission bits.
1997-05-08 16:19:43 +00:00
mycroft 4d213ec5e7 Need stat.h. 1997-05-05 07:34:09 +00:00