summaryrefslogtreecommitdiffstats
path: root/sys/kern/sys_generic.c
Commit message (Collapse)AuthorAgeFilesLines
* Add standard padding argument to pread and pwrite syscall. That should make themdt1999-04-041-129/+89
| | | | | | | | | NetBSD compatible. Add parameter to fo_read and fo_write. (The only flag FOF_OFFSET mean that the offset is set in the struct uio). Factor out some common code from read/pread/write/pwrite syscalls.
* Added pread and pwrite. These functions are defined by the X/Openalc1999-03-271-1/+132
| | | | | | Threads Extension. (Note: We use the same syscall numbers as NetBSD.) Submitted by: John Plevyak <jplevyak@inktomi.com>
* Removed a bogus cast to c_caddr_t. This is part of terminatingbde1999-01-291-2/+2
| | | | | | | | | | | | | | | | c_caddr_t with extreme prejudice. Here the point of the original cast to caddr_t was to break the warning about the const mismatch between write(2)'s `const void *buf' and `struct uio's `char *iov_base' (previous bitrot gave a gratuitous dependency on caddr_t being char *). Compiling with -Wcast-qual made the cast a full no-op. This change has no effect on the warning for discarding `const' on assignment to iov_base. The warning should not be fixed by splitting `struct iovec' into a non-const version for read() and a const version for write(), since correct const poisoning would affect all pointers to i/o addresses. Const'ness should probably be forgotten by not declaring it in syscalls.master.
* Fix warnings in preparation for adding -Wall -Wcast-qual to thedillon1999-01-271-2/+2
| | | | kernel compile
* poll(2) sets POLLNVAL for descriptors passed in that are less thanjkh1998-12-101-2/+4
| | | | | | | | 0. This makes it difficult to do efficient manipulation of the struct pollfd since you can't leave a slot empty. PR: 8599 Submitted-by: Marc Slemko <marcs@znep.com>
* Installed the second patch attached to kern/7899 with some changes suggestedtruckman1998-11-111-32/+1
| | | | | | | | | | | | | | | | by bde, a few other tweaks to get the patch to apply cleanly again and some improvements to the comments. This change closes some fairly minor security holes associated with F_SETOWN, fixes a few bugs, and removes some limitations that F_SETOWN had on tty devices. For more details, see the description on the PR. Because this patch increases the size of the proc and pgrp structures, it is necessary to re-install the includes and recompile libkvm, the vinum lkm, fstat, gcore, gdb, ipfilter, ps, top, and w. PR: kern/7899 Reviewed by: bde, elvind
* Fixed bogotification of pseudocode for syscall args by rev.1.53 ofbde1998-09-051-5/+5
| | | | syscalls.master.
* Change various syscalls to use size_t arguments instead of u_int.dfr1998-08-241-10/+12
| | | | | | | | | | Add some overflow checks to read/write (from bde). Change all modifications to vm_page::flags, vm_page::busy, vm_object::flags and vm_object::paging_in_progress to use operations which are not interruptable. Reviewed by: Bruce Evans <bde@zeta.org.au>
* 64bit fixes: use u_long not int for ioctl command.dfr1998-06-101-2/+3
|
* s/nanoruntime/nanouptime/gphk1998-05-171-5/+5
| | | | | | s/microruntime/microuptime/g Reviewed by: bde
* Remove unused atv.tv_usec = 0; from select/poll codeache1998-04-051-7/+3
|
* Time changes mark 2:phk1998-04-041-21/+37
| | | | | | | | | | | | | | | | | * Figure out UTC relative to boottime. Four new functions provide time relative to boottime. * move "runtime" into struct proc. This helps fix the calcru() problem in SMP. * kill mono_time. * add timespec{add|sub|cmp} macros to time.h. (XXX: These may change!) * nanosleep, select & poll takes long sleeps one day at a time Reviewed by: bde Tested by: ache and others
* Try to fix poll & select after I broke them.phk1998-04-021-11/+9
|
* Eradicate the variable "time" from the kernel, using various measures.phk1998-03-301-16/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "time" wasn't a atomic variable, so splfoo() protection were needed around any access to it, unless you just wanted the seconds part. Most uses of time.tv_sec now uses the new variable time_second instead. gettime() changed to getmicrotime(0. Remove a couple of unneeded splfoo() protections, the new getmicrotime() is atomic, (until Bruce sets a breakpoint in it). A couple of places needed random data, so use read_random() instead of mucking about with time which isn't random. Add a new nfs_curusec() function. Mark a couple of bogosities involving the now disappeard time variable. Update ffs_update() to avoid the weird "== &time" checks, by fixing the one remaining call that passwd &time as args. Change profiling in ncr.c to use ticks instead of time. Resolution is the same. Add new function "tvtohz()" to avoid the bogus "splfoo(), add time, call hzto() which subtracts time" sequences. Reviewed by: bde
* Fixed some style bugs in the poll() code.bde1997-11-231-18/+8
| | | | | Removed dead code to "Avoid inadvertently sleeping forever". hzto() never returns 0.
* Move the "retval" (3rd) parameter from all syscall functions and putphk1997-11-061-34/+25
| | | | | | | | | | | | it in struct proc instead. This fixes a boatload of compiler warning, and removes a lot of cruft from the sources. I have not removed the /*ARGSUSED*/, they will require some looking at. libkvm, ps and other userland struct proc frobbing programs will need recompiled.
* Last major round (Unless Bruce thinks of somthing :-) of malloc changes.phk1997-10-121-3/+4
| | | | | | | | Distribute all but the most fundamental malloc types. This time I also remembered the trick to making things static: Put "static" in front of them. A couple of finer points by: bde
* Distribute and statizice a lot of the malloc M_* types.phk1997-10-111-1/+4
| | | | Substantial input from: bde
* Implement poll(2). This is mostly taken from the NetBSD implementationpeter1997-09-141-6/+158
| | | | | | (from some time ago) but with a few tweaks along the way. Obtained from: NetBSD
* Removed unused #includes.bde1997-09-021-5/+1
|
* Modifications to existing files to support the initial AIO/LIO anddyson1997-06-161-1/+5
| | | | kernel based threading support.
* Don't include <sys/ioctl.h> in the kernel. Stage 4: includebde1997-03-241-2/+3
| | | | | | | | <sys/ttycom.h> and sometimes <sys/filio.h> instead of <sys/ioctl.h> in miscellaneous files. Most of these files have nothing to do with ttys but need to include <sys/ttycom.h> to get the definitions of TIOC[SG]PGRP which are (ab)used to convert F[SG]ETOWN fcntls into ioctls.
* Don't #include <sys/fcntl.h> in <sys/file.h> if KERNEL is defined.bde1997-03-231-1/+2
| | | | | Fixed everything that depended on getting fcntl.h stuff from the wrong place. Most things don't depend on file.h stuff at all.
* Removed `volatile' from declaration of `time', and removed the resultingbde1997-03-221-2/+2
| | | | | | | | null casts. `time' is nonvolatile for accesses within a region locked by splclock()/splx(). Accesses outside such a region are invalid, and splx() must have the side effect of potentially changing all global variables (since there are hundreds of sort of volatile variables like `time'), so declaring `time' as volatile didn't have any real benefits.
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notpeter1997-02-221-1/+1
| | | | ready for it yet.
* Improved select():bde1997-02-201-36/+51
| | | | | | | | | | | | | | | - avoid malloc() if the number of fds is small. - pack the bits better so that `small' is quite large. - don't waste time generating zero bits for null fd_set pointers or scanning these bits. Possibly improved select(): - free malloc()ed storage before returning. This is simpler and I think huge select()s aren't worth optimizing since they are rare, relative gain would be small and there would be tiny costs for all selects(). Reviewed by: ache (first version by him too)
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-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.
* Fix a minor style error in my code.smpatel1996-08-201-2/+2
|
* Remove the kernel FD_SETSIZE limit for select().smpatel1996-08-201-15/+43
| | | | | | Make select()'s first argument 'int' not 'u_int'. Reviewed by: bde
* Converted two options over to the new scheme: USER_LDT and KTRACE.wollman1996-01-031-1/+3
|
* A Major staticize sweep. Generates a couple of warnings that I'll dealphk1995-12-141-4/+5
| | | | | | with later. A number of unused vars removed. A number of unused procs removed or #ifdefed.
* Included <sys/sysproto.h> to get central declarations for syscall argsbde1995-11-121-1/+14
| | | | | | | | | | structs and prototypes for syscalls. Ifdefed duplicated decentralized declarations of args structs. It's convenient to have this visible but they are hard to maintain. Some are already different from the central declarations. 4.4lite2 puts them in comments in the function headers but I wanted to avoid the large changes for that.
* Fixed the type of readv(). An args struct member name conflicted with thebde1995-11-111-5/+5
| | | | machine-generated one in <sys/sysproto.h>.
* Remove the ugly COMPAT_IBCS2 hack to hide a return value throughswallace1995-10-101-29/+1
| | | | | | magic numbers. The new socksys support does not need this hack. I am against any magic practicing.
* Remove trailing whitespace.rgrimes1995-05-301-2/+2
|
* Backed out previous change - it reduces performance. (oops).dg1995-04-131-2/+4
|
* Slight optimization to select().dg1995-04-131-4/+2
|
* Damn, check in the wrong version, fixed.sos1994-10-131-3/+3
| | | | | | Reviewed by: Submitted by: Obtained from:
* Made it possible for ioctl to return a value.sos1994-10-131-1/+29
| | | | | Ifdef by COMPAT_IBCS2 (used by the socksys system). Submitted by: Mostyn Lewis (mostyn@mrl.com)
* Cosmetics. related to getting prototypes into view.phk1994-10-101-1/+3
|
* All of this is cosmetic. prototypes, #includes, printfs and so on. Makesphk1994-10-021-1/+4
| | | | GCC a lot more silent.
* While in the real world, I had a bad case of being swapped out for a lot ofphk1994-09-251-11/+10
| | | | | | | | cycles. While waiting there I added a lot of the extra ()'s I have, (I have never used LISP to any extent). So I compiled the kernel with -Wall and shut up a lot of "suggest you add ()'s", removed a bunch of unused var's and added a couple of declarations here and there. Having a lap-top is highly recommended. My kernel still runs, yell at me if you kernel breaks.
* Whoops, accidently left out some pieces of the munmapfd patch.dg1994-09-021-1/+2
|
* Make sure that uio_resid isn't negative in read().dg1994-09-021-1/+5
|
* Added $Id$dg1994-08-021-0/+1
|
* The big 4.4BSD Lite to FreeBSD 2.0.0 (Development) patch.rgrimes1994-05-251-8/+9
| | | | | Reviewed by: Rodney W. Grimes Submitted by: John Dyson and David Greenman
* BSD 4.4 Lite Kernel Sourcesrgrimes1994-05-241-0/+683
OpenPOWER on IntegriCloud