aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/imgact_gzip.c
Commit message (Collapse)AuthorAgeFilesLines
* VOP_LOCK1() (and so VOP_LOCK()) and VOP_UNLOCK() are only used inAttilio Rao2008-01-131-2/+1
| | | | | | | | | | | | | | conjuction with 'thread' argument passing which is always curthread. Remove the unuseful extra-argument and pass explicitly curthread to lower layer functions, when necessary. KPI results broken by this change, which should affect several ports, so version bumping and manpage update will be further committed. Tested by: kris, pho, Diego Sardina <siarodx at gmail dot com> Notes: svn path=/head/; revision=175294
* vn_lock() is currently only used with the 'curthread' passed as argument.Attilio Rao2008-01-101-1/+1
| | | | | | | | | | | | | | | | | | | Remove this argument and pass curthread directly to underlying VOP_LOCK1() VFS method. This modify makes the code cleaner and in particular remove an annoying dependence helping next lockmgr() cleanup. KPI results, obviously, changed. Manpage and FreeBSD_version will be updated through further commits. As a side note, would be valuable to say that next commits will address a similar cleanup about VFS methods, in particular vop_lock1 and vop_unlock. Tested by: Diego Sardina <siarodx at gmail dot com>, Andrea Di Pasquale <whyx dot it at gmail dot com> Notes: svn path=/head/; revision=175202
* Fix for the panic("vm_thread_new: kstack allocation failed") andKonstantin Belousov2007-11-051-1/+5
| | | | | | | | | | | | | | | | | | | | | | | silent NULL pointer dereference in the i386 and sparc64 pmap_pinit() when the kmem_alloc_nofault() failed to allocate address space. Both functions now return error instead of panicing or dereferencing NULL. As consequence, vmspace_exec() and vmspace_unshare() returns the errno int. struct vmspace arg was added to vm_forkproc() to avoid dealing with failed allocation when most of the fork1() job is already done. The kernel stack for the thread is now set up in the thread_alloc(), that itself may return NULL. Also, allocation of the first process thread is performed in the fork1() to properly deal with stack allocation failure. proc_linkup() is separated into proc_linkup() called from fork1(), and proc_linkup0(), that is used to set up the kernel process (was known as swapper). In collaboration with: Peter Holm Reviewed by: jhb Notes: svn path=/head/; revision=173361
* Maintain the lock on the vnode for most of exec_elfN_imgact().Alan Cox2005-12-241-0/+13
| | | | | | | | | | | | | | | | Specifically, it is required for the I/O that may be performed by elfN_load_section(). Avoid an obscure deadlock in the a.out, elf, and gzip image activators. Add a comment describing why the deadlock does not occur in the common case and how it might occur in less usual circumstances. Eliminate an unused variable from exec_aout_imgact(). In collaboration with: tegge Notes: svn path=/head/; revision=153698
* - Change the vm_mmap() function to accept an objtype_t parameter specifyingJohn Baldwin2005-04-011-2/+4
| | | | | | | | | | | | | | | the type of object represented by the handle argument. - Allow vm_mmap() to map device memory via cdev objects in addition to vnodes and anonymous memory. Note that mmaping a cdev directly does not currently perform any MAC checks like mapping a vnode does. - Unbreak the DRM getbufs ioctl by having it call vm_mmap() directly on the cdev the ioctl is acting on rather than trying to find a suitable vnode to map from. Reviewed by: alc, arch@ Notes: svn path=/head/; revision=144501
* o Split out kernel part of execve(2) syscall into two parts: one thatMaxim Sobolev2005-01-291-6/+0
| | | | | | | | | | | | | | copies arguments into the kernel space and one that operates completely in the kernel space; o use kernel-only version of execve(2) to kill another stackgap in linuxlator/i386. Obtained from: DragonFlyBSD (partially) MFC after: 2 weeks Notes: svn path=/head/; revision=140992
* /* -> /*- for copyright notices, minor format tweaks as necessaryWarner Losh2005-01-061-3/+4
| | | | Notes: svn path=/head/; revision=139804
* Locking for the per-process resource limits structure.John Baldwin2004-02-041-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - struct plimit includes a mutex to protect a reference count. The plimit structure is treated similarly to struct ucred in that is is always copy on write, so having a reference to a structure is sufficient to read from it without needing a further lock. - The proc lock protects the p_limit pointer and must be held while reading limits from a process to keep the limit structure from changing out from under you while reading from it. - Various global limits that are ints are not protected by a lock since int writes are atomic on all the archs we support and thus a lock wouldn't buy us anything. - All accesses to individual resource limits from a process are abstracted behind a simple lim_rlimit(), lim_max(), and lim_cur() API that return either an rlimit, or the current or max individual limit of the specified resource from a process. - dosetrlimit() was renamed to kern_setrlimit() to match existing style of other similar syscall helper functions. - The alpha OSF/1 compat layer no longer calls getrlimit() and setrlimit() (it didn't used the stackgap when it should have) but uses lim_rlimit() and kern_setrlimit() instead. - The svr4 compat no longer uses the stackgap for resource limits calls, but uses lim_rlimit() and kern_setrlimit() instead. - The ibcs2 compat no longer uses the stackgap for resource limits. It also no longer uses the stackgap for accessing sysctl's for the ibcs2_sysconf() syscall but uses kernel_sysctl() instead. As a result, ibcs2_sysconf() no longer needs Giant. - The p_rlimit macro no longer exists. Submitted by: mtm (mostly, I only did a few cleanups and catchups) Tested on: i386 Compiled on: alpha, amd64 Notes: svn path=/head/; revision=125454
* Use __FBSDID().David E. O'Brien2003-06-111-1/+3
| | | | Notes: svn path=/head/; revision=116182
* Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,Jens Schweikhardt2003-01-011-1/+1
| | | | | | | especially in troff files. Notes: svn path=/head/; revision=108533
* Use the fields in the sysentvec and in the vm map header in place of theJake Burkholder2002-09-211-1/+1
| | | | | | | | | | | constants VM_MIN_ADDRESS, VM_MAXUSER_ADDRESS, USRSTACK and PS_STRINGS. This is mainly so that they can be variable even for the native abi, based on different machine types. Get stack protections from the sysentvec too. This makes it trivial to map the stack non-executable for certain abis, on machines that support it. Notes: svn path=/head/; revision=103767
* Infrastructure tweaks to allow having both an Elf32 and an Elf64 executablePeter Wemm2002-07-201-1/+1
| | | | | | | | | | | | | | | | | | handler in the kernel at the same time. Also, allow for the exec_new_vmspace() code to build a different sized vmspace depending on the executable environment. This is a big help for execing i386 binaries on ia64. The ELF exec code grows the ability to map partial pages when there is a page size difference, eg: emulating 4K pages on 8K or 16K hardware pages. Flesh out the i386 emulation support for ia64. At this point, the only binary that I know of that fails is cvsup, because the cvsup runtime tries to execute code in pages not marked executable. Obtained from: dfr (mostly, many tweaks from me). Notes: svn path=/head/; revision=100384
* Modernize my email address.Poul-Henning Kamp2002-03-251-1/+1
| | | | Notes: svn path=/head/; revision=93149
* Remove __P.Alfred Perlstein2002-03-191-4/+4
| | | | Notes: svn path=/head/; revision=92723
* Make MAXTSIZ, DFLDSIZ, MAXDSIZ, DFLSSIZ, MAXSSIZ, SGROWSIZ loaderPaul Saab2001-10-101-1/+1
| | | | | | | | | | tunable. Reviewed by: peter MFC after: 2 weeks Notes: svn path=/head/; revision=84783
* Undo part of the tangle of having sys/lock.h and sys/mutex.h included inMark Murray2001-05-011-1/+2
| | | | | | | | | | | | | | other "system" header files. Also help the deprecation of lockmgr.h by making it a sub-include of sys/lock.h and removing sys/lockmgr.h form kernel .c files. Sort sys/*.h includes where possible in affected files. OK'ed by: bde (with reservations) Notes: svn path=/head/; revision=76166
* Fix a typo.John Baldwin2001-01-241-1/+1
| | | | | | | Reported by: albert Notes: svn path=/head/; revision=71517
* Proc locking.John Baldwin2001-01-241-0/+1
| | | | Notes: svn path=/head/; revision=71497
* useracc() the prequel:Poul-Henning Kamp1999-10-291-1/+0
| | | | | | | | | | | | | | Merge the contents (less some trivial bordering the silly comments) of <vm/vm_prot.h> and <vm/vm_inherit.h> into <vm/vm.h>. This puts the #defines for the vm_inherit_t and vm_prot_t types next to their typedefs. This paves the road for the commit to follow shortly: change useracc() to use VM_PROT_{READ|WRITE} rather than B_{READ|WRITE} as argument. Notes: svn path=/head/; revision=52635
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50477
* Correctly return ENOEXEC for really short zipped files. The way this isTim Vanderhoek1999-06-211-1/+10
| | | | | | | | | | | done is less-than cute, but this whole file is suffering from some amount of bitrot. Execution of zipped files should probably be implemented in a manner similar to that of #!/interpreted files. PR: kern/10780 Notes: svn path=/head/; revision=48079
* Fix a couple of warnings and some bitrot in comments.Peter Wemm1999-05-091-4/+1
| | | | Notes: svn path=/head/; revision=46803
* *_execsw static structures cannot be const due to the way they interactMatthew Dillon1999-01-291-2/+2
| | | | | | | | | with EXEC_SET, DECLARE_MODULE, and module_register. Specifically, module_register. We may eventually be able to make these const, but not now. Notes: svn path=/head/; revision=43402
* *gulp*. Jordan specifically OK'ed this..Peter Wemm1998-10-161-2/+2
| | | | | | | | | | | This is the bulk of the support for doing kld modules. Two linker_sets were replaced by SYSINIT()'s. VFS's and exec handlers are self registered. kld is now a superset of lkm. I have converted most of them, they will follow as a seperate commit as samples. This all still works as a static a.out kernel using LKM's. Notes: svn path=/head/; revision=40435
* Cast u_longs to uintptr_t before casting them to pointers. Don'tBruce Evans1998-07-151-6/+7
| | | | | | | | attempt to even partially support systems with function pointers larger than object pointers. Notes: svn path=/head/; revision=37656
* Use copyout() instead of bcopy() to copy the image to user space.Bruce Evans1998-06-161-5/+7
| | | | | | | | | | | | bcopy() caused panics under heavy paging (not quite as suspected - the kernel stack seemed to get corrupted). Fixed long lines. Reviewed by: phk Notes: svn path=/head/; revision=37015
* Make gzipped dynamically linked executables work again. There wasJohn Polstra1997-12-141-4/+4
| | | | | | | | | an old bug here that failed to copy the a.out header into memory properly. It didn't matter until changes were made recently to the dynamic linker. Notes: svn path=/head/; revision=31718
* Removed unused #includes.Bruce Evans1997-09-021-3/+1
| | | | Notes: svn path=/head/; revision=29041
* Removed redundant test against MAXDSIZ (the rlimit test is stronger).Bruce Evans1997-08-261-4/+1
| | | | Notes: svn path=/head/; revision=28765
* Fully implement vfork. Vfork is now much much faster than even ourJohn Dyson1997-04-131-2/+4
| | | | | | | | | | | | | | | | | | | | fork. (On my machine, fork is about 240usecs, vfork is 78usecs.) Implement rfork(!RFPROC !RFMEM), which allows a thread to divorce its memory from the other threads of a group. Implement rfork(!RFPROC RFCFDG), which closes all file descriptors, eliminating possible existing shares with other threads/processes. Implement rfork(!RFPROC RFFDG), which divorces the file descriptors for a thread from the rest of the group. Fix the case where a thread does an exec. It is almost nonsense for a thread to modify the other threads address space by an exec, so we now automatically divorce the address space before modifying it. Notes: svn path=/head/; revision=24848
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notPeter Wemm1997-02-221-1/+1
| | | | | | | ready for it yet. Notes: svn path=/head/; revision=22975
* This is the kernel Lite/2 commit. There are some requisite userlandJohn Dyson1997-02-101-1/+1
| | | | | | | | | | | | | | | | | | changes, so don't expect to be able to run the kernel as-is (very well) without the appropriate Lite/2 userland changes. The system boots and can mount UFS filesystems. Untested: ext2fs, msdosfs, NFS Known problems: Incorrect Berkeley ID strings in some files. Mount_std mounts will not work until the getfsent library routine is changed. Reviewed by: various people Submitted by: Jeffery Hsu <hsu@freebsd.org> Notes: svn path=/head/; revision=22521
* Make the long-awaited change from $Id$ to $FreeBSD$Jordan K. Hubbard1997-01-141-1/+1
| | | | | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise. Notes: svn path=/head/; revision=21673
* Make DFLDSIZ and MAXDSIZ fully-supported options.Joerg Wunsch1996-12-221-1/+3
| | | | | | | "Don't forget to do a ``make depend''" :-) Notes: svn path=/head/; revision=20821
* Fixed the easy cases of const poisoning in the kernel. Cosmetic.Bruce Evans1996-08-311-2/+2
| | | | Notes: svn path=/head/; revision=17974
* Write protect the text segment of gzip'ed programs.Poul-Henning Kamp1996-08-011-27/+21
| | | | | | | | | | Various other cleanups by phk. Reviewed by: phk Submitted by: Igor Khasilev <igor@jabber.paco.odessa.ua> Notes: svn path=/head/; revision=17386
* First pass at cleaning up macros relating to pages, clusters and all that.Poul-Henning Kamp1996-05-021-7/+6
| | | | Notes: svn path=/head/; revision=15538
* Removed unnecessary #includes from <sys/imgact.h> so that it isBruce Evans1996-05-011-1/+3
| | | | | | | self-sufficient and added explicit #includes where required. Notes: svn path=/head/; revision=15494
* Fixed unsigned longs that should have been vm_offset_t.Bruce Evans1996-03-191-2/+2
| | | | | | | | | | | | | vm_offset_t is currently unsigned long but should probably be plain unsigned for i386's to match the choice of minimal types to represent for fixed-width types in Lite2. Anyway, it shouldn't be assumed to be unsigned long. I only fixed the type mismatches that were detected when I changed vm_offset_t to unsigned. Only pointer type mismatches were detected. Notes: svn path=/head/; revision=14703
* rewrap some long lines.Poul-Henning Kamp1996-02-131-6/+8
| | | | Notes: svn path=/head/; revision=14087
* Eliminated many redundant vm_map_lookup operations for vm_mmap.John Dyson1996-01-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Speed up for vfs_bio -- addition of a routine bqrelse to greatly diminish overhead for merged cache. Efficiency improvement for vfs_cluster. It used to do alot of redundant calls to cluster_rbuild. Correct the ordering for vrele of .text and release of credentials. Use the selective tlb update for 486/586/P6. Numerous fixes to the size of objects allocated for files. Additionally, fixes in the various pagers. Fixes for proper positioning of vnode_pager_setsize in msdosfs and ext2fs. Fixes in the swap pager for exhausted resources. The pageout code will not as readily thrash. Change the page queue flags (PG_ACTIVE, PG_INACTIVE, PG_FREE, PG_CACHE) into page queue indices (PQ_ACTIVE, PQ_INACTIVE, PQ_FREE, PQ_CACHE), thereby improving efficiency of several routines. Eliminate even more unnecessary vm_page_protect operations. Significantly speed up process forks. Make vm_object_page_clean more efficient, thereby eliminating the pause that happens every 30seconds. Make sequential clustered writes B_ASYNC instead of B_DELWRI even in the case of filesystems mounted async. Fix a panic with busy pages when write clustering is done for non-VMIO buffers. Notes: svn path=/head/; revision=13490
* Untangled the vm.h include file spaghetti.David Greenman1995-12-071-1/+7
| | | | Notes: svn path=/head/; revision=12662
* Staticized.Bruce Evans1995-12-021-2/+3
| | | | | | | Added prototypes. Notes: svn path=/head/; revision=12568
* All:David Greenman1995-11-061-6/+6
| | | | | | | | | | | | | | | Changed vnodep -> vp for consistency with the rest of the kernel, and changed iparams -> imgp for brevity. kern_exec.c: Explicitly initialized some additional parts of the image_params struct to avoid bzeroing it. Rewrote the set-id code to reduce the number of logical tests. The rewrite exposed a mostly benign bug in the algorithm: traced set-id images would get ktracing disabled even if the set-id didn't happen for other reasons. Notes: svn path=/head/; revision=12130
* Remove trailing whitespace.Rodney W. Grimes1995-05-301-2/+2
| | | | Notes: svn path=/head/; revision=8876
* Add and move declarations to fix all of the warnings from `gcc -Wimplicit'Bruce Evans1995-03-161-3/+1
| | | | | | | | | (except in netccitt, netiso and netns) and most of the warnings from `gcc -Wnested-externs'. Fix all the bugs found. There were no serious ones. Notes: svn path=/head/; revision=7090
* Use of vm_allocate() and vm_deallocate() has been deprecated.David Greenman1995-02-201-15/+17
| | | | Notes: svn path=/head/; revision=6579
* Actually access the right first page if the file.Poul-Henning Kamp1995-02-131-2/+2
| | | | | | | | | | Bruce finally caught this bogon for me, Thank you Bruce ! Due to some part of the VM/buffer/pmap magic doing clustering, this bogon managed to work better than 99.9% of the time. Amazing. If You ever again see a weird message from the gzip code, please tell me. Notes: svn path=/head/; revision=6342
* Make the diagnostics a little more useful.Poul-Henning Kamp1994-10-221-2/+3
| | | | | | | | | | | | | | | | | | | | | | | A word of wisdom, don't do this: | cd /usr/bin | for i in * | do | cp $i /tmp/a | gzip -9 < /tmp/a > $i | done It will compress files with multiple links several times. do it this way: | cd /usr/bin | for i in * | do | gunzip -f < $i > /tmp/a | gzip -9 < /tmp/a > $i | done Notes: svn path=/head/; revision=3785
* I belive imgact_gzip is finally reentrant. It is also a whole lot morePoul-Henning Kamp1994-10-221-217/+298
| | | | | | | | | | readable. inflate is now much more general, and is there if anybody feels like making a uncompressing filesystem or something like that (hint hint !) Notes: svn path=/head/; revision=3784