Commit Graph

62 Commits

Author SHA1 Message Date
uebayasi 4d58dccaac Correct sizes to pass uvm_km_free(9) in error paths. 2011-07-30 06:19:02 +00:00
njoly f024404c50 Do not call put_type() but use copyout() when returning the message
segments to the user.

ok by rmind.
2009-01-28 00:59:03 +00:00
njoly 122f627e90 Make msgsnd(2)/msgrcv(2) fail with EINVAL for messages larger than
SSIZE_MAX. Adjust man pages accordingly.

ok by christos.
2009-01-26 13:08:48 +00:00
christos 461a86f9bd merge christos-time_t 2009-01-11 02:45:45 +00:00
rmind ea71ae9284 Fix the aligning of memory blocks again, finally...
Tested by <martin> on his sparc64 box.
2008-09-19 11:21:33 +00:00
njoly 12da67c77e Make msgsnd return EINVAL instead of 0, when the value of mtype is
less than 1.
2008-05-22 11:25:54 +00:00
martin ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
ad 77e0b2120f Patch up sysctl locking:
- Lock processes, credentials, filehead etc correctly.
- Acquire a read hold on sysctl_treelock if only doing a query.
- Don't wire down the output buffer. It doesn't work correctly and the code
  regularly does long term sleeps with it held - it's not worth it.
- Don't hold locks other than sysctl_lock while doing copyout().
- Drop sysctl_lock while doing copyout / allocating memory in a few places.
- Don't take kernel_lock for sysctl.
- Fix a number of bugs spotted along the way
2008-01-07 16:12:52 +00:00
dsl 7e2790cf6f Convert all the system call entry points from:
int foo(struct lwp *l, void *v, register_t *retval)
to:
    int foo(struct lwp *l, const struct foo_args *uap, register_t *retval)
Fixup compat code to not write into 'uap' and (in some cases) to actually
pass a correctly formatted 'uap' structure with the right name to the
next routine.
A few 'compat' routines that just call standard ones have been deleted.
All the 'compat' code compiles (along with the kernels required to test
build it).
98% done by automated scripts.
2007-12-20 23:02:38 +00:00
rmind 8cfca2b5e3 - Retry the operations (instead of failing) in case of reallocation.
Suggested by <yamt>.
- Use predicts in checks for reallocation state.
2007-11-25 19:03:24 +00:00
yamt b53fa282d6 fix deadlocks. 2007-11-04 13:09:32 +00:00
rmind defb3f5b28 Support for dynamic changing of SysV message queues and semaphores limits.
Also fixes the alignment problem, which was here forever.  Thanks for <uwe>
for discussion and <martin> for testing.

Reviewed by: <tech-kern>, <gdt>
2007-11-04 11:20:34 +00:00
rmind 662df2e4ad - Style, consistency;
- Replace most panic() checks with KASSERT();
- msgrcv1: Improve readability;
- Remove #ifdef ENOMSG;

No function changes of the interface are intented.
2007-10-09 03:27:37 +00:00
ad a240617e8c msgctl1: fix a lock leak. 2007-03-13 03:43:54 +00:00
ad b07ec3fc38 Merge newlock2 to head. 2007-02-09 21:55:00 +00:00
elad 1e70d64818 Consistent usage of KAUTH_GENERIC_ISSUSER. 2007-01-04 16:55:29 +00:00
yamt 1a7bc55dcc remove some __unused from function parameters. 2006-11-01 10:17:58 +00:00
christos 4d595fd7b1 - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
2006-10-12 01:30:41 +00:00
ad f474dceb13 Use the LWP cached credentials where sane. 2006-07-23 22:06:03 +00:00
kardel de4337ab21 merge FreeBSD timecounters from branch simonb-timecounters
- struct timeval time is gone
  time.tv_sec -> time_second
- struct timeval mono_time is gone
  mono_time.tv_sec -> time_uptime
- access to time via
	{get,}{micro,nano,bin}time()
	get* versions are fast but less precise
- support NTP nanokernel implementation (NTP API 4)
- further reading:
  Timecounter Paper: http://phk.freebsd.dk/pubs/timecounter.pdf
  NTP Nanokernel: http://www.eecis.udel.edu/~mills/ntp/html/kern.html
2006-06-07 22:33:33 +00:00
elad 215bd95ba4 integrate kauth. 2006-05-14 21:15:11 +00:00
cube ec9bafb3f3 Introduce msgrcv1 and msgsnd1 which take special care of the msg_type
parameter that gets copied in or out, making sys_msg{rcv,snd} friendly to
COMPAT_NETBSD32.
2006-03-06 14:24:13 +00:00
thorpej 218b07e98d Use ANSI function delcs. 2005-12-07 06:14:13 +00:00
yamt 6b2d8b66a4 merge yamt-km branch.
- don't use managed mappings/backing objects for wired memory allocations.
  save some resources like pv_entry.  also fix (most of) PR/27030.
- simplify kernel memory management API.
- simplify pmap bootstrap of some ports.
- some related cleanups.
2005-04-01 11:59:21 +00:00
perry da8abec863 nuke trailing whitespace 2005-02-26 21:34:55 +00:00
junyoung a222c81884 Nuke __P(). 2004-03-23 13:22:03 +00:00
jdolecek 2e59e9ae06 allocate virtual memory for SYSV shm, msg and semaphore structures
separately from the bufpages, so that it would be possible to eventually
make their limits changeable in runtime

make static all local variables which do not need to be exported to other
kernel parts
2003-10-26 10:32:24 +00:00
thorpej e0d8d366df Merge the nathanw_sa branch. 2003-01-18 10:06:22 +00:00
nathanw 3f0d660168 Make the debugging printfs compile:
- printf format checking doesn't like %x for pointers; use %p like we should.
 - LP64 fixes.
2002-03-05 23:28:58 +00:00
lukem adc783d537 add RCSIDs 2001-11-12 15:25:01 +00:00
simonb da251cb08f Delete a couple of <uvm/uvm_extern.h> includes that were for
<sys/sysctl.h> only.
2000-07-22 16:11:02 +00:00
mrg 32aa199ccf remove include of <vm/vm.h> 2000-06-27 17:41:07 +00:00
simonb 7e6435a651 White space nit in previous. 2000-06-02 16:05:49 +00:00
simonb 38cc1b3975 Add new sysctl node "KERN_SYSVIPC_INFO" with "KERN_SYSVIPC_MSG_INFO",
"KERN_SYSVIPC_SEM_INFO" and "KERN_SYSVIPC_SHM_INFO" to return the
info and data structures for the relevent SysV IPC types.  The return
structures use fixed-size types and should be compat32 safe.  All
user-visible changes are protected with
	#if !defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)

Make all variable declarations extern in msg.h, sem.h and shm.h and
add relevent variable declarations to sysv_*.c and remove unneeded
header files from those .c files.

Make compat14 SysV IPC conversion functions and sysctl_file() static.

Change the data pointer to "void *" in sysctl_clockrate(),
sysctl_ntptime(), sysctl_file() and sysctl_doeproc().
2000-06-02 15:53:03 +00:00
simonb 6008cfd5de Remove bogus "#ifdef EIDRM" checks and warnings that BSD doesn't define
EIDRM - EIDRM was added over two years ago!
2000-04-12 13:08:26 +00:00
augustss 264f1d27c6 Get rid of register declarations. 2000-03-30 09:27:11 +00:00
thorpej dc8ecaa15b Overhaul of the SVID IPC facilities, primarily to use the types specified
by the Single UNIX Specification version 2, rather than the SVR2-derived
types.  While I was here, I did a namespace sweep to expose the constants
and strucutures, and structure members described by SUSv2; documentation
updates coming shortly.

Fixes kern/8158.
1999-08-25 05:05:48 +00:00
mrg 58540a2274 properly test the msgsz as "msgsz - len". from PR#7386 1999-04-21 02:31:49 +00:00
tron bac6bb6bf2 No need to get definition of "SYSV..." from "opt_sysv.h" because they
must be set if these files are compiled.
1998-10-21 22:24:28 +00:00
tron bb56b72356 Defopt SYSVMSG, SYSVSEM and SYSVSHM. 1998-10-19 22:19:27 +00:00
kleink bd6d376a49 Various SysV IPC prototype changes. 1998-05-07 18:00:49 +00:00
christos f443b89c92 backout previous kprintf change 1996-10-13 02:32:29 +00:00
christos 153ead2dff - Use debugging printf - macros instead if #ifdef #endif everywhere
- printf -> kprintf, sprintf -> ksprintf
1996-10-10 22:43:21 +00:00
christos 09afd77655 More proto fixes 1996-02-09 18:59:18 +00:00
christos 8a5b1b92e2 First pass at prototyping 1996-02-04 02:15:01 +00:00
mycroft 245f292fed Prefix names of system call implementation functions with `sys_'. 1995-10-07 06:25:19 +00:00
thorpej 60024eb978 Make system calls conform to a standard prototype and bring those
prototypes into scope.
1995-09-19 21:40:36 +00:00
christos 1a5a3c9199 Extracted all of the compat_xxx routines, and created a library [libcompat]
for them. There are a few #ifdef COMPAT_XX remaining, but they are not easy
or worth eliminating (yet).
1995-06-24 20:33:55 +00:00
pk 1e52ad70a9 We need some compat_10 routines if COMPAT_SUNOS is on (PR #1008). 1995-06-05 12:56:54 +00:00
mycroft 7439778432 Use %p. 1995-03-19 23:44:44 +00:00